src/Entity/Header.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HeaderRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HeaderRepository::class)
  9.  */
  10. class Header {
  11.     use \App\Traits\CommonTrt;
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $summary;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $content;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $thumb;
  34.     /**
  35.      * @ORM\Column(type="json", nullable=true)
  36.      */
  37.     private $images = [];
  38.     /**
  39.      * @ORM\Column(type="string", length=255)
  40.      */
  41.     private $slug;
  42.     /**
  43.      * @ORM\Column(type="boolean")
  44.      */
  45.     private $isActive;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $buttonText;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Lang::class, inversedBy="headers")
  52.      */
  53.     private $lang;
  54.     /**
  55.      * @ORM\ManyToMany(targetEntity=Documents::class, inversedBy="headers")
  56.      */
  57.     private $docs;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $url;
  62.     public function __construct()
  63.     {
  64.         $this->docs = new ArrayCollection();
  65.     }
  66.     public function getId(): ?int {
  67.         return $this->id;
  68.     }
  69.     public function getTitle(): ?string {
  70.         return $this->title;
  71.     }
  72.     public function setTitle(string $title): self {
  73.         $this->title = $title;
  74.         return $this;
  75.     }
  76.     public function getSummary(): ?string {
  77.         return $this->summary;
  78.     }
  79.     public function setSummary(?string $summary): self {
  80.         $this->summary = $summary;
  81.         return $this;
  82.     }
  83.     public function getContent(): ?string {
  84.         return $this->content;
  85.     }
  86.     public function setContent(?string $content): self {
  87.         $this->content = $content;
  88.         return $this;
  89.     }
  90.     public function getThumb(): ?string {
  91.         return $this->thumb;
  92.     }
  93.     public function setThumb(?string $thumb): self {
  94.         $this->thumb = $thumb;
  95.         return $this;
  96.     }
  97.     public function getImages(): ?array {
  98.         return $this->images;
  99.     }
  100.     public function setImages(?array $images): self {
  101.         $this->images = $images;
  102.         return $this;
  103.     }
  104.     public function getSlug(): ?string {
  105.         return $this->slug;
  106.     }
  107.     public function setSlug(string $slug): self {
  108.         $this->slug = $slug;
  109.         return $this;
  110.     }
  111.     public function isIsActive(): ?bool {
  112.         return $this->isActive;
  113.     }
  114.     public function setIsActive(bool $isActive): self {
  115.         $this->isActive = $isActive;
  116.         return $this;
  117.     }
  118.     public function getButtonText(): ?string
  119.     {
  120.         return $this->buttonText;
  121.     }
  122.     public function setButtonText(?string $buttonText): self
  123.     {
  124.         $this->buttonText = $buttonText;
  125.         return $this;
  126.     }
  127.     public function getLang(): ?Lang
  128.     {
  129.         return $this->lang;
  130.     }
  131.     public function setLang(?Lang $lang): self
  132.     {
  133.         $this->lang = $lang;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection<int, Documents>
  138.      */
  139.     public function getDocs(): Collection
  140.     {
  141.         return $this->docs;
  142.     }
  143.     public function addDoc(Documents $doc): self
  144.     {
  145.         if (!$this->docs->contains($doc)) {
  146.             $this->docs[] = $doc;
  147.         }
  148.         return $this;
  149.     }
  150.     public function removeDoc(Documents $doc): self
  151.     {
  152.         $this->docs->removeElement($doc);
  153.         return $this;
  154.     }
  155.     public function getUrl(): ?string
  156.     {
  157.         return $this->url;
  158.     }
  159.     public function setUrl(?string $url): self
  160.     {
  161.         $this->url = $url;
  162.         return $this;
  163.     }
  164. }