LoaderChain.php in Zircon Profile 8.0
File
vendor/symfony/validator/Mapping/Loader/LoaderChain.php
View source
<?php
namespace Symfony\Component\Validator\Mapping\Loader;
use Symfony\Component\Validator\Exception\MappingException;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class LoaderChain implements LoaderInterface {
protected $loaders;
public function __construct(array $loaders) {
foreach ($loaders as $loader) {
if (!$loader instanceof LoaderInterface) {
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', get_class($loader)));
}
}
$this->loaders = $loaders;
}
public function loadClassMetadata(ClassMetadata $metadata) {
$success = false;
foreach ($this->loaders as $loader) {
$success = $loader
->loadClassMetadata($metadata) || $success;
}
return $success;
}
}
Classes
Name |
Description |
LoaderChain |
Loads validation metadata from multiple {@link LoaderInterface} instances. |