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.     #[GedmoTranslatable]
  27.     private ?string $href null;
  28.     #[ORM\Column]
  29.     private ?int $end null;
  30.     #[ORM\Column]
  31.     private ?bool $visible null;
  32.     #[GedmoLocale]
  33.     private $locale;
  34.     
  35.     #[ORM\OneToMany(targetEntityTimerTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  36.     private $translations;
  37.     public function __construct()
  38.     {
  39.         $this->translations = new ArrayCollection();
  40.     }
  41.     public function setLocale($locale)
  42.     {
  43.         $this->locale $locale;
  44.     }
  45.     public function getTranslations()
  46.     {
  47.         return $this->translations;
  48.     }
  49.     public function addTranslation(TimerTranslation $t)
  50.     {
  51.         if (!$this->translations->contains($t)) {
  52.             $this->translations[] = $t;
  53.             $t->setObject($this);
  54.         }
  55.     }
  56.     
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getColor(): ?string
  62.     {
  63.         return $this->color;
  64.     }
  65.     public function setColor(string $color): self
  66.     {
  67.         $this->color $color;
  68.         return $this;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(string $name): self
  75.     {
  76.         $this->name $name;
  77.         return $this;
  78.     }
  79.     public function getHref(): ?string
  80.     {
  81.         return $this->href;
  82.     }
  83.     public function setHref(string $href): self
  84.     {
  85.         $this->href $href;
  86.         return $this;
  87.     }
  88.     public function getEnd(): ?int
  89.     {
  90.         return $this->end;
  91.     }
  92.     public function setEnd(int $end): self
  93.     {
  94.         $this->end $end;
  95.         return $this;
  96.     }
  97.     public function isVisible(): ?bool
  98.     {
  99.         return $this->visible;
  100.     }
  101.     public function setVisible(bool $visible): self
  102.     {
  103.         $this->visible $visible;
  104.         return $this;
  105.     }
  106. }