src/Entity/Template.php line 17

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