You are here

public function ValidatorBuilder::setPropertyAccessor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/ValidatorBuilder.php \Symfony\Component\Validator\ValidatorBuilder::setPropertyAccessor()

Overrides ValidatorBuilderInterface::setPropertyAccessor

Deprecated

since version 2.5, to be removed in 3.0. The validator will function without a property accessor.

File

vendor/symfony/validator/ValidatorBuilder.php, line 301

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor) {
  @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED);
  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;
}