mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
layout for form
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Chill\PersonBundle\Entity;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
@@ -39,6 +40,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriod Class
|
||||
@@ -280,6 +282,15 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private \DateTimeInterface $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=AccompanyingPeriodWork::class,
|
||||
* mappedBy="accompanyingPeriod"
|
||||
* )
|
||||
* @Assert\Valid(traverse=true)
|
||||
*/
|
||||
private Collection $works;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriod constructor.
|
||||
*
|
||||
@@ -292,6 +303,7 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
||||
$this->scopes = new ArrayCollection();
|
||||
$this->socialIssues = new ArrayCollection();
|
||||
$this->comments = new ArrayCollection();
|
||||
$this->works = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -896,4 +908,28 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AccompanyingPeriodWork[]
|
||||
*/
|
||||
public function getWorks(): Collection
|
||||
{
|
||||
return $this->works;
|
||||
}
|
||||
|
||||
public function addWork(AccompanyingPeriodWork $work): self
|
||||
{
|
||||
$this->works[] = $work;
|
||||
$work->setAccompanyingPeriod($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeWork(AccompanyingPeriodWork $work): self
|
||||
{
|
||||
$this->work->removeElement($work);
|
||||
$work->setAccompanyingPeriod(null);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user