<?php
namespace App\Entity\Gos\Uniqskills\Landing;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Gos\Uniqskills\Course;
/**
* Landing
*
* @ORM\Table(name="landing")
* @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\Landing\LandingRepository")
* @ORM\HasLifecycleCallbacks
*/
class Landing
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var bool
*
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $customScripts;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $template = 'old';
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="newLandingPage")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $course;
/**
* @ORM\OneToMany(targetEntity="LandingModule", mappedBy="landing", orphanRemoval=true, cascade={"persist", "remove"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private $landingModules;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __construct()
{
$this->landingModules = new \Doctrine\Common\Collections\ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCustomScripts(): ?string
{
return $this->customScripts;
}
public function setCustomScripts(?string $customScripts): self
{
$this->customScripts = $customScripts;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCourse(): ?Course
{
return $this->course;
}
public function setCourse(?Course $course): self
{
$this->course = $course;
return $this;
}
/**
* @return Collection|LandingModule[]
*/
public function getLandingModules(): Collection
{
return $this->landingModules;
}
public function addLandingModule(LandingModule $landingModule): self
{
if (!$this->landingModules->contains($landingModule)) {
$this->landingModules[] = $landingModule;
$landingModule->setLanding($this);
}
return $this;
}
public function removeLandingModule(LandingModule $landingModule): self
{
if ($this->landingModules->contains($landingModule)) {
$this->landingModules->removeElement($landingModule);
// set the owning side to null (unless already changed)
if ($landingModule->getLanding() === $this) {
$landingModule->setLanding(null);
}
}
return $this;
}
public function setTemplate(string $template): self
{
$this->template = $template;
return $this;
}
public function getTemplate():? string
{
return $this->template;
}
/* ****************************** GETTERS & SETTERS ****************************** */
}