<?php
namespace Cms\WorkflowsBundle\Entity\Content;
use Cms\ModuleBundle\Entity\Draft;
use Cms\Modules\GalleryBundle\Entity\Gallery\GalleryDraft;
use Cms\WorkflowsBundle\Entity\WorkflowContent;
use Doctrine\ORM\Mapping as ORM;
/**
* Class GalleryContent
* @package Cms\WorkflowsBundle\Entity\Content
*
* @ORM\Entity(
* repositoryClass = "Cms\WorkflowsBundle\Doctrine\Content\GalleryContentRepository"
* )
*/
class GalleryContent extends WorkflowContent
{
protected $contentType = WorkflowContent::CONTENT_TYPES__GALLERY;
/**
* @var GalleryDraft
*
* @ORM\OneToOne(
* targetEntity = "Cms\Modules\GalleryBundle\Entity\Gallery\GalleryDraft"
* )
* @ORM\JoinColumn(
* name = "draftGallery",
* referencedColumnName = "id",
* onDelete = "CASCADE"
* )
*/
protected $draft;
/**
* {@inheritdoc}
* @param GalleryDraft $value
*/
public function setDraft(Draft $value)
{
if ( ! $value instanceof GalleryDraft) {
throw new \Exception();
}
$this->draft = $value;
return $this;
}
/**
* {@inheritdoc}
* @return GalleryDraft
*/
public function getDraft()
{
return $this->draft;
}
}