mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-25 08:05:00 +00:00
121 lines
2.5 KiB
PHP
121 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace Chill\PersonBundle\Entity\SocialWork;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="chill_person_social_work_goal")
|
|
*/
|
|
class Goal
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(type="json")
|
|
*/
|
|
private $title = [];
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime", nullable=true)
|
|
*/
|
|
private $desactivationDate;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity=SocialAction::class, mappedBy="goals")
|
|
*/
|
|
private $socialActions;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="goals")
|
|
* @ORM\JoinTable(name="chill_person_social_work_goal_result")
|
|
*/
|
|
private $results;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->socialActions = new ArrayCollection();
|
|
$this->results = new ArrayCollection();
|
|
}
|
|
|
|
public function getTitle(): array
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function setTitle(array $title): self
|
|
{
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDesactivationDate(): ?\DateTimeInterface
|
|
{
|
|
return $this->desactivationDate;
|
|
}
|
|
|
|
public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self
|
|
{
|
|
$this->desactivationDate = $desactivationDate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|SocialAction[]
|
|
*/
|
|
public function getSocialActions(): Collection
|
|
{
|
|
return $this->socialActions;
|
|
}
|
|
|
|
public function addSocialAction(SocialAction $socialAction): self
|
|
{
|
|
if (!$this->socialActions->contains($socialAction)) {
|
|
$this->socialActions[] = $socialAction;
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeSocialAction(SocialAction $socialAction): self
|
|
{
|
|
$this->socialActions->removeElement($socialAction);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Result[]
|
|
*/
|
|
public function getResults(): Collection
|
|
{
|
|
return $this->results;
|
|
}
|
|
|
|
public function addResult(Result $result): self
|
|
{
|
|
if (!$this->results->contains($result)) {
|
|
$this->results[] = $result;
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeResult(Result $result): self
|
|
{
|
|
$this->results->removeElement($result);
|
|
|
|
return $this;
|
|
}
|
|
}
|