You are here

protected function XmlFileLoader::parseFile in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Validator\Mapping\Loader\XmlFileLoader::parseFile()
  2. 8 vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader::parseFile()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Validator\Mapping\Loader\XmlFileLoader::parseFile()

Loads the XML class descriptions from the given file.

Parameters

string $path The path of the XML file:

Return value

\SimpleXMLElement The class descriptions

Throws

MappingException If the file could not be loaded

1 call to XmlFileLoader::parseFile()
XmlFileLoader::loadClassMetadata in vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php
Loads validation metadata into a {@link ClassMetadata} instance.

File

vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php, line 174

Class

XmlFileLoader
Loads validation metadata from an XML file.

Namespace

Symfony\Component\Validator\Mapping\Loader

Code

protected function parseFile($path) {
  try {
    $dom = XmlUtils::loadFile($path, __DIR__ . '/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd');
  } catch (\Exception $e) {
    throw new MappingException($e
      ->getMessage(), $e
      ->getCode(), $e);
  }
  return simplexml_import_dom($dom);
}