tinternet.net/src/Entity/Page/SimplePage.php

94 lines
2 KiB
PHP

<?php
namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block;
use App\Core\Entity\Site\Page\Page;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\FormBuilderInterface;
use App\Core\Form\Site\Page\FileBlockType;
use App\Core\Form\Site\Page\TextBlockType;
use App\Core\Form\Site\Page\TextareaBlockType;
/**
* @ORM\Entity
*/
class SimplePage extends Page
{
public function buildForm(FormBuilderInterface $builder)
{
$builder->add(
'title',
TextBlockType::class,
[
'label' => 'Titre',
'required' => true,
'attr' => [
],
'constraints' => [
],
]
);
$builder->add(
'content',
TextareaBlockType::class,
[
'label' => 'Content',
'options' => [
'attr' => [
'data-tinymce' => '',
'rows' => '18',
],
'constraints' => [
],
],
]
);
// $builder->add(
// 'file',
// FileBlockType::class,
// [
// 'label' => 'Fichier',
// 'options' => [
// 'attr' => [
// ],
// 'constraints' => [
// ],
// ],
// ]
// );
}
public function setTitle(Block $block)
{
return $this->setBlock($block);
}
public function getTitle()
{
return $this->getBlock('title');
}
public function setContent(Block $block)
{
return $this->setBlock($block);
}
public function getContent()
{
return $this->getBlock('content');
}
public function setFile(Block $block)
{
return $this->setBlock($block);
}
public function getFile()
{
return $this->getBlock('file');
}
}