abstract class FileLoader in Plug 7
Same name in this branch
- 7 lib/Symfony/translation/Loader/FileLoader.php \Symfony\Component\Translation\Loader\FileLoader
- 7 lib/Symfony/validator/Symfony/Component/Validator/Mapping/Loader/FileLoader.php \Symfony\Component\Validator\Mapping\Loader\FileLoader
Base loader for loading validation metadata from a file.
@author Bernhard Schussek <bschussek@gmail.com>
Hierarchy
- class \Symfony\Component\Validator\Mapping\Loader\AbstractLoader implements LoaderInterface
- class \Symfony\Component\Validator\Mapping\Loader\FileLoader
Expanded class hierarchy of FileLoader
See also
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Mapping/ Loader/ FileLoader.php, line 24
Namespace
Symfony\Component\Validator\Mapping\LoaderView source
abstract class FileLoader extends AbstractLoader {
/**
* The file to load.
*
* @var string
*/
protected $file;
/**
* Creates a new loader.
*
* @param string $file The mapping file to load
*
* @throws MappingException If the file does not exist or is not readable
*/
public function __construct($file) {
if (!is_file($file)) {
throw new MappingException(sprintf('The mapping file "%s" does not exist', $file));
}
if (!is_readable($file)) {
throw new MappingException(sprintf('The mapping file "%s" is not readable', $file));
}
if (!stream_is_local($this->file)) {
throw new MappingException(sprintf('The mapping file "%s" is not a local file', $file));
}
$this->file = $file;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractLoader:: |
protected | property | ||
AbstractLoader:: |
protected | function | Adds a namespace alias. | |
AbstractLoader:: |
constant | The namespace to load constraints from by default. | ||
AbstractLoader:: |
protected | function | Creates a new constraint instance for the given constraint name. | |
FileLoader:: |
protected | property | The file to load. | |
FileLoader:: |
public | function | Creates a new loader. | |
LoaderInterface:: |
public | function | Loads validation metadata into a {@link ClassMetadata} instance. | 6 |