Entites for AccomanyingPeriodWork, AccomanyingPeriodWorkGoal & Social/WorkEvaluation

This commit is contained in:
Marc Ducobu
2021-04-27 15:10:56 +02:00
parent 38ac3badef
commit 0f9a395dfc
7 changed files with 642 additions and 0 deletions

View File

@@ -0,0 +1,93 @@
<?php
namespace App\Entity\Chill\PersonBundle\Entity\SocialWork;
use App\Repository\Chill\PersonBundle\Entity\SocialWork\EvaluationRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EvaluationRepository::class)
* @ORM\Table(name="chill_person_social_work_evaluation")
*/
class Evaluation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="json")
*/
private $title = [];
/**
* @ORM\Column(type="dateinterval")
*/
private $delay;
/**
* @ORM\Column(type="dateinterval")
*/
private $notificationDelay;
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class)
*/
private $socialAction;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): array
{
return $this->title;
}
public function setTitle(array $title): self
{
$this->title = $title;
return $this;
}
public function getDelay(): ?\DateInterval
{
return $this->delay;
}
public function setDelay(\DateInterval $delay): self
{
$this->delay = $delay;
return $this;
}
public function getNotificationDelay(): ?\DateInterval
{
return $this->notificationDelay;
}
public function setNotificationDelay(\DateInterval $notificationDelay): self
{
$this->notificationDelay = $notificationDelay;
return $this;
}
public function getSocialAction(): ?SocialAction
{
return $this->socialAction;
}
public function setSocialAction(?SocialAction $socialAction): self
{
$this->socialAction = $socialAction;
return $this;
}
}

View File

@@ -2,6 +2,8 @@
namespace App\Entity\Chill\PersonBundle\Entity\SocialWork;
use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal;
use App\Repository\Chill\PersonBundle\Entity\SocialWork\ResultRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@@ -40,10 +42,22 @@ class Result
*/
private $goals;
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results")
*/
private $accompanyingPeriodWorks;
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results")
*/
private $accompanyingPeriodWorkGoals;
public function __construct()
{
$this->socialActions = new ArrayCollection();
$this->goals = new ArrayCollection();
$this->accompanyingPeriodWorks = new ArrayCollection();
$this->accompanyingPeriodWorkGoals = new ArrayCollection();
}
public function getId(): ?int
@@ -122,4 +136,52 @@ class Result
return $this;
}
/**
* @return Collection|AccompanyingPeriodWork[]
*/
public function getAccompanyingPeriodWorks(): Collection
{
return $this->accompanyingPeriodWorks;
}
public function addAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self
{
if (!$this->accompanyingPeriodWorks->contains($accompanyingPeriod)) {
$this->accompanyingPeriodWorks[] = $accompanyingPeriod;
}
return $this;
}
public function removeAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self
{
$this->accompanyingPeriodWorks->removeElement($accompanyingPeriod);
return $this;
}
/**
* @return Collection|AccompanyingPeriodWorkGoal[]
*/
public function getAccompanyingPeriodWorkGoals(): Collection
{
return $this->accompanyingPeriodWorkGoals;
}
public function addAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self
{
if (!$this->accompanyingPeriodWorkGoals->contains($accompanyingPeriodWorkGoal)) {
$this->accompanyingPeriodWorkGoals[] = $accompanyingPeriodWorkGoal;
}
return $this;
}
public function removeAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self
{
$this->accompanyingPeriodWorkGoals->removeElement($accompanyingPeriodWorkGoal);
return $this;
}
}