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

94 lines
2 KiB
PHP
Raw Normal View History

2021-03-18 21:40:28 +01:00
<?php
2021-03-20 13:41:15 +01:00
namespace App\Entity\Page;
2021-03-18 21:40:28 +01:00
2021-03-20 13:41:15 +01:00
use App\Core\Entity\Site\Page\Block;
use App\Core\Entity\Site\Page\Page;
2021-03-18 21:40:28 +01:00
use Doctrine\ORM\Mapping as ORM;
2021-03-18 21:40:45 +01:00
use Symfony\Component\Form\FormBuilderInterface;
2021-03-22 12:42:48 +01:00
use App\Core\Form\Site\Page\FileBlockType;
use App\Core\Form\Site\Page\TextBlockType;
use App\Core\Form\Site\Page\TextareaBlockType;
2021-03-18 21:40:28 +01:00
/**
* @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' => [
],
2021-03-18 21:40:45 +01:00
],
2021-03-18 21:40:28 +01:00
]
);
2021-03-22 12:42:48 +01:00
// $builder->add(
// 'file',
// FileBlockType::class,
// [
// 'label' => 'Fichier',
// 'options' => [
// 'attr' => [
// ],
// 'constraints' => [
// ],
// ],
// ]
// );
2021-03-18 21:40:28 +01:00
}
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');
}
2021-03-22 12:42:48 +01:00
public function setFile(Block $block)
{
return $this->setBlock($block);
}
public function getFile()
{
return $this->getBlock('file');
}
2021-03-18 21:40:28 +01:00
}