src/Entity/ReviewTag.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\ReviewTagRepository")
  9.  */
  10. class ReviewTag
  11. {
  12.     use TimestampableEntity;
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=128)
  21.      * @Assert\NotBlank()
  22.      * @Assert\Length(max=128)
  23.      */
  24.     private $label '';
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      * @Assert\NotBlank()
  28.      * @Assert\Length(max=255)
  29.      */
  30.     private $explanation;
  31.     /**
  32.      * @ORM\Column(type="string", length=128)
  33.      * @Gedmo\Slug(fields={"label"})
  34.      */
  35.     private $slug;
  36.     /**
  37.      * @ORM\Column(type="boolean")
  38.      * @Assert\Type(type="boolean")
  39.      */
  40.     private $enable;
  41.     /**
  42.      * @ORM\Column(type="boolean")
  43.      * @Assert\Type(type="boolean")
  44.      */
  45.     private $official;
  46.     public function __construct($label)
  47.     {
  48.         $this->enable 1;
  49.         $this->official 0;
  50.         $this->label $label;
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getLabel(): ?string
  57.     {
  58.         return $this->label;
  59.     }
  60.     public function setLabel(string $label): self
  61.     {
  62.         $this->label $label;
  63.         return $this;
  64.     }
  65.     public function getExplanation(): ?string
  66.     {
  67.         return $this->explanation;
  68.     }
  69.     public function setExplanation(string $explanation): self
  70.     {
  71.         $this->explanation $explanation;
  72.         return $this;
  73.     }
  74.     public function getEnable(): ?bool
  75.     {
  76.         return $this->enable;
  77.     }
  78.     public function setEnable(bool $enable): self
  79.     {
  80.         $this->enable $enable;
  81.         return $this;
  82.     }
  83.     public function getOfficial(): ?bool
  84.     {
  85.         return $this->official;
  86.     }
  87.     public function setOfficial(bool $official): self
  88.     {
  89.         $this->official $official;
  90.         return $this;
  91.     }
  92.     public function getSlug(): ?string
  93.     {
  94.         return $this->slug;
  95.     }
  96.     public function setSlug(string $slug): self
  97.     {
  98.         $this->slug $slug;
  99.         return $this;
  100.     }
  101.     public function __toString(): string
  102.     {
  103.         return $this->label;
  104.     }
  105. }