diff --git a/UPGRADE-2.1.md b/UPGRADE-2.1.md index a193ddcac3..6071be1911 100644 --- a/UPGRADE-2.1.md +++ b/UPGRADE-2.1.md @@ -1,4 +1,4 @@ -UPGRADE FROM 2.0 to 2.1 +UPGRADE FROM 2.0 to 2.1 ======================= ### General @@ -251,6 +251,63 @@ UPGRADE FROM 2.0 to 2.1 } } ``` +* The method `setPropertyPath()` in the ExecutionContext class + was removed. + + You should use the `addViolationAtSubPath()` method on the + `ExecutionContext` object instead. + + Before: + + ``` + public function isPropertyValid(ExecutionContext $context) + { + // ... + $propertyPath = $context->getPropertyPath() . '.property'; + $context->setPropertyPath($propertyPath); + $context->addViolation('Error Message', array(), null); + } + ``` + + After: + + ``` + public function isPropertyValid(ExecutionContext $context) + { + // ... + $context->addViolationAtSubPath('property', 'Error Message', array(), null); + + } + ``` + + * The method `setPropertyPath()` in the ExecutionContext class + was removed. + + You should use the `addViolationAtSubPath()` method on the + `ExecutionContext` object instead. + + Before: + + ``` + public function isPropertyValid(ExecutionContext $context) + { + // ... + $propertyPath = $context->getPropertyPath() . '.property'; + $context->setPropertyPath($propertyPath); + $context->addViolation('Error Message', array(), null); + } + ``` + + After: + + ``` + public function isPropertyValid(ExecutionContext $context) + { + // ... + $context->addViolationAtSubPath('property', 'Error Message', array(), null); + + } + ``` * The options passed to the `getParent()` method of form types no longer contain default options.