src/Entity/Content.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ContentRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class Content
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $page;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $section;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $title;
  31.     /**
  32.      * @ORM\Column(type="text", nullable=true)
  33.      */
  34.     private $text;
  35.     /**
  36.      * @ORM\Column(type="string", length=30, nullable=true)
  37.      */
  38.     private $buttonLabel;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $buttonLink;
  43.     /**
  44.      * @ORM\Column(type="boolean", nullable=true)
  45.      */
  46.     private $hasImage;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      */
  50.     private $image;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $preTitle;
  55.     /**
  56.      * @ORM\Column(type="string", length=2, nullable=true)
  57.      */
  58.     private $lang;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=BlockList::class, mappedBy="content", cascade={"persist"})
  61.      */
  62.     private $blockLists;
  63.     /**
  64.      * @ORM\Column(type="boolean", nullable=true)
  65.      */
  66.     private $hasBlockList;
  67.     public function __construct()
  68.     {
  69.         $this->hasImage false;
  70.         $this->blockLists = new ArrayCollection();
  71.     }
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getPage(): ?string
  77.     {
  78.         return $this->page;
  79.     }
  80.     public function setPage(string $page): self
  81.     {
  82.         $this->page $page;
  83.         return $this;
  84.     }
  85.     public function getSection(): ?string
  86.     {
  87.         return $this->section;
  88.     }
  89.     public function setSection(string $section): self
  90.     {
  91.         $this->section $section;
  92.         return $this;
  93.     }
  94.     public function getText(): ?string
  95.     {
  96.         return $this->text;
  97.     }
  98.     public function setText(?string $text): self
  99.     {
  100.         $this->text $text;
  101.         return $this;
  102.     }
  103.     public function getButtonLabel(): ?string
  104.     {
  105.         return $this->buttonLabel;
  106.     }
  107.     public function setButtonLabel(?string $buttonLabel): self
  108.     {
  109.         $this->buttonLabel $buttonLabel;
  110.         return $this;
  111.     }
  112.     public function getButtonLink(): ?string
  113.     {
  114.         return $this->buttonLink;
  115.     }
  116.     public function setButtonLink(?string $buttonLink): self
  117.     {
  118.         $this->buttonLink $buttonLink;
  119.         return $this;
  120.     }
  121.     public function getTitle(): ?string
  122.     {
  123.         return $this->title;
  124.     }
  125.     public function setTitle(?string $title): self
  126.     {
  127.         $this->title $title;
  128.         return $this;
  129.     }
  130.     public function getHasImage(): ?bool
  131.     {
  132.         return $this->hasImage;
  133.     }
  134.     public function setHasImage(?bool $hasImage): self
  135.     {
  136.         $this->hasImage $hasImage;
  137.         return $this;
  138.     }
  139.     public function getImage()
  140.     {
  141.         return $this->image;
  142.     }
  143.     public function setImage($image): self
  144.     {
  145.         $this->image $image;
  146.         return $this;
  147.     }
  148.     public function getPreTitle(): ?string
  149.     {
  150.         return $this->preTitle;
  151.     }
  152.     public function setPreTitle(?string $preTitle): self
  153.     {
  154.         $this->preTitle $preTitle;
  155.         return $this;
  156.     }
  157.     public function getLang(): ?string
  158.     {
  159.         return $this->lang;
  160.     }
  161.     public function setLang(?string $lang): self
  162.     {
  163.         $this->lang $lang;
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, BlockList>
  168.      */
  169.     public function getBlockLists(): Collection
  170.     {
  171.         return $this->blockLists;
  172.     }
  173.     public function addBlockList(BlockList $blockList): self
  174.     {
  175.         if (!$this->blockLists->contains($blockList)) {
  176.             $this->blockLists[] = $blockList;
  177.             $blockList->setContent($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeBlockList(BlockList $blockList): self
  182.     {
  183.         if ($this->blockLists->removeElement($blockList)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($blockList->getContent() === $this) {
  186.                 $blockList->setContent(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     public function isHasBlockList(): ?bool
  192.     {
  193.         return $this->hasBlockList;
  194.     }
  195.     public function setHasBlockList(?bool $hasBlockList): self
  196.     {
  197.         $this->hasBlockList $hasBlockList;
  198.         return $this;
  199.     }
  200. }