mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
@@ -95,6 +95,7 @@ class Person implements HasCenterInterface {
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
* @deprecated
|
||||
*/
|
||||
private $proxyAccompanyingPeriodOpenState = false; //TO-DELETE ?
|
||||
|
||||
@@ -168,11 +169,12 @@ class Person implements HasCenterInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the opened accompanying period.
|
||||
*
|
||||
* @return null|AccompanyingPeriod
|
||||
* @return AccompanyingPeriod
|
||||
*/
|
||||
public function getCurrentAccompanyingPeriod() {
|
||||
if ($this->proxyAccompanyingPeriodOpenState === false) {
|
||||
public function getOpenedAccompanyingPeriod() {
|
||||
if ($this->isOpen() === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -183,6 +185,17 @@ class Person implements HasCenterInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the opened accompanying period.
|
||||
*
|
||||
* @return AccompanyingPeriod
|
||||
* @deprecated since 1.1 use `getOpenedAccompanyingPeriod instead
|
||||
*/
|
||||
public function getCurrentAccompanyingPeriod()
|
||||
{
|
||||
return $this->getOpenedAccompanyingPeriod();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\ArrayCollection
|
||||
@@ -230,8 +243,20 @@ class Person implements HasCenterInterface {
|
||||
return $periods;
|
||||
}
|
||||
|
||||
public function isOpen() {
|
||||
return $this->proxyAccompanyingPeriodOpenState;
|
||||
/**
|
||||
* check if the person is opened
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isOpen()
|
||||
{
|
||||
foreach ($this->getAccompanyingPeriods() as $period) {
|
||||
if ($period->isOpen()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user