<?php
namespace MLDev\CatalogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use MLDev\CatalogBundle\Repository\ProductContentRepository;
/**
* ProductContent
*
* @ORM\Table(name="MLDev_Product_Content")
* @ORM\Entity(repositoryClass=ProductContentRepository::class)
* @ORM\HasLifecycleCallbacks()
*
*/
class ProductContent
{
/**
* @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=Product::class, inversedBy="productContents", fetch="EXTRA_LAZY")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
protected $product;
/**
* 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 ProductContent
*/
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 ProductContent
*/
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 ProductContent
*/
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 ProductContent
*/
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 ProductContent
*/
public function setOptions($options)
{
$this->options = $options;
return $this;
}
/**
* Get options
*
* @return array
*/
public function getOptions()
{
return ($this->options ? $this->options : []);
}
public function getProduct()
{
return $this->product;
}
public function setProduct($product): self
{
$this->product = $product;
return $this;
}
}