Example #1
0
 /**
  * Find the item published date.
  *
  * @param SimpleXMLElement      $entry Feed item
  * @param Item                  $item  Item object
  * @param \PicoFeed\Parser\Feed $feed  Feed object
  */
 public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $date = XmlParser::getXPathResult($entry, 'dc:date', $this->namespaces);
     $item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime(XmlParser::getValue($date)) : null);
 }
Example #2
0
 /**
  * Find the item published date.
  *
  * @param SimpleXMLElement      $entry Feed item
  * @param Item                  $item  Item object
  * @param \PicoFeed\Parser\Feed $feed  Feed object
  */
 public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $date = XmlParser::getXPathResult($entry, 'atom:published', $this->namespaces) ?: XmlParser::getXPathResult($entry, 'published');
     $item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime((string) current($date)) : null);
 }