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

65 lines
1.3 KiB
PHP

<?php
namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block;
use App\Core\Entity\Site\Page\Page;
use App\Core\Form\Site\Page\TextBlockType;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\FormBuilderInterface;
/**
* @ORM\Entity
*/
class TitledPage extends Page
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'title',
TextBlockType::class,
[
'label' => 'Titre',
'required' => true,
'attr' => [
],
'constraints' => [
],
]
);
$builder->add(
'subTitle',
TextBlockType::class,
[
'label' => 'Sous-titre',
'required' => true,
'attr' => [
],
'constraints' => [
],
]
);
}
public function setTitle(Block $block)
{
return $this->setBlock($block);
}
public function getTitle()
{
return $this->getBlock('title');
}
public function setSubTitle(Block $block)
{
return $this->setBlock($block);
}
public function getSubTitle()
{
return $this->getBlock('subTitle');
}
}