2021-03-24 12:27:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Core\Entity\Site\Page;
|
|
|
|
|
|
|
|
use App\Core\Doctrine\Timestampable;
|
|
|
|
use App\Core\Repository\Site\Page\BlockRepository;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Entity(repositoryClass=BlockRepository::class)
|
|
|
|
* @ORM\DiscriminatorColumn(name="class_key", type="string")
|
|
|
|
* @ORM\InheritanceType("SINGLE_TABLE")
|
|
|
|
* @ORM\HasLifecycleCallbacks
|
|
|
|
*/
|
|
|
|
class Block
|
|
|
|
{
|
|
|
|
use Timestampable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue
|
|
|
|
* @ORM\Column(type="integer")
|
|
|
|
*/
|
2021-05-18 10:09:02 +02:00
|
|
|
protected $id;
|
2021-03-24 12:27:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="string", length=255)
|
|
|
|
*/
|
2021-05-18 10:09:02 +02:00
|
|
|
protected $name;
|
2021-03-24 12:27:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="text", nullable=true)
|
|
|
|
*/
|
2021-05-18 10:09:02 +02:00
|
|
|
protected $value;
|
2021-03-24 12:27:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\ManyToOne(targetEntity=Page::class, inversedBy="blocks")
|
|
|
|
* @ORM\JoinColumn(onDelete="CASCADE")
|
|
|
|
*/
|
2021-05-18 10:09:02 +02:00
|
|
|
protected $page;
|
2021-03-24 12:27:07 +01:00
|
|
|
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setValue($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;
|
|
|
|
}
|
|
|
|
}
|