/** * @param string $uuid * @return int */ protected function countTotalFromUserSelection( $uuid = null ) { return MMSelections::countTotalFromUserSelection(); }
/** * @return array */ public static function selectionList() { $userSelections = array(); $selections = MMSelections::fetchUserSelection(null, null, false); /* @type $selection MMSelections */ while ( list(, $selection) = each($selections) ) { $object = eZContentObject::fetchByRemoteID($selection->attribute('remote_id')); if ( $object instanceof eZContentObject ) { $node = $object->mainNode(); /* @type $dataMap eZContentObjectAttribute[] */ $dataMap = $node->dataMap(); // Get first promo_image $image = false; if ( isset($dataMap['promo_image']) && $dataMap['promo_image']->hasContent() ) { $content = $dataMap['promo_image']->content(); $relationList = $content['relation_list']; if ( isset($relationList[0]['node_id']) ) { /* @type $imageDataMap eZContentObjectAttribute[] */ $imageNode = eZContentObjectTreeNode::fetch($relationList[0]['node_id']); $imageDataMap = $imageNode->dataMap(); if ( isset($imageDataMap['file']) && $imageDataMap['file']->hasContent() ) { /* @type $imageFileContent eZImageAliasHandler */ $imageFileContent = $imageDataMap['file']->content(); $imageFileAlias = $imageFileContent->imageAlias('original'); $image = $imageFileAlias['url']; } } } $applicationLocalized = CacheApplicationTool::buildLocalizedApplicationByIdentifier($selection->attribute('application')); $applicationObject = $applicationLocalized->applicationObject(); $userSelections[] = array( 'headline' => $node->getName(), 'nodeId' => $selection->attribute('node_id'), 'date' => date(DATE_ATOM, $selection->attribute('add_date')), 'application' => $applicationObject->attribute('id'), 'applicationName' => $applicationLocalized->attribute("name"), 'description' => $selection->attribute('description'), 'image' => '/' . $image, 'url' => NodeOperatorHelper::getUrlNode($selection->attribute('application'), $node) ); } } return array( 'selection' => $userSelections, 'count' => MMSelections::countTotalFromUserSelection() ); }