Example #1
0
 /**
  * Genereate the item id.
  *
  * @param SimpleXMLElement      $entry Feed item
  * @param \PicoFeed\Parser\Item $item  Item object
  * @param \PicoFeed\Parser\Feed $feed  Feed object
  */
 public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $id = (string) current(XmlParser::getXPathResult($entry, 'guid'));
     if ($id) {
         $item->id = $this->generateId($id);
     } else {
         $item->id = $this->generateId($item->getTitle(), $item->getUrl(), $item->getContent());
     }
 }
Example #2
0
 /**
  * Genereate the item id
  *
  * @access public
  * @param  SimpleXMLElement   $entry   Feed item
  * @param  \PicoFeed\Parser\Item     $item    Item object
  * @param  \PicoFeed\Parser\Feed     $feed    Feed object
  */
 public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $item->id = $this->generateId($item->getTitle(), $item->getUrl(), $item->getContent());
 }
Example #3
0
 /**
  * Genereate the item id
  *
  * @access public
  * @param  SimpleXMLElement          $entry   Feed item
  * @param  \PicoFeed\Parser\Item     $item    Item object
  * @param  \PicoFeed\Parser\Feed     $feed    Feed object
  */
 public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $id = (string) $entry->guid;
     if ($id) {
         $item->id = $this->generateId($id);
     } else {
         $item->id = $this->generateId($item->getTitle(), $item->getUrl(), $item->getContent());
     }
 }
Example #4
0
 /**
  * Genereate the item id
  *
  * @access public
  * @param  SimpleXMLElement   $entry   Feed item
  * @param  \PicoFeed\Parser\Item     $item    Item object
  * @param  \PicoFeed\Parser\Feed     $feed    Feed object
  */
 public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
 {
     $id = XmlParser::getXPathResult($entry, 'atom:id', $this->namespaces) ?: XmlParser::getXPathResult($entry, 'id');
     if (!empty($id)) {
         $item->id = $this->generateId((string) current($id));
     } else {
         $item->id = $this->generateId($item->getTitle(), $item->getUrl(), $item->getContent());
     }
 }