mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
add many2many relation between socialIssue and accompanying period + api endpoint
This commit is contained in:
@@ -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;
|
||||
@@ -215,6 +216,16 @@ class AccompanyingPeriod
|
||||
*/
|
||||
private $resources;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity=SocialIssue::class
|
||||
* )
|
||||
* @ORM\JoinTable(
|
||||
* name="chill_person_accompanying_period_social_issues"
|
||||
* )
|
||||
*/
|
||||
private Collection $socialIssues;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriod constructor.
|
||||
*
|
||||
@@ -225,6 +236,7 @@ class AccompanyingPeriod
|
||||
$this->setOpeningDate($dateOpening);
|
||||
$this->participations = new ArrayCollection();
|
||||
$this->scopes = new ArrayCollection();
|
||||
$this->socialIssues = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -648,6 +660,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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user