57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity\Page;
|
|
|
|
use App\Core\Entity\Site\Page\Block;
|
|
use App\Core\Entity\Site\Page\FileBlock;
|
|
use App\Core\Form\Site\Page\TextareaBlockType;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
*/
|
|
class SimplePage extends TitledPage
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder)
|
|
{
|
|
parent::buildForm($builder);
|
|
|
|
$builder->add(
|
|
'content',
|
|
TextareaBlockType::class,
|
|
[
|
|
'label' => 'Contenu',
|
|
'options' => [
|
|
'attr' => [
|
|
'data-simplemde' => '',
|
|
'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);
|
|
}
|
|
}
|