Doctrine\ODM\CouchDB\Mapping\Driver\XmlDriver::loadMappingFile PHP Method

loadMappingFile() protected method

protected loadMappingFile ( $file )
    protected function loadMappingFile($file)
    {
        $result = array();
        $entity = libxml_disable_entity_loader(true);
        $xmlElement = simplexml_load_string(file_get_contents($file));
        libxml_disable_entity_loader($entity);
        foreach (array('document', 'embedded-document', 'mapped-superclass') as $type) {
            if (isset($xmlElement->{$type})) {
                foreach ($xmlElement->{$type} as $documentElement) {
                    $documentName = (string) $documentElement['name'];
                    $result[$documentName] = $documentElement;
                }
            }
        }
        return $result;
    }