src/Entity/Gos/Uniqskills/Landing/Landing.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills\Landing;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Gos\Uniqskills\Course;
  7. /**
  8.  * Landing
  9.  *
  10.  * @ORM\Table(name="landing")
  11.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\Landing\LandingRepository")
  12.  * @ORM\HasLifecycleCallbacks
  13.  */
  14. class Landing
  15. {
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var bool
  26.      *
  27.      * @ORM\Column(name="is_active", type="boolean")
  28.      */
  29.     private $isActive;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $customScripts;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private $template 'old';
  38.     /**
  39.      * @var \DateTime
  40.      *
  41.      * @ORM\Column(name="created_at", type="datetime")
  42.      */
  43.     private $createdAt;
  44.     /**
  45.      * @var \DateTime
  46.      *
  47.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  48.      */
  49.     private $updatedAt;
  50.     /**
  51.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="newLandingPage")
  52.      * @ORM\JoinColumn(onDelete="CASCADE")
  53.      */
  54.     private $course;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity="LandingModule", mappedBy="landing", orphanRemoval=true, cascade={"persist", "remove"})
  57.      * @ORM\OrderBy({"position" = "ASC"})
  58.      */
  59.     private $landingModules;
  60.     /** @ORM\PrePersist() */
  61.     public function prePersist()
  62.     {
  63.         $this->createdAt = new \DateTime();
  64.     }
  65.     /** @ORM\PreUpdate() */
  66.     public function preUpdate()
  67.     {
  68.         $this->updatedAt = new \DateTime();
  69.     }
  70.     public function __construct()
  71.     {
  72.         $this->landingModules = new \Doctrine\Common\Collections\ArrayCollection();
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getIsActive(): ?bool
  79.     {
  80.         return $this->isActive;
  81.     }
  82.     public function setIsActive(bool $isActive): self
  83.     {
  84.         $this->isActive $isActive;
  85.         return $this;
  86.     }
  87.     public function getCustomScripts(): ?string
  88.     {
  89.         return $this->customScripts;
  90.     }
  91.     public function setCustomScripts(?string $customScripts): self
  92.     {
  93.         $this->customScripts $customScripts;
  94.         return $this;
  95.     }
  96.     public function getCreatedAt(): ?\DateTimeInterface
  97.     {
  98.         return $this->createdAt;
  99.     }
  100.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  101.     {
  102.         $this->createdAt $createdAt;
  103.         return $this;
  104.     }
  105.     public function getUpdatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->updatedAt;
  108.     }
  109.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  110.     {
  111.         $this->updatedAt $updatedAt;
  112.         return $this;
  113.     }
  114.     public function getCourse(): ?Course
  115.     {
  116.         return $this->course;
  117.     }
  118.     public function setCourse(?Course $course): self
  119.     {
  120.         $this->course $course;
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection|LandingModule[]
  125.      */
  126.     public function getLandingModules(): Collection
  127.     {
  128.         return $this->landingModules;
  129.     }
  130.     public function addLandingModule(LandingModule $landingModule): self
  131.     {
  132.         if (!$this->landingModules->contains($landingModule)) {
  133.             $this->landingModules[] = $landingModule;
  134.             $landingModule->setLanding($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeLandingModule(LandingModule $landingModule): self
  139.     {
  140.         if ($this->landingModules->contains($landingModule)) {
  141.             $this->landingModules->removeElement($landingModule);
  142.             // set the owning side to null (unless already changed)
  143.             if ($landingModule->getLanding() === $this) {
  144.                 $landingModule->setLanding(null);
  145.             }
  146.         }
  147.         return $this;
  148.     }
  149.     public function setTemplate(string $template): self
  150.     {
  151.         $this->template $template;
  152.         return $this;
  153.     }
  154.     public function getTemplate():? string
  155.     {
  156.         return $this->template;
  157.     }
  158.     /* ****************************** GETTERS & SETTERS ******************************  */
  159. }