<?php
namespace App\Entity;
use App\Repository\BlogRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=BlogRepository::class)
* @UniqueEntity(fields={"slug"}, errorPath="title", message="post.slug_unique")
*/
class Blog
{
use \App\Traits\CommonTrt;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="text")
*/
private $intro;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $illustration;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bannerImg;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="blogs")
*/
private $author;
/**
* @ORM\Column(type="boolean")
*/
private $isActive;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getIntro(): ?string
{
return $this->intro;
}
public function setIntro(string $intro): self
{
$this->intro = $intro;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getIllustration(): ?string
{
return $this->illustration;
}
public function setIllustration(?string $illustration): self
{
$this->illustration = $illustration;
return $this;
}
public function getBannerImg(): ?string
{
return $this->bannerImg;
}
public function setBannerImg(?string $bannerImg): self
{
$this->bannerImg = $bannerImg;
return $this;
}
public function getAuthor(): ?User
{
return $this->author;
}
public function setAuthor(?User $author): self
{
$this->author = $author;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
}