FileLoader
abstract class FileLoader extends AbstractLoader
Base loader for loading validation metadata from a file.
Constants
DEFAULT_NAMESPACE |
The namespace to load constraints from by default. |
Properties
protected | $namespaces | from AbstractLoader | |
protected | $file |
Methods
newConstraint(string $name, mixed $options = null)
Creates a new constraint instance for the given constraint name.
from AbstractLoader
__construct(string $file)
Creates a new loader.
Details
protected
addNamespaceAlias(string $alias, string $namespace)
Adds a namespace alias.
The namespace alias can be used to reference constraints from specific namespaces in {@link newConstraint()}:
$this->addNamespaceAlias('mynamespace', '\\Acme\\Package\\Constraints\\');
$constraint = $this->newConstraint('mynamespace:NotNull');
protected Constraint
newConstraint(string $name, mixed $options = null)
Creates a new constraint instance for the given constraint name.