You are here

public function ValidatorBuilder::setPropertyAccessor in Plug 7

Sets the property accessor for resolving property paths.

Parameters

PropertyAccessorInterface $propertyAccessor The property accessor:

Return value

ValidatorBuilderInterface The builder object

Overrides ValidatorBuilderInterface::setPropertyAccessor

Deprecated

Deprecated since version 2.5, to be removed in Symfony 3.0.

File

lib/Symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php, line 306

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor) {
  if (null !== $this->validatorFactory) {
    throw new ValidatorException('You cannot set a property accessor after setting a custom validator factory. Configure your validator factory instead.');
  }
  $this->propertyAccessor = $propertyAccessor;
  return $this;
}