deblan.io-murph/src/Entity/Page/SimplePage.php

54 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block;
use App\Core\Entity\Site\Page\FileBlock;
2022-03-25 12:18:53 +01:00
use App\Form\Type\SimpleMdTextareaBlockType;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\FormBuilderInterface;
2022-11-19 20:42:30 +01:00
#[ORM\Entity]
class SimplePage extends TitledPage
{
2021-09-09 13:57:54 +02:00
public function buildForm(FormBuilderInterface $builder, array $options)
{
2021-10-11 14:08:57 +02:00
parent::buildForm($builder, $options);
$builder->add(
'content',
2022-03-25 12:18:53 +01:00
SimpleMdTextareaBlockType::class,
[
'label' => 'Contenu',
'options' => [
'attr' => [
'rows' => '50',
],
'constraints' => [
],
],
]
);
}
public function setContent(Block $block)
{
return $this->setBlock($block);
}
public function getContent()
{
return $this->getBlock('content');
}
public function setImage(Block $block)
{
return $this->setBlock($block);
}
public function getImage()
{
return $this->getBlock('image', FileBlock::class);
}
}