src/Entity/Theme.php line 12
<?php
namespace App\Entity;
use App\Repository\ThemeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ThemeRepository::class)]
class Theme
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $labelFr = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $labelEn = null;
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
private ?int $position = null;
#[ORM\Column(nullable: true)]
private ?int $createdBy = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updatedAt = null;
# [ORM\OneToMany(targetEntity: EventAbstract::class, mappedBy: 'theme')]
// private Collection $eventAbstract;
#[ORM\ManyToMany(targetEntity: EventAbstract::class, mappedBy: 'themes')]
private Collection $eventAbstracts;
public function __construct()
{
// $this->eventAbstract = new ArrayCollection();
$this->eventAbstracts = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabelFr(): ?string
{
return $this->labelFr;
}
public function setLabelFr(?string $labelFr): static
{
$this->labelFr = $labelFr;
return $this;
}
public function getLabelEn(): ?string
{
return $this->labelEn;
}
public function setLabelEn(?string $labelEn): static
{
$this->labelEn = $labelEn;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(?int $position): static
{
$this->position = $position;
return $this;
}
public function getCreatedBy(): ?int
{
return $this->createdBy;
}
public function setCreatedBy(?int $createdBy): static
{
$this->createdBy = $createdBy;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection<int, EventAbstract>
*/
public function getEventAbstracts(): Collection
{
return $this->eventAbstracts;
}
public function addEventAbstract(EventAbstract $eventAbstract): static
{
if (!$this->eventAbstracts->contains($eventAbstract)) {
$this->eventAbstracts->add($eventAbstract);
$eventAbstract->addTheme($this);
}
return $this;
}
public function removeEventAbstract(EventAbstract $eventAbstract): static
{
if ($this->eventAbstracts->removeElement($eventAbstract)) {
if ($eventAbstract->getThemes()->contains($this)) {
$eventAbstract->removeTheme($this);
}
}
return $this;
}
}