<?php
namespace App\Entity;
use App\Repository\OpenDayRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OpenDayRepository::class)]
#[ORM\HasLifecycleCallbacks]
class OpenDay
{
use \App\Traits\EntityDateTimeAbleTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $hour = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $minute = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $content = null;
#[ORM\OneToMany(targetEntity: OpenDayPerson::class, mappedBy: 'openDay')]
private Collection $openDayPeople;
#[ORM\Column(type: 'date', nullable: true)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $time = null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $status = null;
#[ORM\ManyToMany(targetEntity: Campus::class, inversedBy: 'openDay', cascade: ['persist'])]
private Collection $campuses;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $slug = null;
#[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
private ?\App\Entity\Media $photo = null;
#[ORM\ManyToOne(targetEntity: Campaign::class, inversedBy: 'openDays')]
private ?\App\Entity\Campaign $campaign = null;
public function __construct()
{
$this->openDayPeople = new ArrayCollection();
$this->campuses = new ArrayCollection();
}
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;
}
public function getHour(): ?string
{
return $this->hour;
}
public function setHour(?string $hour): self
{
$this->hour = $hour;
return $this;
}
public function getMinute(): ?string
{
return $this->minute;
}
public function setMinute(?string $minute): self
{
$this->minute = $minute;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
/**
* @return Collection<int, OpenDayPerson>
*/
public function getOpenDayPeople(): Collection
{
return $this->openDayPeople;
}
public function addOpenDayPerson(OpenDayPerson $openDayPerson): self
{
if (!$this->openDayPeople->contains($openDayPerson)) {
$this->openDayPeople[] = $openDayPerson;
$openDayPerson->setOpenDay($this);
}
return $this;
}
public function removeOpenDayPerson(OpenDayPerson $openDayPerson): self
{
if ($this->openDayPeople->removeElement($openDayPerson)) {
// set the owning side to null (unless already changed)
if ($openDayPerson->getOpenDay() === $this) {
$openDayPerson->setOpenDay(null);
}
}
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getTime(): ?string
{
return $this->time;
}
public function setTime(?string $time): self
{
$this->time = $time;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(?int $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, Campus>
*/
public function getCampuses(): Collection
{
return $this->campuses;
}
public function addCampus(Campus $campus): self
{
if (!$this->campuses->contains($campus)) {
$this->campuses[] = $campus;
}
return $this;
}
public function removeCampus(Campus $campus): self
{
$this->campuses->removeElement($campus);
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getPhoto(): ?Media
{
return $this->photo;
}
public function setPhoto(?Media $photo): self
{
$this->photo = $photo;
return $this;
}
public function getCampaign(): ?Campaign
{
return $this->campaign;
}
public function setCampaign(?Campaign $campaign): self
{
$this->campaign = $campaign;
return $this;
}
}