This repository was archived by the owner on Mar 17, 2023. It is now read-only.
forked from elcweb/KeyValueStoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKeyValueType.php
More file actions
35 lines (30 loc) · 978 Bytes
/
KeyValueType.php
File metadata and controls
35 lines (30 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Elcweb\KeyValueStoreBundle\Form;
use PHPReaction\CommonBundle\Form\Type\Select2Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class KeyValueType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('key')
->add('value')
->add('description')
->add('user', Select2Type::class, [
'route' => 'user_simple_list',
'class' => 'PHPReactionUserBundle:User'
]);
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Elcweb\KeyValueStoreBundle\Entity\KeyValue'
));
}
public function getName()
{
return 'elcweb_bundle_keyvaluestorebundle_keyvaluetype';
}
}