From 2f271a69e7b5cb983236dcb4ed39b7e6b5c6cb4d Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 31 Mar 2013 20:51:30 +0200 Subject: [PATCH] [Cookbook] Remove deprectated call to PropertyPath --- cookbook/form/create_form_type_extension.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/form/create_form_type_extension.rst b/cookbook/form/create_form_type_extension.rst index e6ac99b922d..e6cb3593508 100644 --- a/cookbook/form/create_form_type_extension.rst +++ b/cookbook/form/create_form_type_extension.rst @@ -194,7 +194,7 @@ it in the view:: use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormInterface; - use Symfony\Component\Form\Util\PropertyPath; + use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class ImageTypeExtension extends AbstractTypeExtension @@ -232,8 +232,8 @@ it in the view:: $parentData = $form->getParent()->getData(); if (null !== $parentData) { - $propertyPath = new PropertyPath($options['image_path']); - $imageUrl = $propertyPath->getValue($parentData); + $accessor = PropertyAccess::getPropertyAccessor(); + $imageUrl = $accessor->getValue($parentData, $options['image_path']); } else { $imageUrl = null; }