PHPExiftool\RDFParser::ParseMetadatas PHP Method

ParseMetadatas() public method

Parse an Entity associated DOM, returns the metadatas
public ParseMetadatas ( ) : MetadataBag
return PHPExiftool\Driver\Metadata\MetadataBag
    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;
    }

Usage Example

Beispiel #1
0
 /**
  *
  * @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;
 }