本文整理汇总了PHP中eZContentObjectTreeNode::subTreeMultiPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectTreeNode::subTreeMultiPaths方法的具体用法?PHP eZContentObjectTreeNode::subTreeMultiPaths怎么用?PHP eZContentObjectTreeNode::subTreeMultiPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectTreeNode
的用法示例。
在下文中一共展示了eZContentObjectTreeNode::subTreeMultiPaths方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchNodeList
static function fetchNodeList($rssSources, $objectListFilter)
{
// compose parameters for several subtrees
if (is_array($rssSources) && count($rssSources)) {
foreach ($rssSources as $rssSource) {
// Do not include subnodes
if (!intval($rssSource->Subnodes)) {
$depth = 1;
} else {
$depth = 0;
}
$nodesParams[] = array('ParentNodeID' => $rssSource->SourceNodeID, 'ResultID' => $rssSource->ID, 'Depth' => $depth, 'DepthOperator' => 'eq', 'MainNodeOnly' => $objectListFilter['main_node_only'], 'ClassFilterType' => 'include', 'ClassFilterArray' => array(intval($rssSource->ClassID)));
}
$listParams = array('Limit' => $objectListFilter['number_of_objects'], 'SortBy' => array('published', false));
$nodeList = eZContentObjectTreeNode::subTreeMultiPaths($nodesParams, $listParams);
} else {
$nodeList = null;
}
return $nodeList;
}
示例2: modify
//.........这里部分代码省略.........
// {
// $tpl->unsetVariable( $key, $rootNamespace );
// }
}
break;
//@todo add cache!
//@todo add cache!
case 'include_cache':
$tpl = eZTemplate::factory();
foreach ($namedParameters['variables'] as $key => $value) {
$tpl->setVariable($key, $value);
}
$operatorValue = $tpl->fetch('design:' . $namedParameters['template']);
break;
case 'find_global_layout':
$result = false;
$node = $operatorValue;
if (is_numeric($node)) {
$node = eZContentObjectTreeNode::fetch($node);
}
if (!$node) {
return $operatorValue = $result;
}
$pathArray = $node->attribute('path_array');
$nodesParams = array();
foreach ($pathArray as $pathNodeID) {
if ($pathNodeID < eZINI::instance('content.ini')->variable('NodeSettings', 'RootNode') || $pathNodeID == $node->attribute('node_id')) {
continue;
} else {
$nodesParams[] = array('ParentNodeID' => $pathNodeID, 'ResultID' => 'ezcontentobject_tree.node_id', 'ClassFilterType' => 'include', 'ClassFilterArray' => $ini->variable('GlobalLayout', 'Classes'), 'Depth' => 1, 'DepthOperator' => 'eq', 'AsObject' => false);
}
}
//eZDebug::writeWarning( var_export($nodesParams,1), __METHOD__);
$findNodes = eZContentObjectTreeNode::subTreeMultiPaths($nodesParams, array('SortBy' => array('node_id', false)));
$sortByParentNodeID = array();
if (!empty($findNodes)) {
foreach ($findNodes as $findNode) {
$sortByParentNodeID[$findNode['parent_node_id']] = $findNode;
}
krsort($sortByParentNodeID);
$result = array_shift($sortByParentNodeID);
$result = eZContentObjectTreeNode::makeObjectsArray(array($result));
if (!empty($result)) {
$result = $result[0];
}
}
return $operatorValue = $result;
case 'redirect':
$url = $namedParameters['url'];
header('Location: ' . $url);
break;
case 'sort_nodes':
$sortNodes = array();
if (!empty($operatorValue) && is_array($operatorValue)) {
$nodes = $operatorValue;
foreach ($nodes as $node) {
if (!$node instanceof eZContentObjectTreeNode) {
continue;
}
$object = $node->object();
switch ($namedParameters['by']) {
case 'published':
default:
$sortby = $object->attribute('published');
break;
}