mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
@@ -186,11 +186,36 @@ class AccompanyingPeriod
|
||||
return $this->closingMotive;
|
||||
}
|
||||
|
||||
public function setClosingMotive(AccompanyingPeriod\ClosingMotive $closingMotive)
|
||||
public function setClosingMotive(AccompanyingPeriod\ClosingMotive $closingMotive = null)
|
||||
{
|
||||
$this->closingMotive = $closingMotive;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the period can be reopened.
|
||||
*
|
||||
* This function test if the period is closed and if the period is the last
|
||||
* for the associated person
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function canBeReOpened()
|
||||
{
|
||||
if ($this->isOpen() === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$periods = $this->getPerson()->getAccompanyingPeriodsOrdered();
|
||||
|
||||
return end($periods) === $this;
|
||||
}
|
||||
|
||||
public function reOpen()
|
||||
{
|
||||
$this->setClosingDate(null);
|
||||
$this->setClosingMotive(null);
|
||||
}
|
||||
|
||||
/// VALIDATION function
|
||||
public function isDateConsistent(ExecutionContextInterface $context) {
|
||||
|
Reference in New Issue
Block a user