src/Entity/FreePageBlock.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FreePageBlockRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FreePageBlockRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  * @Vich\Uploadable()
  11.  */
  12. class FreePageBlock
  13. {
  14.     const CAROUSEL_TYPE 3;
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $title;
  25.     /**
  26.      * @ORM\Column(type="text", nullable=true)
  27.      */
  28.     private $text;
  29.     /**
  30.      * @ORM\OneToOne(targetEntity=Media::class, cascade={"persist", "remove"})
  31.      */
  32.     private $video;
  33.     /**
  34.      * @ORM\Column(type="datetime")
  35.      */
  36.     private $updatedAt;
  37.     /**
  38.      * @ORM\OneToOne(targetEntity=PageBlockCarousel::class, cascade={"persist", "remove"}, orphanRemoval=true)
  39.      */
  40.     private $carousel;
  41.     /**
  42.      * @ORM\Column(type="integer")
  43.      */
  44.     private $position;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=FreePage::class, inversedBy="pageBlocks")
  47.      * @ORM\JoinColumn(nullable=false)
  48.      */
  49.     private $freePage;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=false)
  52.      */
  53.     private $backgroundColor;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=false, options={"default" : "#ffffff"})
  56.      */
  57.     private $titleColor;
  58.     public function __construct()
  59.     {
  60.         $this->carousel = new PageBlockCarousel();
  61.         $this->updatedAt = new \Datetime();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getText(): ?string
  68.     {
  69.         return $this->text;
  70.     }
  71.     public function setText(?string $text): self
  72.     {
  73.         $this->text $text;
  74.         return $this;
  75.     }
  76.     public function getTitle(): ?string
  77.     {
  78.         return $this->title;
  79.     }
  80.     public function setTitle(?string $title): self
  81.     {
  82.         $this->title $title;
  83.         return $this;
  84.     }
  85.     public function getVideo(): ?Media
  86.     {
  87.         return $this->video;
  88.     }
  89.     public function setVideo(?Media $video): self
  90.     {
  91.         $this->video $video;
  92.         return $this;
  93.     }
  94.     public function getUpdatedAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->updatedAt;
  97.     }
  98.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  99.     {
  100.         $this->updatedAt $updatedAt;
  101.         return $this;
  102.     }
  103.     public function getCarousel(): ?PageBlockCarousel
  104.     {
  105.         return $this->carousel;
  106.     }
  107.     public function setCarousel(?PageBlockCarousel $carousel): self
  108.     {
  109.         $this->carousel $carousel;
  110.         return $this;
  111.     }
  112.     public function getPosition(): ?int
  113.     {
  114.         return $this->position;
  115.     }
  116.     public function setPosition(int $position): self
  117.     {
  118.         $this->position $position;
  119.         return $this;
  120.     }
  121.     public function getFreePage(): ?FreePage
  122.     {
  123.         return $this->freePage;
  124.     }
  125.     public function setFreePage(?FreePage $freePage): self
  126.     {
  127.         $this->freePage $freePage;
  128.         return $this;
  129.     }
  130.     public function getBackgroundColor(): string
  131.     {
  132.         return $this->backgroundColor;
  133.     }
  134.     public function setBackgroundColor(string $backgroundColor): self
  135.     {
  136.         $this->backgroundColor $backgroundColor;
  137.         return $this;
  138.     }
  139.     public function getTitleColor(): string
  140.     {
  141.         return $this->titleColor;
  142.     }
  143.     public function setTitleColor(string $titleColor): self
  144.     {
  145.         $this->titleColor $titleColor;
  146.         return $this;
  147.     }
  148. }