mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
handling multi types and acc-period/repositories endpoint
This commit is contained in:
@@ -231,7 +231,9 @@ class AccompanyingPeriod
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod\Resource",
|
||||
* mappedBy="accompanyingPeriod"
|
||||
* mappedBy="accompanyingPeriod",
|
||||
* cascade={"persist", "remove"},
|
||||
* orphanRemoval=true
|
||||
* )
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
@@ -692,6 +694,7 @@ class AccompanyingPeriod
|
||||
|
||||
public function addResource(Resource $resource): self
|
||||
{
|
||||
$resource->setAccompanyingPeriod($this);
|
||||
$this->resources[] = $resource;
|
||||
|
||||
return $this;
|
||||
@@ -699,6 +702,7 @@ class AccompanyingPeriod
|
||||
|
||||
public function removeResource(Resource $resource): void
|
||||
{
|
||||
$resource->setAccompanyingPeriod(null);
|
||||
$this->resources->removeElement($resource);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user