public ParseMetadatas ( ) : |
||
return |
public function ParseMetadatas()
{
$nodes = $this->getDomXpath()->query('/rdf:RDF/rdf:Description/*');
$metadatas = new MetadataBag();
foreach ($nodes as $node) {
$tagname = $this->normalize($node->nodeName);
try {
$tag = TagFactory::getFromRDFTagname($tagname);
} catch (TagUnknown $e) {
continue;
}
$metaValue = $this->readNodeValue($node, $tag);
$metadata = new Metadata($tag, $metaValue);
$metadatas->set($tagname, $metadata);
}
return $metadatas;
}
/** * * @return MetadataBag */ public function getMetadatas() { $key = realpath($this->file); if ($this->cache->contains($key)) { return $this->cache->fetch($key); } $metadatas = $this->parser->ParseMetadatas(); $this->cache->save($key, $metadatas); return $metadatas; }