Feature: [calendar] associate a calendar with a person: update schema

This commit is contained in:
2022-10-21 11:28:59 +02:00
parent c04e408d9d
commit 43dcb46d38
2 changed files with 53 additions and 0 deletions

View File

@@ -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;