/** * Return valid eZRSSExport object for a specific node if it exists. * * @param int $nodeID * @return eZRSSExport|false Return value is inside a array with return value on result, as this is used as template fetch function. */ static function exportByNode($nodeID) { if (!$nodeID) { return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND)); } $rssExport = eZPersistentObject::fetchObject(eZRSSExport::definition(), null, array('node_id' => $nodeID, 'status' => eZRSSExport::STATUS_VALID), true); return array('result' => $rssExport); }
/** * Removes a RSS/ATOM Feed export for a node * * @param int $nodeID Node ID * * @since 4.3 */ public static function removeFeedForNode($nodeID) { $rssExport = eZPersistentObject::fetchObject(eZRSSExport::definition(), null, array('node_id' => $nodeID, 'status' => eZRSSExport::STATUS_VALID), true); if (!$rssExport instanceof eZRSSExport) { eZDebug::writeError('DisableRSS: There is no rss/atom feeds left to delete for this node: ' . $nodeID, __METHOD__); return array('status' => false); } $node = eZContentObjectTreeNode::fetch($nodeID); if (!$node instanceof eZContentObjectTreeNode) { eZDebug::writeError('DisableRSS: Could not fetch node: ' . $nodeID, __METHOD__); return array('status' => false); } $objectID = $node->attribute('contentobject_id'); $rssExport->removeThis(); eZContentCacheManager::clearContentCacheIfNeeded($objectID); return array('status' => true); }
static function fetchList( $asObject = true ) { return eZPersistentObject::fetchObjectList( eZRSSExport::definition(), null, array( 'status' => self::STATUS_VALID ), null, null, $asObject ); }