mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Feature: [calendar] associate a calendar with a person: update schema
This commit is contained in:
@@ -169,6 +169,12 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?User $mainUser = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private ?Person $person;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person", inversedBy="calendars")
|
||||
* @ORM\JoinTable(name="chill_calendar.calendar_to_persons")
|
||||
@@ -379,6 +385,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->mainUser;
|
||||
}
|
||||
|
||||
public function getPerson(): ?Person
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Person[]
|
||||
*/
|
||||
@@ -639,6 +650,13 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPerson(?Person $person): Calendar
|
||||
{
|
||||
$this->person = $person;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
|
||||
{
|
||||
$this->privateComment = $privateComment;
|
||||
|
Reference in New Issue
Block a user