household list of accompanying periods + upgrade DBAL version to 3.1

This commit is contained in:
2021-11-08 10:57:14 +00:00
committed by Julien Fastré
parent 092ea4d57f
commit 7fabe0214e
49 changed files with 353 additions and 286 deletions

View File

@@ -41,14 +41,14 @@ class MaritalStatus
/**
* @var string array
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
/**
* Get id
*
* @return string
* @return string
*/
public function getId()
{
@@ -57,7 +57,7 @@ class MaritalStatus
/**
* Set id
*
*
* @param string $id
* @return MaritalStatus
*/
@@ -76,17 +76,17 @@ class MaritalStatus
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string array
* @return string array
*/
public function getName()
{
return $this->name;
}
}
}

View File

@@ -406,7 +406,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* Array where customfield's data are stored
* @var array
*
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $cFData;
@@ -613,6 +613,26 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $accompanyingPeriods;
}
/**
* Get current accompanyingPeriods array
*/
public function getCurrentAccompanyingPeriods(): array
{
$currentAccompanyingPeriods = [];
$currentDate = new DateTime();
foreach ($this->accompanyingPeriodParticipations as $participation)
{
$endDate = $participation->getEndDate();
if ($endDate === null || $endDate > $currentDate){
$currentAccompanyingPeriods[] = $participation->getAccompanyingPeriod();
}
}
return $currentAccompanyingPeriods;
}
/**
* Get AccompanyingPeriodParticipations Collection
*