/** * Adds feed metadata pertaining to the item's data specified in $data * * @todo Add list of required metadata to add * * @param string $ezcFeedEntryElement * @param string $data * @return void */ public function decorateFeedItem(ezcFeedEntryElement $item, $data) { $author = $item->add("author"); $author->name = $data["author"]; $link = $item->add("link"); $link->href = $data["nodeUrl"]; $item->title = $data["objectName"]; $item->updated = $data["modified"]; $item->published = $data["published"]; $item->id = "N/A"; $item->description = ""; }
/** * Adds feed metadata pertaining to the item's data specified in $data * * @todo Add list of required metadata to add * * @param string $ezcFeedEntryElement * @param string $data * @return void */ public function decorateFeedItem(ezcFeedEntryElement $item, $data) { $author = $item->add('author'); $author->name = $data['author']; $link = $item->add('link'); $link->href = $data['nodeUrl']; $item->title = $data['objectName']; $item->updated = $data['modified']; $item->published = $data['published']; $item->id = "N/A"; $item->description = ""; }
function decorateFeedItem(ezcFeedEntryElement $item, $data) { $installDomain = $GLOBALS['ini']->getSetting('TheWire', 'installDomain'); $author = $item->add('author'); $author->name = $data['fullname']; $author->email = "{$data['user_id']}@" . $GLOBALS['ini']->getSetting('TheWire', 'mailDomain'); $link = $item->add('link'); $link->href = "http://{$installDomain}/update/{$data['id']}"; $item->title = $data['user_id'] . ': ' . $data['status']; $item->description = $data['fullname'] . ': ' . $data['status']; $item->published = $data['date']; $item->id = "http://{$installDomain}/update/{$data['id']}"; $item->updated = $data['date']; }
/** * Parses the XML element $node and creates modules in the feed or * feed item $item. * * @param ezcFeedEntryElement|ezcFeed $item The feed or feed item which will contain the modules * @param DOMElement $node The XML element from which to get the module elements * @param string $tagName The XML tag name (if it contains ':' it will be considered part of a module) * @ignore */ protected function parseModules($item, DOMElement $node, $tagName) { $supportedModules = ezcFeed::getSupportedModules(); if (strpos($tagName, ':') !== false) { list($prefix, $key) = explode(':', $tagName); $moduleName = isset($this->usedPrefixes[$prefix]) ? $this->usedPrefixes[$prefix] : null; if (isset($supportedModules[$moduleName])) { $module = $item->hasModule($moduleName) ? $item->{$moduleName} : $item->addModule($moduleName); $module->parse($key, $node); } } }