Added info on changes to setting validation subpath to UPGRADE-2.1.md

This commit is contained in:
Richard Miller 2012-04-11 11:44:45 +01:00
parent 5e81389b3f
commit 60d9aff29a
1 changed files with 58 additions and 1 deletions

View File

@ -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.