Example #1
0
 /**
  * Find the item author.
  *
  * @param SimpleXMLElement      $xml   Feed
  * @param SimpleXMLElement      $entry Feed item
  * @param \PicoFeed\Parser\Item $item  Item object
  */
 public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item)
 {
     $value = XmlParser::getXPathResult($entry, 'dc:creator', $this->namespaces) ?: XmlParser::getXPathResult($entry, 'author') ?: XmlParser::getXPathResult($xml, 'channel/dc:creator', $this->namespaces) ?: XmlParser::getXPathResult($xml, 'channel/managingEditor');
     $item->setAuthor(XmlParser::getValue($value));
 }
Example #2
0
 /**
  * Find the item author.
  *
  * @param SimpleXMLElement      $xml   Feed
  * @param SimpleXMLElement      $entry Feed item
  * @param \PicoFeed\Parser\Item $item  Item object
  */
 public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item)
 {
     $author = XmlParser::getXPathResult($entry, 'dc:creator', $this->namespaces) ?: XmlParser::getXPathResult($xml, 'rss:channel/dc:creator', $this->namespaces) ?: XmlParser::getXPathResult($xml, 'channel/dc:creator', $this->namespaces);
     $item->setAuthor(XmlParser::getValue($author));
 }
Example #3
0
 /**
  * Find the item author.
  *
  * @param SimpleXMLElement      $xml   Feed
  * @param SimpleXMLElement      $entry Feed item
  * @param \PicoFeed\Parser\Item $item  Item object
  */
 public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item)
 {
     $author = XmlParser::getXPathResult($entry, 'atom:author/atom:name', $this->namespaces) ?: XmlParser::getXPathResult($entry, 'author/name') ?: XmlParser::getXPathResult($xml, 'atom:author/atom:name', $this->namespaces) ?: XmlParser::getXPathResult($xml, 'author/name');
     $item->setAuthor(XmlParser::getValue($author));
 }