src/Aviatur/ContentBundle/Entity/Content.php line 19

Open in your IDE?
  1. <?php
  2. namespace Aviatur\ContentBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * Content.
  8.  *
  9.  * @ORM\Table(name="content", indexes={@ORM\Index(name="IDX_31780935A76ED395", columns={"user_id"})})
  10.  * @ORM\Entity(repositoryClass="Aviatur\ContentBundle\Entity\ContentRepository")
  11.  * @UniqueEntity(
  12.  *    fields={"url"},
  13.  *    message="la url ya esta asignada a otro artículo."
  14.  * )
  15.  */
  16. class Content
  17. {
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer", nullable=false)
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="IDENTITY")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="title", type="string", length=50, nullable=false)
  30.      * @Assert\Length(
  31.      *      min = 2,
  32.      *      minMessage = "La Cantidad de Caracteres en el campo Titulo es Inferior a la Permitida"
  33.      * )
  34.      * @Assert\NotNull()
  35.      */
  36.     private $title;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="keywords", type="string", length=50, nullable=true)
  41.      * * @Assert\Length(
  42.      *      max = 50,
  43.      *      minMessage = "La Cantidad de Caracteres en el campo palabra clave es Superior a la Permitida"
  44.      * )
  45.      * @Assert\NotNull()
  46.      */
  47.     private $keywords;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="url", type="string", length=50, nullable=false)
  52.      * @Assert\NotNull()
  53.      */
  54.     private $url;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="description", type="text", nullable=false)
  59.      * @Assert\NotNull(message="Debe escribir la descripción del artículo")
  60.      * @Assert\NotNull()
  61.      */
  62.     private $description;
  63.     /**
  64.      * @var string
  65.      *
  66.      * @ORM\Column(name="text", type="text", nullable=false)
  67.      */
  68.     private $text;
  69.     /**
  70.      * @var \DateTime
  71.      *
  72.      * @ORM\Column(name="publicationStartDate", type="datetime", nullable=false)
  73.      */
  74.     private $publicationstartdate;
  75.     /**
  76.      * @var \DateTime
  77.      *
  78.      * @ORM\Column(name="publicationEndDate", type="datetime", nullable=false)
  79.      */
  80.     private $publicationenddate;
  81.     /**
  82.      * @var \DateTime
  83.      *
  84.      * @ORM\Column(name="creationDate", type="datetime", nullable=false)
  85.      */
  86.     private $creationdate;
  87.     /**
  88.      * @ORM\Column(name="isActive", type="boolean", nullable=true)
  89.      */
  90.     private bool $isactive false;
  91.     /**
  92.      *
  93.      * @ORM\ManyToOne(targetEntity="Aviatur\CustomerBundle\Entity\Customer", inversedBy="content")
  94.      * @ORM\JoinColumns({
  95.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  96.      * })
  97.      */
  98.     private ?\Aviatur\CustomerBundle\Entity\Customer $user null;
  99.     /**
  100.      *
  101.      * @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="content")
  102.      * @ORM\JoinColumns({
  103.      *   @ORM\JoinColumn(name="agency_id", referencedColumnName="id")
  104.      * })
  105.      */
  106.     private ?\Aviatur\AgencyBundle\Entity\Agency $agency null;
  107.     /**
  108.      * @ORM\OneToMany(targetEntity="Aviatur\ContentBundle\Entity\HistoricalContent", mappedBy="content", cascade={"all"})
  109.      */
  110.     private $historicalContent;
  111.     /**
  112.      * Constructor.
  113.      */
  114.     public function __construct()
  115.     {
  116.         $this->historicalContent = new \Doctrine\Common\Collections\ArrayCollection();
  117.     }
  118.     /**
  119.      * Get id.
  120.      *
  121.      * @return int
  122.      */
  123.     public function getId()
  124.     {
  125.         return $this->id;
  126.     }
  127.     /**
  128.      * Set keywords.
  129.      *
  130.      * @param string $keywords
  131.      *
  132.      * @return Content
  133.      */
  134.     public function setKeywords($keywords)
  135.     {
  136.         $this->keywords $keywords;
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get keywords.
  141.      *
  142.      * @return string
  143.      */
  144.     public function getKeywords()
  145.     {
  146.         return $this->keywords;
  147.     }
  148.     /**
  149.      * Set descriptionkeywords.
  150.      *
  151.      * @param string $descriptionkeywords
  152.      *
  153.      * @return Content
  154.      */
  155.     public function setDescriptionkeywords($descriptionkeywords)
  156.     {
  157.         $this->descriptionkeywords $descriptionkeywords;
  158.         return $this;
  159.     }
  160.     /**
  161.      * Get descriptionkeywords.
  162.      *
  163.      * @return string
  164.      */
  165.     public function getDescriptionkeywords()
  166.     {
  167.         return $this->descriptionkeywords;
  168.     }
  169.     /**
  170.      * Set title.
  171.      *
  172.      * @param string $title
  173.      *
  174.      * @return Content
  175.      */
  176.     public function setTitle($title)
  177.     {
  178.         $this->title $title;
  179.         return $this;
  180.     }
  181.     /**
  182.      * Get title.
  183.      *
  184.      * @return string
  185.      */
  186.     public function getTitle()
  187.     {
  188.         return $this->title;
  189.     }
  190.     /**
  191.      * Set url.
  192.      *
  193.      * @param string $url
  194.      *
  195.      * @return Content
  196.      */
  197.     public function setUrl($url)
  198.     {
  199.         $this->url $url;
  200.         return $this;
  201.     }
  202.     /**
  203.      * Get url.
  204.      *
  205.      * @return string
  206.      */
  207.     public function getUrl()
  208.     {
  209.         return $this->url;
  210.     }
  211.     /**
  212.      * Set description.
  213.      *
  214.      * @param string $description
  215.      *
  216.      * @return Content
  217.      */
  218.     public function setDescription($description)
  219.     {
  220.         $this->description $description;
  221.         return $this;
  222.     }
  223.     /**
  224.      * Get description.
  225.      *
  226.      * @return string
  227.      */
  228.     public function getDescription()
  229.     {
  230.         return $this->description;
  231.     }
  232.     /**
  233.      * Set text.
  234.      *
  235.      * @param string $text
  236.      *
  237.      * @return Content
  238.      */
  239.     public function setText($text)
  240.     {
  241.         $this->text $text;
  242.         return $this;
  243.     }
  244.     /**
  245.      * Get text.
  246.      *
  247.      * @return string
  248.      */
  249.     public function getText()
  250.     {
  251.         return $this->text;
  252.     }
  253.     /**
  254.      * Set publicationstartdate.
  255.      *
  256.      * @param \DateTime $publicationstartdate
  257.      *
  258.      * @return Content
  259.      */
  260.     public function setPublicationstartdate($publicationstartdate)
  261.     {
  262.         $this->publicationstartdate $publicationstartdate;
  263.         return $this;
  264.     }
  265.     /**
  266.      * Get publicationstartdate.
  267.      *
  268.      * @return \DateTime
  269.      */
  270.     public function getPublicationstartdate()
  271.     {
  272.         return $this->publicationstartdate;
  273.     }
  274.     /**
  275.      * Set publicationenddate.
  276.      *
  277.      * @param \DateTime $publicationenddate
  278.      *
  279.      * @return Content
  280.      */
  281.     public function setPublicationenddate($publicationenddate)
  282.     {
  283.         $this->publicationenddate $publicationenddate;
  284.         return $this;
  285.     }
  286.     /**
  287.      * Get publicationenddate.
  288.      *
  289.      * @return \DateTime
  290.      */
  291.     public function getPublicationenddate()
  292.     {
  293.         return $this->publicationenddate;
  294.     }
  295.     /**
  296.      * Set creationdate.
  297.      *
  298.      * @param \DateTime $creationdate
  299.      *
  300.      * @return Content
  301.      */
  302.     public function setCreationdate($creationdate)
  303.     {
  304.         $this->creationdate $creationdate;
  305.         return $this;
  306.     }
  307.     /**
  308.      * Set isactive.
  309.      *
  310.      * @param bool $isactive
  311.      *
  312.      * @return AdminFee
  313.      */
  314.     public function setIsactive($isactive)
  315.     {
  316.         $this->isactive $isactive;
  317.         return $this;
  318.     }
  319.     /**
  320.      * Get isactive.
  321.      *
  322.      * @return bool
  323.      */
  324.     public function getIsactive()
  325.     {
  326.         return $this->isactive;
  327.     }
  328.     /**
  329.      * Get creationdate.
  330.      *
  331.      * @return \DateTime
  332.      */
  333.     public function getCreationdate()
  334.     {
  335.         return $this->creationdate;
  336.     }
  337.     /**
  338.      * Set user.
  339.      *
  340.      * @param \Aviatur\CustomerBundle\Entity\Customer $user
  341.      *
  342.      * @return Content
  343.      */
  344.     public function setUser(\Aviatur\CustomerBundle\Entity\Customer $user null)
  345.     {
  346.         $this->user $user;
  347.         return $this;
  348.     }
  349.     /**
  350.      * Get user.
  351.      *
  352.      * @return \Aviatur\CustomerBundle\Entity\Customer
  353.      */
  354.     public function getUser()
  355.     {
  356.         return $this->user;
  357.     }
  358.     /**
  359.      * Set agency.
  360.      *
  361.      * @param \Aviatur\AgencyBundle\Entity\Agency $agency
  362.      *
  363.      * @return Content
  364.      */
  365.     public function setAgency(\Aviatur\AgencyBundle\Entity\Agency $agency null)
  366.     {
  367.         $this->agency $agency;
  368.         return $this;
  369.     }
  370.     /**
  371.      * Get agency.
  372.      *
  373.      * @return \Aviatur\AgencyBundle\Entity\Agency
  374.      */
  375.     public function getAgency()
  376.     {
  377.         return $this->agency;
  378.     }
  379.     /**
  380.      * Add historicalContent.
  381.      *
  382.      * @return Content
  383.      */
  384.     public function addHistoricalContent(\Aviatur\ContentBundle\Entity\HistoricalContent $historicalContent)
  385.     {
  386.         $this->historicalContent[] = $historicalContent;
  387.         return $this;
  388.     }
  389.     /**
  390.      * Remove historicalContent.
  391.      */
  392.     public function removeHistoricalContent(\Aviatur\ContentBundle\Entity\HistoricalContent $historicalContent)
  393.     {
  394.         $this->historicalContent->removeElement($historicalContent);
  395.     }
  396.     /**
  397.      * Get historicalContent.
  398.      *
  399.      * @return \Doctrine\Common\Collections\Collection
  400.      */
  401.     public function getHistoricalContent()
  402.     {
  403.         return $this->historicalContent;
  404.     }
  405. }