src/Entity/Block.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\BlockRepository;
  5. use Gedmo\Translatable\Translatable;
  6. use Doctrine\ORM\Mapping\UniqueConstraint;
  7. use App\Entity\Translation\PageTranslation;
  8. use App\Entity\Translation\BlockTranslation;
  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(repositoryClassBlockRepository::class)]
  14. #[UniqueConstraint(name"intname"columns: ["intname"])]
  15. #[TranslationEntity(class: BlockTranslation::class)]
  16. class Block 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 $intname;
  24.     #[ORM\Column(type'string'length255)]
  25.     private $name '';
  26.     #[GedmoTranslatable]
  27.     #[ORM\Column(type'text')]
  28.     private $value '';
  29.     #[GedmoLocale]
  30.     private $locale;
  31.     #[ORM\OneToMany(targetEntityBlockTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  32.     private $translations;
  33.     public function __construct()
  34.     {
  35.         $this->translations = new ArrayCollection();
  36.     }
  37.     public function setLocale($locale)
  38.     {
  39.         $this->locale $locale;
  40.     }
  41.     public function getTranslations()
  42.     {
  43.         return $this->translations;
  44.     }
  45.     public function addTranslation(BlockTranslation $t)
  46.     {
  47.         if (!$this->translations->contains($t)) {
  48.             $this->translations[] = $t;
  49.             $t->setObject($this);
  50.         }
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getIntname(): ?string
  57.     {
  58.         return $this->intname;
  59.     }
  60.     public function setIntname(string $intname): self
  61.     {
  62.         $this->intname $intname;
  63.         return $this;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function getValue(): ?string
  75.     {
  76.         return $this->value;
  77.     }
  78.     public function setValue(string $value): self
  79.     {
  80.         $this->value $value;
  81.         return $this;
  82.     }
  83. }