mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
adding Entities Location and LocationType (for activity/calendar) + doctrine migration
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Chill\CalendarBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -136,6 +137,13 @@ class Calendar
|
||||
*/
|
||||
private ?bool $sendSMS;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
|
||||
* @groups({"read"})
|
||||
*/
|
||||
private ?Location $location = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->comment = new CommentEmbeddable();
|
||||
@@ -354,7 +362,7 @@ class Calendar
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPersonsAssociated(): array
|
||||
public function getPersonsAssociated(): array
|
||||
{
|
||||
if (null !== $this->accompanyingPeriod) {
|
||||
$personsAssociated = [];
|
||||
@@ -363,11 +371,11 @@ class Calendar
|
||||
$personsAssociated[] = $participation->getPerson();
|
||||
}
|
||||
}
|
||||
return $personsAssociated;
|
||||
return $personsAssociated;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
public function getPersonsNotAssociated(): array
|
||||
{
|
||||
if (null !== $this->accompanyingPeriod) {
|
||||
@@ -407,4 +415,22 @@ class Calendar
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Location|null
|
||||
*/
|
||||
public function getLocation(): ?Location
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Location|null $location
|
||||
* @return Calendar
|
||||
*/
|
||||
public function setLocation(?Location $location): Calendar
|
||||
{
|
||||
$this->location = $location;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user