ExecutionContextInterface deprecated::getMetadataFactory()

MetadataFactoryInterface getMetadataFactory() deprecated deprecated since version 2.5, to be removed in 3.0. Use {@link Context\ExecutionContextInterface::getValidator()} instead and call {@link Validator\ValidatorInterface::getMetadataFor()} or {@link Validator\ValidatorInterface::hasMetadataFor()} there. Returns the used metadata factory. Return Value MetadataFactoryInterface The metadata factory.

ExecutionContextInterface deprecated::getPropertyPath()

string getPropertyPath(string $subPath = '') Returns the property path to the value that the validator is currently validating. For example, take the following object graph: (Person)---($address: Address)---($street: string) When the Person instance is passed to the validator, the property path is initially empty. When the $address property of that person is validated, the property path is "address". When the $street property of the related Address instance is validated, the pr

ExecutionContextInterface deprecated::addViolationAt()

addViolationAt(string $subPath, string $message, array $parameters = array(), mixed $invalidValue = null, int|null $plural = null, int|null $code = null) deprecated deprecated since version 2.5, to be removed in 3.0. Use {@link Context\ExecutionContextInterface::buildViolation()} instead. Adds a violation at the validation graph node with the given property path relative to the current property path. Parameters string $subPath The relative property path for the violation string

ExecutionContextInterface deprecated::addViolation()

addViolation(string $message, array $params = array(), mixed $invalidValue = null, int|null $plural = null, int|null $code = null) Adds a violation at the current node of the validation graph. Note: the parameters $invalidValue, $plural and $code are deprecated since version 2.5 and will be removed in 3.0. Parameters string $message The error message array $params The parameters substituted in the error message mixed $invalidValue The invalid, validated value int|null $plural The n

ExecutionContextInterface deprecated

interface ExecutionContextInterface deprecated since version 2.5, to be removed in 3.0. Use {@link Context\ExecutionContextInterface} instead. Stores the validator's state during validation. For example, let's validate the following object graph: (Person)---($firstName: string) \ ($address: Address)---($street: string) We validate the Person instance, which becomes the "root" of the validation run (see {@link getRoot}). The state of the context after the first step will be like

ExecutionContextInterface

interface ExecutionContextInterface The context of a validation run. The context collects all violations generated during the validation. By default, validators execute all validations in a new context: $violations = $validator->validate($object); When you make another call to the validator, while the validation is in progress, the violations will be isolated from each other: public function validate($value, Constraint $constraint) { $validator = $this->context->getValidator();

ExecutionContextFactory

class ExecutionContextFactory implements ExecutionContextFactoryInterface Creates new {@link ExecutionContext} instances. Methods __construct(TranslatorInterface $translator, string|null $translationDomain = null) Creates a new context factory. ExecutionContextInterface createContext(ValidatorInterface $validator, mixed $root) Creates a new execution context. Details __construct(TranslatorInterface $translator, string|null $translationDomain = null)

ExecutionContextFactoryInterface

interface ExecutionContextFactoryInterface Creates instances of {@link ExecutionContextInterface}. You can use a custom factory if you want to customize the execution context that is passed through the validation run. Methods ExecutionContextInterface createContext(ValidatorInterface $validator, mixed $root) Creates a new execution context. Details ExecutionContextInterface createContext(ValidatorInterface $validator, mixed $root) Creates a new

ExecutionContext::setNode()

setNode(mixed $value, object|null $object, MetadataInterface $metadata = null, string $propertyPath) Sets the currently validated value. Parameters mixed $value The validated value object|null $object The currently validated object MetadataInterface $metadata The validation metadata string $propertyPath The property path to the current value

ExecutionContext::markObjectAsInitialized()

markObjectAsInitialized(string $cacheKey) Marks that an object was initialized. Parameters string $cacheKey The hash of the object