Merge branch '50-ajout-problematique-sociale-modele' into 139_demandeur

This commit is contained in:
2021-05-18 16:11:18 +02:00
15 changed files with 607 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
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\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@@ -241,6 +242,16 @@ class AccompanyingPeriod
*/
private $resources;
/**
* @ORM\ManyToMany(
* targetEntity=SocialIssue::class
* )
* @ORM\JoinTable(
* name="chill_person_accompanying_period_social_issues"
* )
*/
private Collection $socialIssues;
/**
* AccompanyingPeriod constructor.
*
@@ -251,6 +262,7 @@ class AccompanyingPeriod
$this->setOpeningDate($dateOpening);
$this->participations = new ArrayCollection();
$this->scopes = new ArrayCollection();
$this->socialIssues = new ArrayCollection();
}
/**
@@ -461,7 +473,7 @@ class AccompanyingPeriod
return false;
}
$participation = $this->participationsContainsPerson($person);
$participation = $this->getParticipationsContainsPerson($person);
if (!null === $participation)
{
$person = $participation->getPerson();
@@ -710,6 +722,23 @@ class AccompanyingPeriod
$this->resources->removeElement($resource);
}
public function getSocialIssues(): Collection
{
return $this->socialIssues;
}
public function addSocialIssues(SocialIssue $socialIssue): self
{
$this->socialIssues[] = $socialIssue;
return $this;
}
public function removeSocialIssue(SocialIssue $socialissue): void
{
$this->socialIssues->removeElement($socialIssue);
}
/**
* Get a list of all persons which are participating to this course
*/