mediatekformation

AbstractLoader
in package
implements LoaderInterface

Base loader for validation metadata.

This loader supports the loading of constraints from Symfony's default namespace (see ) using the short class names of those constraints. Constraints can also be loaded using their fully qualified class names. At last, namespace aliases can be defined to load constraints with the syntax "alias:ShortName".

Tags
author

Bernhard Schussek bschussek@gmail.com

Interfaces, Classes, Traits and Enums

LoaderInterface
Loads validation metadata into {@link ClassMetadata} instances.

Table of Contents

DEFAULT_NAMESPACE  = '\\Symfony\\Component\\Validator\\Constraints\\'
The namespace to load constraints from by default.
$namespaces  : mixed
addNamespaceAlias()  : mixed
Adds a namespace alias.
newConstraint()  : Constraint
Creates a new constraint instance for the given constraint name.

Constants

DEFAULT_NAMESPACE

The namespace to load constraints from by default.

public mixed DEFAULT_NAMESPACE = '\\Symfony\\Component\\Validator\\Constraints\\'

Properties

Methods

addNamespaceAlias()

Adds a namespace alias.

protected addNamespaceAlias(string $alias, string $namespace) : mixed

The namespace alias can be used to reference constraints from specific namespaces in :

$this->addNamespaceAlias('mynamespace', '\\Acme\\Package\\Constraints\\');

$constraint = $this->newConstraint('mynamespace:NotNull');
Parameters
$alias : string

The alias

$namespace : string

The PHP namespace

Return values
mixed

newConstraint()

Creates a new constraint instance for the given constraint name.

protected newConstraint(string $name[, mixed $options = null ]) : Constraint
Parameters
$name : string

The constraint name. Either a constraint relative to the default constraint namespace, or a fully qualified class name. Alternatively, the constraint may be preceded by a namespace alias and a colon. The namespace alias must have been defined using .

$options : mixed = null

The constraint options

Tags
throws
MappingException

If the namespace prefix is undefined

Return values
Constraint

Search results