2021-03-18 21:40:28 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Entity\Site\Page;
|
|
|
|
|
2021-03-18 21:40:45 +01:00
|
|
|
use App\Doctrine\Timestampable;
|
2021-03-18 21:40:28 +01:00
|
|
|
use App\Repository\Site\Page\BlockRepository;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Entity(repositoryClass=BlockRepository::class)
|
|
|
|
* @ORM\HasLifecycleCallbacks
|
|
|
|
*/
|
|
|
|
class Block
|
|
|
|
{
|
|
|
|
use Timestampable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue
|
|
|
|
* @ORM\Column(type="integer")
|
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="string", length=255)
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
/**
|
2021-03-19 15:13:08 +01:00
|
|
|
* @ORM\Column(type="text", nullable=true)
|
2021-03-18 21:40:28 +01:00
|
|
|
*/
|
|
|
|
private $value;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\ManyToOne(targetEntity=Page::class, inversedBy="blocks")
|
2021-03-19 12:10:52 +01:00
|
|
|
* @ORM\JoinColumn(onDelete="CASCADE")
|
2021-03-18 21:40:28 +01:00
|
|
|
*/
|
|
|
|
private $page;
|
|
|
|
|
|
|
|
public function getId(): ?int
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(): ?string
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setName(string $name): self
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getValue(): ?string
|
|
|
|
{
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setValue(string $value): self
|
|
|
|
{
|
|
|
|
$this->value = $value;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPage(): ?Page
|
|
|
|
{
|
|
|
|
return $this->page;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setPage(?Page $page): self
|
|
|
|
{
|
|
|
|
$this->page = $page;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|