Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (52 sloc) 1.17 KB
<?php
/**
* This file is part of the Clastic package.
*
* (c) Dries De Peuter <dries@nousefreak.be>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Clastic\BackofficeBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* MultiSelectType.
*
* @author Dries De Peuter <dries@nousefreak.be>
*/
class MultiSelectType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(array(
'multiple' => true,
'choices_as_values' => true,
));
}
/**
* {@inheritdoc}
*/
public function getParent()
{
return ChoiceType::class;
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'multi_select';
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->getBlockPrefix();
}
}