<?php
namespace Cms\WorkflowsBundle\Entity\Publication;
use App\Model\Async\StringSemaphoreInterface;
use App\Model\Async\StringSemaphoreTrait;
use Cms\TenantBundle\Entity\TenantedEntity;
use Cms\WorkflowsBundle\Entity\WorkflowContent;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* Class ScheduledPublication
* @package Cms\WorkflowsBundle\Entity\Publication
*
* @ORM\Entity(
* repositoryClass = "Cms\WorkflowsBundle\Doctrine\ScheduledPublicationRepository"
* )
*
* @ORM\Table(
* name = "cms__workflows__scheduled_publication"
* )
*/
class ScheduledPublication extends TenantedEntity implements StringSemaphoreInterface
{
const STATUSES__SCHEDULED = 0;
const STATUSES__PUBLISHED = 1;
const STATUSES__CANCELLED = 2;
use StringSemaphoreTrait;
/**
* @var int
*
* @ORM\Column(
* type = "integer",
* nullable = false,
* options = {
* "default" = ScheduledPublication::STATUSES__SCHEDULED
* }
* )
*/
protected $status = self::STATUSES__SCHEDULED;
/**
* @var DateTime
*
* @ORM\Column(
* type = "datetime",
* nullable = false
* )
*/
protected $publishAt;
/**
* @var WorkflowContent
*
* @ORM\ManyToOne(
* targetEntity = "Cms\WorkflowsBundle\Entity\WorkflowContent",
* )
* @ORM\JoinColumn(
* name = "content",
* referencedColumnName = "id",
* onDelete = "CASCADE"
* )
*/
protected $content;
/**
* @return int
*/
public function getStatus()
{
return $this->status;
}
/**
* @param int $value
* @return $this
*/
public function setStatus($value)
{
$this->status = $value;
return $this;
}
/**
* @return DateTime
*/
public function getPublishAt()
{
return $this->publishAt;
}
/**
* @param DateTime $value
* @return $this
*/
public function setPublishAt(DateTime $value)
{
$this->publishAt = $value;
return $this;
}
/**
* @return WorkflowContent
*/
public function getContent()
{
return $this->content;
}
/**
* @param WorkflowContent $value
* @return $this
*/
public function setContent(WorkflowContent $value)
{
$this->content = $value;
return $this;
}
}