<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\TimerRepository;
use Gedmo\Translatable\Translatable;
use App\Entity\Translation\PageTranslation;
use App\Entity\Translation\TimerTranslation;
use Gedmo\Mapping\Annotation\TranslationEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
#[ORM\Entity(repositoryClass: TimerRepository::class)]
#[TranslationEntity(class: TimerTranslation::class)]
class Timer implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $color = null;
#[GedmoTranslatable]
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $href = null;
#[ORM\Column]
private ?int $end = null;
#[ORM\Column]
private ?bool $visible = null;
#[GedmoLocale]
private $locale;
#[ORM\OneToMany(targetEntity: TimerTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
private $translations;
public function __construct()
{
$this->translations = new ArrayCollection();
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getTranslations()
{
return $this->translations;
}
public function addTranslation(TimerTranslation $t)
{
if (!$this->translations->contains($t)) {
$this->translations[] = $t;
$t->setObject($this);
}
}
public function getId(): ?int
{
return $this->id;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(string $color): self
{
$this->color = $color;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getHref(): ?string
{
return $this->href;
}
public function setHref(string $href): self
{
$this->href = $href;
return $this;
}
public function getEnd(): ?int
{
return $this->end;
}
public function setEnd(int $end): self
{
$this->end = $end;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
}