You are here

abstract class FilesLoader in Plug 7

Same name in this branch
  1. 7 lib/Symfony/validator/Symfony/Component/Validator/Tests/Fixtures/FilesLoader.php \Symfony\Component\Validator\Tests\Fixtures\FilesLoader
  2. 7 lib/Symfony/validator/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php \Symfony\Component\Validator\Mapping\Loader\FilesLoader

Base loader for loading validation metadata from a list of files.

@author Bulat Shakirzyanov <mallluhuct@gmail.com> @author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of FilesLoader

See also

YamlFilesLoader

XmlFilesLoader

1 file declares its use of FilesLoader
FilesLoader.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Fixtures/FilesLoader.php

File

lib/Symfony/validator/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php, line 23

Namespace

Symfony\Component\Validator\Mapping\Loader
View source
abstract class FilesLoader extends LoaderChain {

  /**
   * Creates a new loader.
   *
   * @param array $paths An array of file paths
   */
  public function __construct(array $paths) {
    parent::__construct($this
      ->getFileLoaders($paths));
  }

  /**
   * Returns an array of file loaders for the given file paths.
   *
   * @param array $paths An array of file paths
   *
   * @return LoaderInterface[] The metadata loaders
   */
  protected function getFileLoaders($paths) {
    $loaders = array();
    foreach ($paths as $path) {
      $loaders[] = $this
        ->getFileLoaderInstance($path);
    }
    return $loaders;
  }

  /**
   * Creates a loader for the given file path.
   *
   * @param string $path The file path
   *
   * @return LoaderInterface The created loader
   */
  protected abstract function getFileLoaderInstance($path);

}

Members

Namesort descending Modifiers Type Description Overrides
FilesLoader::getFileLoaderInstance abstract protected function Creates a loader for the given file path. 3
FilesLoader::getFileLoaders protected function Returns an array of file loaders for the given file paths.
FilesLoader::__construct public function Creates a new loader. Overrides LoaderChain::__construct 1
LoaderChain::$loaders protected property
LoaderChain::loadClassMetadata public function Loads validation metadata into a {@link ClassMetadata} instance. Overrides LoaderInterface::loadClassMetadata