73 lines
1.4 KiB
PHP
73 lines
1.4 KiB
PHP
<?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')]
|
|
protected $id;
|
|
|
|
#[ORM\Column(type: 'string', length: 255)]
|
|
protected $name;
|
|
|
|
#[ORM\Column(type: 'text', nullable: true)]
|
|
protected $value;
|
|
|
|
#[ORM\ManyToOne(targetEntity: Page::class, inversedBy: 'blocks')]
|
|
#[ORM\JoinColumn(onDelete: 'CASCADE')]
|
|
protected $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()
|
|
{
|
|
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;
|
|
}
|
|
}
|