src/Entity/Labels.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\LabelsRepository;
  5. use Gedmo\Translatable\Translatable;
  6. use Doctrine\ORM\Mapping\UniqueConstraint;
  7. use App\Entity\Translation\PageTranslation;
  8. use App\Entity\Translation\LabelsTranslation;
  9. use Gedmo\Mapping\Annotation\TranslationEntity;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  12. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  13. #[ORM\Entity(repositoryClassLabelsRepository::class)]
  14. #[UniqueConstraint(name"intname"columns: ["intname"])]
  15. #[TranslationEntity(class: LabelsTranslation::class)]
  16. class Labels implements EntityInterface
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column(type'integer')]
  21.     private $id;
  22.     #[ORM\Column(type'string'length255)]
  23.     private $type '';
  24.     #[ORM\Column(type'string'length255)]
  25.     private $intname;
  26.     #[GedmoTranslatable]
  27.     #[ORM\Column(type'string'length255)]
  28.     private $name '';
  29.     #[GedmoTranslatable]
  30.     #[ORM\Column(type'text')]
  31.     private $value '';
  32.     #[GedmoLocale]
  33.     private $locale;
  34.     #[ORM\OneToMany(targetEntityLabelsTranslation::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(LabelsTranslation $t)
  49.     {
  50.         if (!$this->translations->contains($t)) {
  51.             $this->translations[] = $t;
  52.             $t->setObject($this);
  53.         }
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getType(): ?string
  60.     {
  61.         return $this->type;
  62.     }
  63.     public function setType(string $type): self
  64.     {
  65.         $this->type $type;
  66.         return $this;
  67.     }
  68.     public function getIntname(): ?string
  69.     {
  70.         return $this->intname;
  71.     }
  72.     public function setIntname(string $intname): self
  73.     {
  74.         $this->intname $intname;
  75.         return $this;
  76.     }
  77.     public function getName(): ?string
  78.     {
  79.         return $this->name;
  80.     }
  81.     public function setName(string $name): self
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86.     public function getValue(): ?string
  87.     {
  88.         return $this->value;
  89.     }
  90.     public function setValue(string $value): self
  91.     {
  92.         $this->value $value;
  93.         return $this;
  94.     }
  95. }