src/Entity/Charval.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping\Index;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Translatable\Translatable;
  6. use App\Repository\CharvalRepository;
  7. use App\Entity\Translation\PageTranslation;
  8. use App\Entity\Translation\CharvalTranslation;
  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(repositoryClassCharvalRepository::class)]
  14. #[TranslationEntity(class: CharvalTranslation::class)]
  15. #[Index(name"charval_char"columns: ["char"])]
  16. #[Index(name"charval_visible"columns: ["visible"])]
  17. #[Index(name"charval_prior"columns: ["prior"])]
  18. class Charval implements EntityInterface
  19. {
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     private ?int $id null;
  24.     #[ORM\Column(type'integer')]
  25.     private int $char 0;
  26.     #[GedmoTranslatable]
  27.     #[ORM\Column(length255)]
  28.     private ?string $value null;
  29.     #[ORM\Column]
  30.     private ?bool $visible null;
  31.     #[ORM\Column]
  32.     private ?int $prior null;
  33.     #[GedmoLocale]
  34.     private $locale;
  35.     #[ORM\OneToMany(targetEntityCharvalTranslation::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(CharvalTranslation $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 getCharId(): ?int
  62.     {
  63.         return $this->char;
  64.     }
  65.     public function setCharId(int $char_id): self
  66.     {
  67.         $this->char $char_id;
  68.         return $this;
  69.     }
  70.     public function getValue(): ?string
  71.     {
  72.         return $this->value;
  73.     }
  74.     public function setValue(string $value): self
  75.     {
  76.         $this->value $value;
  77.         return $this;
  78.     }
  79.     public function isVisible(): ?bool
  80.     {
  81.         return $this->visible;
  82.     }
  83.     public function setVisible(bool $visible): self
  84.     {
  85.         $this->visible $visible;
  86.         return $this;
  87.     }
  88.     public function getPrior(): ?int
  89.     {
  90.         return $this->prior;
  91.     }
  92.     public function setPrior(int $prior): self
  93.     {
  94.         $this->prior $prior;
  95.         return $this;
  96.     }
  97. }