Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 private function setAuthor(\DOMElement $node, Record $item)
 {
     $nodeList = $node->getElementsByTagName('author');
     foreach ($nodeList->item(0)->childNodes as $nodeResult) {
         if ($nodeResult->nodeName === 'name') {
             $item->setAuthor($nodeResult->nodeValue);
             break;
         }
     }
 }