<?php
namespace App\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* News
*
* @ORM\Table(name="news")
* @ORM\Entity(repositoryClass="App\Repository\NewsRepository")
* @UniqueEntity(fields={"slug"}, message="Este slug ya está en uso.")
*/
class News
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="headlineNews", type="string", length=255, nullable=true)
* @Assert\NotBlank
*/
private $headline;
/**
* @var string
*
* @ORM\Column(name="header", type="string", length=255)
*/
private $header;
/**
* @var string
*
* @ORM\Column(name="category", type="string", length=255)
* @Assert\NotBlank
*/
private $category;
/**
* @var string
*
* @ORM\Column(name="observations", type="text")
* @Assert\NotBlank
*/
private $observations;
/**
* @ORM\Column(name="company", type="integer")
*/
private $company;
/**
* @var float
*
* @ORM\Column(name="price", type="float")
*/
private $price;
/**
* @var string
*
* @ORM\Column(name="document1", type="string", nullable=true)
*/
private $document1;
/**
* @var string
*
* @ORM\Column(name="document2", type="string", nullable=true)
*/
private $document2;
/**
* @var string
*
* @ORM\Column(name="document3", type="string", nullable=true)
*/
private $document3;
/**
* @var string
*
* @ORM\Column(name="token", type="string", length=255)
*/
private $token;
/**
* @var DateTime
*
* @ORM\Column(name="publicationDate", type="datetime", nullable=true)
*/
private $publicationDate;
/**
* @var DateTime
*
* @ORM\Column(name="createdAt", type="datetime")
*/
private $createdAt;
/**
* @var int
*
* @ORM\Column(name="createdBy", type="integer")
*/
private $createdBy;
/**
* @var DateTime
*
* @ORM\Column(name="updatedAt", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @var int
*
* @ORM\Column(name="updatedBy", type="integer", nullable=true)
*/
private $updatedBy;
/**
* @var string
*
* @ORM\Column(name="language", type="string", nullable=false)
*/
private $language = "es";
/**
* @var boolean
*
* @ORM\Column(name="enabled", type="boolean", nullable=false)
*/
private $enabled = true;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $metaDescription;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $metaTitle;
public function __construct()
{
$this->setCreatedAt(new DateTime());
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set mainTitle
*
* @param string $headline
*
* @return News
*/
public function setHeadline($headline)
{
$this->headline = $headline;
return $this;
}
/**
* Get headline
*
* @return string
*/
public function getHeadline()
{
return $this->headline;
}
/**
* Set header
*
* @param string $header
*
* @return News
*/
public function setHeader($header)
{
$this->header = $header;
return $this;
}
/**
* Get header
*
* @return string
*/
public function getHeader()
{
return $this->header;
}
/**
* Set observations
*
* @param string $observations
*/
public function setObservations($observations)
{
$this->observations = $observations;
}
/**
* Get observations
*
* @return string
*/
public function getObservations()
{
return $this->observations;
}
/**
* Set price
*
* @param float $price
*
* @return News
*/
public function setPrice($price)
{
$this->price = $price;
return $this;
}
/**
* Get price
*
* @return float
*/
public function getPrice()
{
return $this->price;
}
/**
* Set category
*
* @param string $category
*
* @return News
*/
public function setCategory($category)
{
$this->category = $category;
return $this;
}
/**
* Get category
*
* @return string
*/
public function getCategory()
{
return $this->category;
}
/**
* Set $company
*
* @return News
*/
public function setCompany($company)
{
$this->company = $company;
return $this;
}
/**
* Get company
*
*/
public function getCompany()
{
return $this->company;
}
/**
* Set token
*
* @param string $token
*
* @return News
*/
public function setToken($token)
{
$this->token = $token;
return $this;
}
/**
* Get token
*
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* @return DateTime
*/
public function getPublicationDate()
{
return $this->publicationDate;
}
/**
* @param DateTime $publicationDate
*/
public function setPublicationDate($publicationDate)
{
$this->publicationDate = $publicationDate;
}
/**
* Set createdAt
*
* @param DateTime $createdAt
*
* @return News
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set createdBy
*
* @param integer $createdBy
*
* @return News
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return int
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @param DateTime $updatedAt
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
}
/**
* @return int
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* @param int $updatedBy
*/
public function setUpdatedBy($updatedBy)
{
$this->updatedBy = $updatedBy;
}
/**
* @return string
*/
public function getDocument1()
{
return $this->document1;
}
/**
* @param string $document1
*/
public function setDocument1($document1)
{
$this->document1 = $document1;
}
/**
* @return string
*/
public function getDocument2()
{
return $this->document2;
}
/**
* @param string $document2
*/
public function setDocument2($document2)
{
$this->document2 = $document2;
}
/**
* @return string
*/
public function getDocument3()
{
return $this->document3;
}
/**
* @param string $document3
*/
public function setDocument3($document3)
{
$this->document3 = $document3;
}
/**
* @return string
*/
public function getLanguage()
{
return $this->language;
}
/**
* @param string $language
*/
public function setLanguage($language)
{
$this->language = $language;
}
/**
* @return boolean
*/
public function isEnabled()
{
return $this->enabled;
}
/**
* @param boolean $enabled
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): self
{
$this->metaDescription = $metaDescription;
return $this;
}
public function getMetaTitle(): ?string
{
return $this->metaTitle;
}
public function setMetaTitle(?string $metaTitle): self
{
$this->metaTitle = $metaTitle;
return $this;
}
}