<?php
namespace App\Entity;
use App\Entity\Item\ItemCategory;
use App\Entity\Page\Page;
use App\Entity\Traits\IdTrait;
use App\Repository\BlogRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BlogRepository::class)
*/
class Blog
{
use IdTrait;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $contentEn;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $url;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $fullName;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $passion;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Item\ItemCategory", inversedBy="blog", cascade={"persist","remove"}, fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $industry;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity=File::class, mappedBy="blog",cascade={"persist","remove"})
* @ORM\JoinColumn(nullable=true)
*/
private $Photo;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $translation = [];
/**
* @ORM\Column(type="string", nullable=true)
*/
private $category;
/**
* @ORM\OneToOne(targetEntity=Page::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=true)
*/
private $page;
public function __construct()
{
$this->Photo = new ArrayCollection();
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getContentEn(): ?string
{
return $this->contentEn;
}
public function setContentEn(?string $contentEn): self
{
$this->contentEn = $contentEn;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getFullName(): ?string
{
return $this->fullName;
}
public function setFullName(?string $fullName): self
{
$this->fullName = $fullName;
return $this;
}
public function getPassion(): ?string
{
return $this->passion;
}
public function setPassion(?string $passion): self
{
$this->passion = $passion;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getIndustry(): ?ItemCategory
{
return $this->industry;
}
public function setIndustry(?ItemCategory $industry):self
{
$this->industry = $industry;
return $this;
}
/**
* @return Collection|File[]
*/
public function getPhoto(): Collection
{
return $this->Photo;
}
public function addPhoto(File $photo): self
{
if (!$this->Photo->contains($photo)) {
$this->Photo[] = $photo;
$photo->setBlog($this);
}
return $this;
}
public function removePhoto(File $photo): self
{
if ($this->Photo->removeElement($photo)) {
// set the owning side to null (unless already changed)
if ($photo->getBlog() === $this) {
$photo->setBlog(null);
}
}
return $this;
}
public function getTranslation(): ?array
{
return $this->translation;
}
public function setTranslation(?array $translation): self
{
$this->translation = $translation;
return $this;
}
public function getCategory(): ?string
{
return $this->category;
}
public function setCategory(?string $category): self
{
$this->category = $category;
return $this;
}
public function setPage(?Page $page):self
{
$this->page = $page;
return $this;
}
public function getPage():?Page
{
return $this->page;
}
}