first impl of event (WIP)

This commit is contained in:
2022-02-11 10:31:17 +01:00
parent f2221565c5
commit 441704dc29
5 changed files with 330 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodLocationHistory;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
@@ -113,6 +114,12 @@ class AccompanyingPeriod implements
*/
public const STEP_DRAFT = 'DRAFT';
/**
* @ORM\OneToMany(targetEntity=AccompanyingPeriodLocationHistory::class,
* mappedBy="period")
*/
private Collection $locationHistories;
/**
* @ORM\ManyToOne(
* targetEntity=Address::class
@@ -384,6 +391,7 @@ class AccompanyingPeriod implements
$this->works = new ArrayCollection();
$this->resources = new ArrayCollection();
$this->userHistories = new ArrayCollection();
$this->locationHistories = new ArrayCollection();
}
/**
@@ -1036,7 +1044,9 @@ class AccompanyingPeriod implements
*/
public function setAddressLocation(?Address $addressLocation = null): self
{
$this->addressLocation = $addressLocation;
if ($this->addressLocation !== $addressLocation) {
$this->addressLocation = $addressLocation;
}
return $this;
}
@@ -1259,4 +1269,28 @@ class AccompanyingPeriod implements
return $this;
}
public function getLocationHistories(): Collection
{
return $this->locationHistories;
}
public function addLocationHistory(AccompanyingPeriodLocationHistory $history): self
{
if (!$this->locationHistories->contains($history)) {
$this->locationHistories[] = $history;
$history->setPeriod($this);
}
return $this;
}
public function removeLocationHistory(AccompanyingPeriodLocationHistory $history): self
{
if ($this->locationHistories->removeElement($history)) {
$history->setPeriod(null);
}
return $this;
}
}