layout for form

This commit is contained in:
2021-06-21 13:38:43 +02:00
parent aa4a9e874a
commit 40fcb09082
16 changed files with 516 additions and 78 deletions

View File

@@ -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;
}
}