From 69eb0195251536b0b096b1e0278efd7dfe268e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Sat, 3 Nov 2012 21:38:13 +0100 Subject: [PATCH 1/2] Added missing dot in property path assembly. --- cookbook/validation/custom_constraint.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index 1e898be1bdf..8c27eaeb3a4 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -217,7 +217,7 @@ With this, the validator ``isValid()`` method gets an object as its first argume { if ($protocol->getFoo() != $protocol->getBar()) { - $propertyPath = $this->context->getPropertyPath() . 'foo'; + $propertyPath = $this->context->getPropertyPath() . '.foo'; $this->context->setPropertyPath($propertyPath); $this->context->addViolation($constraint->getMessage(), array(), null); From dd91b7303fdf8383fa8c07da3ae9f3cc273f438b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Sun, 4 Nov 2012 13:25:26 +0100 Subject: [PATCH 2/2] Removed space around dot operator. --- cookbook/validation/custom_constraint.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index 8c27eaeb3a4..c026ea84667 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -217,7 +217,7 @@ With this, the validator ``isValid()`` method gets an object as its first argume { if ($protocol->getFoo() != $protocol->getBar()) { - $propertyPath = $this->context->getPropertyPath() . '.foo'; + $propertyPath = $this->context->getPropertyPath().'.foo'; $this->context->setPropertyPath($propertyPath); $this->context->addViolation($constraint->getMessage(), array(), null);