src/Entity/Timer.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\TimerRepository;
  5. use Gedmo\Translatable\Translatable;
  6. use App\Entity\Translation\PageTranslation;
  7. use App\Entity\Translation\TimerTranslation;
  8. use Gedmo\Mapping\Annotation\TranslationEntity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  11. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  12. #[ORM\Entity(repositoryClassTimerRepository::class)]
  13. #[TranslationEntity(class: TimerTranslation::class)]
  14. class Timer implements EntityInterface
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $color null;
  22.     #[GedmoTranslatable]
  23.     #[ORM\Column(length255)]
  24.     private ?string $name null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $href null;
  27.     #[ORM\Column]
  28.     private ?int $end null;
  29.     #[ORM\Column]
  30.     private ?bool $visible null;
  31.     #[GedmoLocale]
  32.     private $locale;
  33.     
  34.     #[ORM\OneToMany(targetEntityTimerTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  35.     private $translations;
  36.     public function __construct()
  37.     {
  38.         $this->translations = new ArrayCollection();
  39.     }
  40.     public function setLocale($locale)
  41.     {
  42.         $this->locale $locale;
  43.     }
  44.     public function getTranslations()
  45.     {
  46.         return $this->translations;
  47.     }
  48.     public function addTranslation(TimerTranslation $t)
  49.     {
  50.         if (!$this->translations->contains($t)) {
  51.             $this->translations[] = $t;
  52.             $t->setObject($this);
  53.         }
  54.     }
  55.     
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getColor(): ?string
  61.     {
  62.         return $this->color;
  63.     }
  64.     public function setColor(string $color): self
  65.     {
  66.         $this->color $color;
  67.         return $this;
  68.     }
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     public function setName(string $name): self
  74.     {
  75.         $this->name $name;
  76.         return $this;
  77.     }
  78.     public function getHref(): ?string
  79.     {
  80.         return $this->href;
  81.     }
  82.     public function setHref(string $href): self
  83.     {
  84.         $this->href $href;
  85.         return $this;
  86.     }
  87.     public function getEnd(): ?int
  88.     {
  89.         return $this->end;
  90.     }
  91.     public function setEnd(int $end): self
  92.     {
  93.         $this->end $end;
  94.         return $this;
  95.     }
  96.     public function isVisible(): ?bool
  97.     {
  98.         return $this->visible;
  99.     }
  100.     public function setVisible(bool $visible): self
  101.     {
  102.         $this->visible $visible;
  103.         return $this;
  104.     }
  105. }