murph-core/src/core/Entity/Site/Page/FileBlock.php

26 lines
515 B
PHP

<?php
namespace App\Core\Entity\Site\Page;
use App\Core\File\FileAttribute;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
#[ORM\Entity]
class FileBlock extends Block
{
public function getValue()
{
return FileAttribute::handleFile(parent::getValue());
}
public function setValue($value): self
{
if ($this->getValue() instanceof File && null === $value) {
return $this;
}
return parent::setValue($value);
}
}