Esempio n. 1
0
 private function setLink(\DOMElement $node, Record $item)
 {
     $nodeList = $node->getElementsByTagName('link');
     foreach ($nodeList as $nodeResult) {
         /** @var \DomElement $nodeResult */
         if ($nodeResult->getAttribute('rel') === 'alternate') {
             $item->setLink($nodeResult->getAttribute('href'));
             break;
         }
     }
 }
Esempio n. 2
0
 private function hydrateRecord(array $row)
 {
     $feed = new Record();
     $feed->setId($row['id']);
     $feed->setTitle($row['title']);
     $feed->setContent($row['content']);
     $feed->setPicture($row['picture']);
     $feed->setAuthor($row['author']);
     $feed->setLink($row['link']);
     $feed->setGuid($row['guid']);
     $feed->setPublicationDate(new \DateTime($row['publication_date']));
     $feed->setTags(json_decode($row['tags'], true));
     return $feed;
 }