Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function buildView(FormView $view, FormInterface $form, array $options) |
||
22 | { |
||
23 | $view->vars['image_url'] = null; |
||
24 | |||
25 | if (array_key_exists('image_path', $options)) { |
||
26 | $parentData = $form->getParent()->getData(); |
||
27 | |||
28 | if (null !== $parentData) { |
||
29 | $accessor = PropertyAccess::createPropertyAccessor(); |
||
30 | $imageUrl = $accessor->getValue($parentData, $options['image_path']); |
||
31 | } else { |
||
32 | $imageUrl = null; |
||
33 | } |
||
34 | |||
35 | $view->vars['image_url'] = $imageUrl; |
||
36 | } |
||
37 | } |
||
38 | |||
55 |