get_id() public method

This is usually used when writing code to check for new items in a feed. Uses , , or the about attribute for RDF. If none of these are supplied (or $hash is true), creates an MD5 hash based on the permalink, title and content.
public get_id ( boolean $hash = false, $fn = '' ) : string
$hash boolean Should we force using a hash instead of the supplied ID?
return string
Esempio n. 1
0
 /**
  * Parses a since feed item.
  *
  * @param \Devour\Table\TableInterface $table
  *   A table obeject.
  * @param \SimplePie_Item $item
  *   A SimplePie item.
  */
 protected function parseItem(TableInterface $table, \SimplePie_Item $item)
 {
     // @todo Add more fields.
     $row = $table->getNewRow();
     $row->set('id', $item->get_id())->set('permalink', $item->get_permalink())->set('title', $item->get_title())->set('date', $item->get_gmdate('U'))->set('content', $item->get_content());
     if ($author = $item->get_author()) {
         $row->set('author_name', $author->get_name())->set('author_email', $author->get_email());
     }
 }
 /**
  * Implements CollectionAbstract::buildQueueMessage().
  *
  * @param QueueMessage $message
  * @param \SimplePie_Item $item
  */
 public function buildQueueMessage(QueueMessage $message, $item)
 {
     $item_id = $item->get_id();
     $message->setBody($item_id);
 }
 function get_id($hash = false)
 {
     return apply_filters('feedwordpie_item_get_id', parent::get_id($hash), $hash, $this);
 }