Browse Source

[Form] fixed error messages

Fabien Potencier 14 years ago
parent
commit
6793c20967
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Symfony/Component/Form/Util/PropertyPath.php

+ 2 - 2
src/Symfony/Component/Form/Util/PropertyPath.php

@@ -303,7 +303,7 @@ class PropertyPath implements \IteratorAggregate
                 return $object->$property;
             } else if ($reflClass->hasProperty($property)) {
                 if (!$reflClass->getProperty($property)->isPublic()) {
-                    throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "get%s()" or "is%s()"?', $property, $reflClass->getName(), ucfirst($property), ucfirst($property)));
+                    throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()"?', $property, $reflClass->getName(), $getter, $isser));
                 }
 
                 return $object->$property;
@@ -349,7 +349,7 @@ class PropertyPath implements \IteratorAggregate
                 $objectOrArray->$property = $value;
             } else if ($reflClass->hasProperty($property)) {
                 if (!$reflClass->getProperty($property)->isPublic()) {
-                    throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "set%s()"?', $property, $reflClass->getName(), ucfirst($property)));
+                    throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "set%s()"?', $property, $reflClass->getName(), $setter));
                 }
 
                 $objectOrArray->$property = $value;