<?php
namespace App\Entity;
use App\Repository\ContentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ContentRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class Content
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $page;
/**
* @ORM\Column(type="string", length=255)
*/
private $section;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* @ORM\Column(type="string", length=30, nullable=true)
*/
private $buttonLabel;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $buttonLink;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasImage;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $preTitle;
/**
* @ORM\Column(type="string", length=2, nullable=true)
*/
private $lang;
/**
* @ORM\OneToMany(targetEntity=BlockList::class, mappedBy="content", cascade={"persist"})
*/
private $blockLists;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasBlockList;
public function __construct()
{
$this->hasImage = false;
$this->blockLists = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPage(): ?string
{
return $this->page;
}
public function setPage(string $page): self
{
$this->page = $page;
return $this;
}
public function getSection(): ?string
{
return $this->section;
}
public function setSection(string $section): self
{
$this->section = $section;
return $this;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(?string $text): self
{
$this->text = $text;
return $this;
}
public function getButtonLabel(): ?string
{
return $this->buttonLabel;
}
public function setButtonLabel(?string $buttonLabel): self
{
$this->buttonLabel = $buttonLabel;
return $this;
}
public function getButtonLink(): ?string
{
return $this->buttonLink;
}
public function setButtonLink(?string $buttonLink): self
{
$this->buttonLink = $buttonLink;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getHasImage(): ?bool
{
return $this->hasImage;
}
public function setHasImage(?bool $hasImage): self
{
$this->hasImage = $hasImage;
return $this;
}
public function getImage()
{
return $this->image;
}
public function setImage($image): self
{
$this->image = $image;
return $this;
}
public function getPreTitle(): ?string
{
return $this->preTitle;
}
public function setPreTitle(?string $preTitle): self
{
$this->preTitle = $preTitle;
return $this;
}
public function getLang(): ?string
{
return $this->lang;
}
public function setLang(?string $lang): self
{
$this->lang = $lang;
return $this;
}
/**
* @return Collection<int, BlockList>
*/
public function getBlockLists(): Collection
{
return $this->blockLists;
}
public function addBlockList(BlockList $blockList): self
{
if (!$this->blockLists->contains($blockList)) {
$this->blockLists[] = $blockList;
$blockList->setContent($this);
}
return $this;
}
public function removeBlockList(BlockList $blockList): self
{
if ($this->blockLists->removeElement($blockList)) {
// set the owning side to null (unless already changed)
if ($blockList->getContent() === $this) {
$blockList->setContent(null);
}
}
return $this;
}
public function isHasBlockList(): ?bool
{
return $this->hasBlockList;
}
public function setHasBlockList(?bool $hasBlockList): self
{
$this->hasBlockList = $hasBlockList;
return $this;
}
}