Ejemplo n.º 1
0
 /**
  * Implements CollectionAbstract::buildDocument().
  *
  * @param IndexDocument $document
  * @param \SimplePie_Item $data
  */
 public function buildDocument(IndexDocument $document, $data)
 {
     $document->source = $this->_feed->get_title();
     $document->subject = $this->_feed->get_description();
     $document->title = $data->get_title();
     $document->link = $data->get_link();
     $document->description = $data->get_description();
     $document->creator = (array) $data->get_author();
     $document->date = $data->get_date();
     // PHP properties cannot have dashes (-), and the fields below have
     // dashes in the field name.
     $document->source_link = $this->_feed->get_link();
     $document->getField('source_link')->setName('source-link');
     $document->item_subject = $this->_feed->get_link();
     $document->getField('item_subject')->setName('item-subject');
 }
Ejemplo n.º 2
0
 /**
  * Populate an item from a feed item
  *
  * @param $item \Planetflow3\Domain\Model\Item
  * @param $feedItem \SimplePie_Item
  * @return void
  */
 protected function populateItemProperties(Item $item, \SimplePie_Item $feedItem)
 {
     $item->setLink($feedItem->get_link());
     $item->setTitle($feedItem->get_title());
     $item->setDescription($feedItem->get_description());
     $item->setContent($feedItem->get_content(TRUE));
     $item->setPublicationDate(new \DateTime($feedItem->get_date()));
     $item->setAuthor($feedItem->get_author());
 }