mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
accompanying period validation - on social issues suppression
This commit is contained in:
@@ -25,6 +25,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
@@ -58,6 +59,8 @@ use const SORT_REGULAR;
|
||||
* "this.isConfidential and this.getUser === NULL",
|
||||
* message="If the accompanying course is confirmed and confidential, a referrer must remain assigned."
|
||||
* )
|
||||
*
|
||||
* @AccompanyingPeriodValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*/
|
||||
class AccompanyingPeriod implements
|
||||
GroupSequenceProviderInterface,
|
||||
|
@@ -121,6 +121,27 @@ class SocialIssue
|
||||
return $ancestors;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all the ancestors of the social issue
|
||||
*
|
||||
* @param bool $includeThis if the array in the result must include the present SocialIssue
|
||||
*/
|
||||
public function getAncestors(bool $includeThis = true): array
|
||||
{
|
||||
$ancestors = [];
|
||||
|
||||
if ($includeThis) {
|
||||
$ancestors[] = $this;
|
||||
}
|
||||
|
||||
$current = $this;
|
||||
while ($current->hasParent()) {
|
||||
$ancestors[] = $current = $current->getParent();
|
||||
}
|
||||
|
||||
return $ancestors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|self[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user