2022-03-06 18:25:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
use App\Core\Entity\EntityInterface;
|
|
|
|
use App\Repository\SpeakerRepository;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
2022-04-16 23:29:17 +02:00
|
|
|
use App\Security\EncryptedEntityInterface;
|
2022-03-06 18:25:46 +01:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Entity(repositoryClass: SpeakerRepository::class)]
|
2022-04-16 23:29:17 +02:00
|
|
|
class Speaker implements EntityInterface, EncryptedEntityInterface
|
2022-03-06 18:25:46 +01:00
|
|
|
{
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Id]
|
|
|
|
#[ORM\GeneratedValue]
|
|
|
|
#[ORM\Column(type: 'integer')]
|
2022-04-15 16:45:58 +02:00
|
|
|
protected $id;
|
2022-03-06 18:25:46 +01:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'string', length: 255)]
|
2022-04-15 16:45:58 +02:00
|
|
|
protected $name;
|
2022-03-06 18:25:46 +01:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\ManyToMany(targetEntity: Intervention::class, mappedBy: 'speakers', cascade: ['persist'])]
|
2022-04-15 16:45:58 +02:00
|
|
|
protected $interventions;
|
2022-03-06 18:25:46 +01:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
2022-04-16 23:29:17 +02:00
|
|
|
protected $caldavHost;
|
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
2022-04-16 23:29:17 +02:00
|
|
|
protected $caldavUsername;
|
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'blob', nullable: true)]
|
2022-04-16 23:29:17 +02:00
|
|
|
protected $caldavPassword;
|
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
2022-04-16 23:29:17 +02:00
|
|
|
protected $caldavCalendarUri;
|
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\ManyToMany(targetEntity: Event::class, mappedBy: 'speakers')]
|
2022-06-26 19:08:40 +02:00
|
|
|
protected $events;
|
2022-04-16 23:29:17 +02:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\Column(type: 'string', length: 30, nullable: true)]
|
2022-06-26 19:08:40 +02:00
|
|
|
protected $color;
|
2022-04-17 16:38:18 +02:00
|
|
|
|
2022-12-19 18:35:10 +01:00
|
|
|
#[ORM\ManyToMany(targetEntity: Conference::class, mappedBy: 'speakers')]
|
2022-06-26 19:08:40 +02:00
|
|
|
protected $conferences;
|
2022-05-17 22:19:51 +02:00
|
|
|
|
2022-03-06 18:25:46 +01:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->interventions = new ArrayCollection();
|
2022-04-16 23:29:17 +02:00
|
|
|
$this->events = new ArrayCollection();
|
2022-05-17 22:19:51 +02:00
|
|
|
$this->conferences = new ArrayCollection();
|
2022-03-06 18:25:46 +01:00
|
|
|
}
|
|
|
|
|
2022-03-06 19:12:11 +01:00
|
|
|
public function __toString()
|
|
|
|
{
|
|
|
|
return $this->getName();
|
|
|
|
}
|
|
|
|
|
2022-03-06 18:25:46 +01:00
|
|
|
public function getId(): ?int
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(): ?string
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setName(string $name): self
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Collection<int, Intervention>
|
|
|
|
*/
|
|
|
|
public function getInterventions(): Collection
|
|
|
|
{
|
|
|
|
return $this->interventions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addIntervention(Intervention $intervention): self
|
|
|
|
{
|
|
|
|
if (!$this->interventions->contains($intervention)) {
|
|
|
|
$this->interventions[] = $intervention;
|
|
|
|
$intervention->addSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function removeIntervention(Intervention $intervention): self
|
|
|
|
{
|
|
|
|
if ($this->interventions->removeElement($intervention)) {
|
|
|
|
$intervention->removeSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2022-04-16 23:29:17 +02:00
|
|
|
|
|
|
|
public function getCaldavHost(): ?string
|
|
|
|
{
|
|
|
|
return $this->caldavHost;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCaldavHost(?string $caldavHost): self
|
|
|
|
{
|
|
|
|
$this->caldavHost = $caldavHost;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCaldavUsername(): ?string
|
|
|
|
{
|
|
|
|
return $this->caldavUsername;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCaldavUsername(?string $caldavUsername): self
|
|
|
|
{
|
|
|
|
$this->caldavUsername = $caldavUsername;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCaldavPassword()
|
|
|
|
{
|
|
|
|
return $this->caldavPassword;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCaldavPassword(?string $caldavPassword): self
|
|
|
|
{
|
|
|
|
$this->caldavPassword = $caldavPassword;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCaldavCalendarUri(): ?string
|
|
|
|
{
|
|
|
|
return $this->caldavCalendarUri;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCaldavCalendarUri(?string $caldavCalendarUri): self
|
|
|
|
{
|
|
|
|
$this->caldavCalendarUri = $caldavCalendarUri;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getEncryptedProperties(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'caldavPassword',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Collection<int, Event>
|
|
|
|
*/
|
|
|
|
public function getEvents(): Collection
|
|
|
|
{
|
|
|
|
return $this->events;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addEvent(Event $event): self
|
|
|
|
{
|
|
|
|
if (!$this->events->contains($event)) {
|
|
|
|
$this->events[] = $event;
|
|
|
|
$event->addSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function removeEvent(Event $event): self
|
|
|
|
{
|
|
|
|
if ($this->events->removeElement($event)) {
|
|
|
|
$event->removeSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2022-04-17 16:38:18 +02:00
|
|
|
|
|
|
|
public function getColor(): ?string
|
|
|
|
{
|
|
|
|
return $this->color;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setColor(?string $color): self
|
|
|
|
{
|
|
|
|
$this->color = $color;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2022-05-17 22:19:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Collection<int, Conference>
|
|
|
|
*/
|
|
|
|
public function getConferences(): Collection
|
|
|
|
{
|
|
|
|
return $this->conferences;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addConference(Conference $conference): self
|
|
|
|
{
|
|
|
|
if (!$this->conferences->contains($conference)) {
|
|
|
|
$this->conferences[] = $conference;
|
|
|
|
$conference->addSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function removeConference(Conference $conference): self
|
|
|
|
{
|
|
|
|
if ($this->conferences->removeElement($conference)) {
|
|
|
|
$conference->removeSpeaker($this);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2022-03-06 18:25:46 +01:00
|
|
|
}
|