<?php
namespace App\Entity;
use App\Repository\SpeakerConsultationRepeatRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SpeakerConsultationRepeatRepository::class)
*/
class SpeakerConsultationRepeat
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $every = 1;
/**
* @ORM\Column(type="string", length=5)
*/
private $type = 'day';
/**
* @ORM\Column(type="array", nullable=true)
*/
private $weekDay = [];
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $monthDay;
/**
* @ORM\Column(type="date")
*/
private $endDate;
/**
* @ORM\OneToMany(targetEntity=SpeakerConsultation::class, mappedBy="repeatSettings")
*/
private $speakerConsultations;
public function __construct()
{
$this->speakerConsultations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEvery(): ?int
{
return $this->every;
}
public function setEvery(int $every): self
{
$this->every = $every;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getWeekDay(): ?array
{
return $this->weekDay;
}
public function setWeekDay(?array $weekDay): self
{
$this->weekDay = $weekDay;
return $this;
}
public function getMonthDay(): ?int
{
return $this->monthDay;
}
public function setMonthDay(?int $monthDay): self
{
$this->monthDay = $monthDay;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
/**
* @return Collection|SpeakerConsultation[]
*/
public function getSpeakerConsultations(): Collection
{
return $this->speakerConsultations;
}
public function addSpeakerConsultation(SpeakerConsultation $speakerConsultation): self
{
if (!$this->speakerConsultations->contains($speakerConsultation)) {
$this->speakerConsultations[] = $speakerConsultation;
$speakerConsultation->setRepeatSettings($this);
}
return $this;
}
public function removeSpeakerConsultation(SpeakerConsultation $speakerConsultation): self
{
if ($this->speakerConsultations->removeElement($speakerConsultation)) {
// set the owning side to null (unless already changed)
if ($speakerConsultation->getRepeatSettings() === $this) {
$speakerConsultation->setRepeatSettings(null);
}
}
return $this;
}
}