54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
|
<?php
|
|||
|
|
|||
|
namespace Trinity\Bundle\ContentManagerBundle\Form\Type;
|
|||
|
|
|||
|
use Symfony\Component\Form\FormBuilderInterface;
|
|||
|
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
|||
|
|
|||
|
class PageFilterType extends PageType
|
|||
|
{
|
|||
|
protected $options = array(
|
|||
|
'data_class' => 'Trinity\Bundle\ContentManagerBundle\Model\Page',
|
|||
|
'name' => 'page',
|
|||
|
'csrf_protection' => false,
|
|||
|
);
|
|||
|
|
|||
|
/**
|
|||
|
* {@inheritdoc}
|
|||
|
*/
|
|||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|||
|
{
|
|||
|
$builder->add(
|
|||
|
'name',
|
|||
|
'text',
|
|||
|
array(
|
|||
|
'required' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
$builder->add(
|
|||
|
'isOrphan',
|
|||
|
'filter_boolean',
|
|||
|
array(
|
|||
|
'mapped' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* {@inheritdoc}
|
|||
|
*/
|
|||
|
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
|||
|
{
|
|||
|
$resolver->setDefaults($this->options);
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* {@inheritdoc}
|
|||
|
*/
|
|||
|
public function getName()
|
|||
|
{
|
|||
|
return 'page';
|
|||
|
}
|
|||
|
}
|