<?php
namespace Aviatur\ContentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Content.
*
* @ORM\Table(name="content", indexes={@ORM\Index(name="IDX_31780935A76ED395", columns={"user_id"})})
* @ORM\Entity(repositoryClass="Aviatur\ContentBundle\Entity\ContentRepository")
* @UniqueEntity(
* fields={"url"},
* message="la url ya esta asignada a otro artículo."
* )
*/
class Content
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=50, nullable=false)
* @Assert\Length(
* min = 2,
* minMessage = "La Cantidad de Caracteres en el campo Titulo es Inferior a la Permitida"
* )
* @Assert\NotNull()
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="keywords", type="string", length=50, nullable=true)
* * @Assert\Length(
* max = 50,
* minMessage = "La Cantidad de Caracteres en el campo palabra clave es Superior a la Permitida"
* )
* @Assert\NotNull()
*/
private $keywords;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=50, nullable=false)
* @Assert\NotNull()
*/
private $url;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
* @Assert\NotNull(message="Debe escribir la descripción del artículo")
* @Assert\NotNull()
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="text", type="text", nullable=false)
*/
private $text;
/**
* @var \DateTime
*
* @ORM\Column(name="publicationStartDate", type="datetime", nullable=false)
*/
private $publicationstartdate;
/**
* @var \DateTime
*
* @ORM\Column(name="publicationEndDate", type="datetime", nullable=false)
*/
private $publicationenddate;
/**
* @var \DateTime
*
* @ORM\Column(name="creationDate", type="datetime", nullable=false)
*/
private $creationdate;
/**
* @ORM\Column(name="isActive", type="boolean", nullable=true)
*/
private bool $isactive = false;
/**
*
* @ORM\ManyToOne(targetEntity="Aviatur\CustomerBundle\Entity\Customer", inversedBy="content")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* })
*/
private ?\Aviatur\CustomerBundle\Entity\Customer $user = null;
/**
*
* @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="content")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="agency_id", referencedColumnName="id")
* })
*/
private ?\Aviatur\AgencyBundle\Entity\Agency $agency = null;
/**
* @ORM\OneToMany(targetEntity="Aviatur\ContentBundle\Entity\HistoricalContent", mappedBy="content", cascade={"all"})
*/
private $historicalContent;
/**
* Constructor.
*/
public function __construct()
{
$this->historicalContent = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set keywords.
*
* @param string $keywords
*
* @return Content
*/
public function setKeywords($keywords)
{
$this->keywords = $keywords;
return $this;
}
/**
* Get keywords.
*
* @return string
*/
public function getKeywords()
{
return $this->keywords;
}
/**
* Set descriptionkeywords.
*
* @param string $descriptionkeywords
*
* @return Content
*/
public function setDescriptionkeywords($descriptionkeywords)
{
$this->descriptionkeywords = $descriptionkeywords;
return $this;
}
/**
* Get descriptionkeywords.
*
* @return string
*/
public function getDescriptionkeywords()
{
return $this->descriptionkeywords;
}
/**
* Set title.
*
* @param string $title
*
* @return Content
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set url.
*
* @param string $url
*
* @return Content
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url.
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set description.
*
* @param string $description
*
* @return Content
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set text.
*
* @param string $text
*
* @return Content
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get text.
*
* @return string
*/
public function getText()
{
return $this->text;
}
/**
* Set publicationstartdate.
*
* @param \DateTime $publicationstartdate
*
* @return Content
*/
public function setPublicationstartdate($publicationstartdate)
{
$this->publicationstartdate = $publicationstartdate;
return $this;
}
/**
* Get publicationstartdate.
*
* @return \DateTime
*/
public function getPublicationstartdate()
{
return $this->publicationstartdate;
}
/**
* Set publicationenddate.
*
* @param \DateTime $publicationenddate
*
* @return Content
*/
public function setPublicationenddate($publicationenddate)
{
$this->publicationenddate = $publicationenddate;
return $this;
}
/**
* Get publicationenddate.
*
* @return \DateTime
*/
public function getPublicationenddate()
{
return $this->publicationenddate;
}
/**
* Set creationdate.
*
* @param \DateTime $creationdate
*
* @return Content
*/
public function setCreationdate($creationdate)
{
$this->creationdate = $creationdate;
return $this;
}
/**
* Set isactive.
*
* @param bool $isactive
*
* @return AdminFee
*/
public function setIsactive($isactive)
{
$this->isactive = $isactive;
return $this;
}
/**
* Get isactive.
*
* @return bool
*/
public function getIsactive()
{
return $this->isactive;
}
/**
* Get creationdate.
*
* @return \DateTime
*/
public function getCreationdate()
{
return $this->creationdate;
}
/**
* Set user.
*
* @param \Aviatur\CustomerBundle\Entity\Customer $user
*
* @return Content
*/
public function setUser(\Aviatur\CustomerBundle\Entity\Customer $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user.
*
* @return \Aviatur\CustomerBundle\Entity\Customer
*/
public function getUser()
{
return $this->user;
}
/**
* Set agency.
*
* @param \Aviatur\AgencyBundle\Entity\Agency $agency
*
* @return Content
*/
public function setAgency(\Aviatur\AgencyBundle\Entity\Agency $agency = null)
{
$this->agency = $agency;
return $this;
}
/**
* Get agency.
*
* @return \Aviatur\AgencyBundle\Entity\Agency
*/
public function getAgency()
{
return $this->agency;
}
/**
* Add historicalContent.
*
* @return Content
*/
public function addHistoricalContent(\Aviatur\ContentBundle\Entity\HistoricalContent $historicalContent)
{
$this->historicalContent[] = $historicalContent;
return $this;
}
/**
* Remove historicalContent.
*/
public function removeHistoricalContent(\Aviatur\ContentBundle\Entity\HistoricalContent $historicalContent)
{
$this->historicalContent->removeElement($historicalContent);
}
/**
* Get historicalContent.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getHistoricalContent()
{
return $this->historicalContent;
}
}