<?phpnamespace App\Entity\Blog;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\UploadedFile;/** * @ORM\Entity * @ORM\Table(name="blog_post") * @ORM\Entity(repositoryClass="App\Repository\PostRepository") */class Post{ /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string") */ private $title; /** * @ORM\Column(type="text") */ private $description; /** * @ORM\Column(type="text", nullable=true) */ private $metaTitle; /** * @ORM\Column(type="text", nullable=true) */ private $metaDescription; /** * @ORM\Column(type="datetime") */ private $publishedAt; private $uploadedFile; /** * @ORM\Column(type="string") */ private $image; /** * @ORM\ManyToOne(targetEntity="App\Entity\Blog\Category", inversedBy="posts") */ private $category; public function getSlug() { return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $this->title), '-')); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set title * * @param string $title * * @return Post */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set description * * @param string $description * * @return Post */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get description * * @return string */ public function getDescription() { return $this->description==null ? '' : $this->description; } /** * Set metaTitle * * @param string $metaTitle * * @return Post */ public function setMetaTitle($metaTitle) { $this->metaTitle = $metaTitle; return $this; } /** * Get metaTitle * * @return string */ public function getMetaTitle() { return $this->metaTitle; } /** * Set metaDescription * * @param string $metaDescription * * @return Post */ public function setMetaDescription($metaDescription) { $this->metaDescription = $metaDescription; return $this; } /** * Get metaDescription * * @return string */ public function getMetaDescription() { return $this->metaDescription; } /** * Set publishedAt * * @param \DateTime $publishedAt * * @return Post */ public function setPublishedAt($publishedAt) { $this->publishedAt = $publishedAt; return $this; } /** * Get publishedAt * * @return \DateTime */ public function getPublishedAt() { return $this->publishedAt; } /** * Set category * * @param \App\Entity\Blog\Category $category * * @return Post */ public function setCategory(\App\Entity\Blog\Category $category = null) { $this->category = $category; return $this; } /** * Get category * * @return \App\Entity\Blog\Category */ public function getCategory() { return $this->category; } /** * Set image * * @param string $image * * @return Post */ public function setImage($image) { $this->image = $image; return $this; } /** * Get image * * @return string */ public function getImage() { return $this->image; } /** * Set uploadedFile * * @param string $uploadedFile * * @return Medium */ public function setUploadedFile($uploadedFile) { $this->uploadedFile = $uploadedFile; return $this; } /** * Get uploadedFile * * @return UploadedFile */ public function getUploadedFile() { return $this->uploadedFile; }public function __construct() { $this->description = ""; }}