LoaderChain.php in Plug 7
File
lib/Symfony/validator/Symfony/Component/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. |