Load social work, and fix some repositories

This commit is contained in:
2021-07-30 23:42:30 +02:00
committed by Marc Ducobu
parent 8a962a4f1c
commit 0e2e7155fb
9 changed files with 623 additions and 427 deletions

View File

@@ -841,7 +841,9 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
public function addSocialIssue(SocialIssue $socialIssue): self
{
$this->socialIssues[] = $socialIssue;
if (!$this->socialIssues->contains($socialIssue)) {
$this->socialIssues[] = $socialIssue;
}
return $this;
}

View File

@@ -19,6 +19,9 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @internal the default name exceeds 64 characters, we must set manually:
* @ORM\SequenceGenerator(sequenceName="chill_person_social_work_eval_doc_id_seq", allocationSize=1, initialValue=1000)
*/
private ?int $id;
/**

View File

@@ -23,17 +23,20 @@ class Evaluation
private $title = [];
/**
* @ORM\Column(type="dateinterval", nullable=true)
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
*/
private $delay;
/**
* @ORM\Column(type="dateinterval")
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
*/
private $notificationDelay;
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class)
* @ORM\ManyToOne(
* targetEntity=SocialAction::class,
* inversedBy="evaluations"
* )
*/
private $socialAction;

View File

@@ -68,6 +68,15 @@ class SocialAction
*/
private $results;
/**
* @var Collection
* @ORM\OneToMany(
* targetEntity=Evaluation::class,
* mappedBy="socialAction"
* )
*/
private Collection $evaluations;
public function __construct()
{
$this->children = new ArrayCollection();
@@ -257,4 +266,12 @@ class SocialAction
return $this;
}
/**
* @return Collection
*/
public function getEvaluations(): Collection
{
return $this->evaluations;
}
}