1 | <?php |
||
14 | class UserSearchType extends AbstractType |
||
15 | { |
||
16 | /** |
||
17 | * @var UserRepository |
||
18 | */ |
||
19 | private $repository; |
||
20 | |||
21 | /** |
||
22 | * @var RouterInterface |
||
23 | */ |
||
24 | private $router; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $route; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function __construct(UserRepository $repository, RouterInterface $router, $route) |
||
35 | { |
||
36 | $this->repository = $repository; |
||
37 | $this->router = $router; |
||
38 | $this->route = $route; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function buildForm(FormBuilderInterface $builder, array $options) |
||
45 | { |
||
46 | $builder->addModelTransformer( |
||
47 | new IdentifierToObjectTransformer($this->repository, $options['identifier']) |
||
48 | ); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function buildView(FormView $view, FormInterface $form, array $options) |
||
55 | { |
||
56 | $view->vars['selectize'] = $options['selectize']; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function setDefaultOptions(OptionsResolverInterface $resolver) |
||
78 | |||
79 | public function getParent() |
||
80 | { |
||
81 | return 'text'; |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function getName() |
||
91 | } |
||
92 |