<?php
namespace MLDev\BaseBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* PageContent
*
* @ORM\Table(name="MLDev_Page_Content")
* @ORM\Entity(repositoryClass="MLDev\BaseBundle\Repository\PageContentRepository")
* @ORM\HasLifecycleCallbacks()
*
*/
class PageContent
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="priority", type="integer", length=255)
*/
private $priority;
/**
* @var bool
*
* @ORM\Column(name="is_active", type="boolean", nullable=true)
*/
private $isActive = true;
/**
* @var string
*
* @ORM\Column(name="widget", type="string", length=255)
*/
private $widget;
/**
* @var array
*
* @ORM\Column(name="options", type="json", nullable=true)
*/
private $options = [];
/**
* @ORM\ManyToOne(targetEntity=Page::class, inversedBy="pageContents", fetch="EXTRA_LAZY")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
protected $page;
/**
* Clone method
*/
public function __clone()
{
if($this->id) {
$this->id = null;
}
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title
*
* @param string $title
*
* @return PageContent
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set priority
*
* @param string $priority
*
* @return PageContent
*/
public function setPriority($priority)
{
$this->priority = $priority;
return $this;
}
/**
* Get priority
*
* @return string
*/
public function getPriority()
{
return $this->priority;
}
/**
* Set isActive
*
* @param boolean $isActive
*
* @return PageContent
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return bool
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set widget
*
* @param string $widget
*
* @return PageContent
*/
public function setWidget($widget)
{
$this->widget = $widget;
return $this;
}
/**
* Get widget
*
* @return string
*/
public function getWidget()
{
return $this->widget;
}
/**
* Set options
*
* @param array $options
*
* @return PageContent
*/
public function setOptions($options)
{
$this->options = $options;
return $this;
}
/**
* Get options
*
* @return array
*/
public function getOptions()
{
return ($this->options ? $this->options : []);
}
/**
* @return mixed
*/
public function getPage()
{
return $this->page;
}
/**
* @param mixed $page
*/
public function setPage($page)
{
$this->page = $page;
}
}