mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
household list of accompanying periods + upgrade DBAL version to 3.1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user