From 60d9aff29aa2490121e6c75e3bd9a9aec02a8b77 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Wed, 11 Apr 2012 11:44:45 +0100 Subject: [PATCH] Added info on changes to setting validation subpath to UPGRADE-2.1.md --- UPGRADE-2.1.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) 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.