本文整理汇总了PHP中eZContentObjectTreeNode::subTreeCountByNodeID方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectTreeNode::subTreeCountByNodeID方法的具体用法?PHP eZContentObjectTreeNode::subTreeCountByNodeID怎么用?PHP eZContentObjectTreeNode::subTreeCountByNodeID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectTreeNode
的用法示例。
在下文中一共展示了eZContentObjectTreeNode::subTreeCountByNodeID方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchObjectTreeCount
public static function fetchObjectTreeCount($parentNodeID, $onlyTranslated, $language, $class_filter_type, $class_filter_array, $attributeFilter, $depth, $depthOperator, $ignoreVisibility, $limitation, $mainNodeOnly, $extendedAttributeFilter, $objectNameFilter)
{
$childrenCount = null;
if (is_numeric($parentNodeID) or is_array($parentNodeID)) {
$childrenCount = eZContentObjectTreeNode::subTreeCountByNodeID(array('Limitation' => $limitation, 'ClassFilterType' => $class_filter_type, 'ClassFilterArray' => $class_filter_array, 'AttributeFilter' => $attributeFilter, 'DepthOperator' => $depthOperator, 'Depth' => $depth, 'IgnoreVisibility' => $ignoreVisibility, 'OnlyTranslated' => $onlyTranslated, 'Language' => $language, 'ObjectNameFilter' => $objectNameFilter, 'ExtendedAttributeFilter' => $extendedAttributeFilter, 'MainNodeOnly' => $mainNodeOnly), $parentNodeID);
}
if ($childrenCount === null) {
$result = array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
} else {
$result = array('result' => $childrenCount);
}
return $result;
}
示例2: queryCount
/**
* Returns node count using a given set of criteria
* @param ezpContentCriteria $criteria
* @return int
*/
public static function queryCount( ezpContentCriteria $criteria )
{
$fetchParams = self::translateFetchParams( $criteria );
$count = eZContentObjectTreeNode::subTreeCountByNodeID( $fetchParams->params, $fetchParams->rootNodeId );
return $count;
}
示例3: foreach
eZINI::instance()->setVariable('ContentSettings', 'PreViewCache', 'disabled');
eZINI::instance()->setVariable('SearchSettings', 'DelayedIndexing', 'enabled');
eZINI::instance('ezfind.ini')->setVariable('IndexOptions', 'OptimizeOnCommit', 'disabled');
$cli->notice("indexing disabled. Don't forget to reindex content.");
}
if ($dryRun) {
$cli->notice("Don't worry, --dry-run mode activated.");
}
foreach ($deleteIDArray as $nodeID) {
/** @var eZContentObjectTreeNode $node */
$node = eZContentObjectTreeNode::fetch($nodeID);
if ($node === null) {
$cli->error("\nSubtree remove Error!\nCannot find subtree with nodeID: '{$nodeID}'.");
continue;
}
$count = (int) eZContentObjectTreeNode::subTreeCountByNodeID($params, $nodeID);
$cli->notice("===== {$nodeID} : {$count} children to remove. " . $node->url());
$i = 0;
do {
/** @var eZContentObjectTreeNode[] $children */
$children = eZContentObjectTreeNode::subTreeByNodeID($params, $nodeID);
foreach ($children as $child) {
$i++;
$child_node_id = $child->attribute('node_id');
if ($verbose) {
$t = time();
$te = max($t - $start, 1);
// temps écoulé. (1 min pour éviter les divisions par 0)
$tm = $te / $i;
// temps moyen. = temps déjà consomé divisé par le nombre de objet passé. FLoat.
$r = $count - $i;
示例4: subTreeCount
function subTreeCount($params = array())
{
return eZContentObjectTreeNode::subTreeCountByNodeID($params, $this->attribute('node_id'));
}
示例5: createTreeNodeDOMElement
/**
* Create Node element
*
* @param DOMDocument Owner DOMDocument
* @param eZContentObject eZContentObject node.
*
* @return DOMElement Node DOMDocument.
*/
protected function createTreeNodeDOMElement(DOMDocument $domDocument, eZContentObjectTreeNode $node)
{
$nodeElement = $domDocument->createElement('Node');
// Set attributes.
$nodeElement->setAttribute('nodeID', $node->attribute('node_id'));
$nodeElement->setAttribute('parentID', $node->attribute('parent_node_id'));
// Get child information.
$conditions = array('Depth' => 1, 'DepthOperator' => 'eq');
$nodeElement->setAttribute('childCount', eZContentObjectTreeNode::subTreeCountByNodeID($conditions, $node->attribute('node_id')));
// Get child information for tree structure.
$conditions['ClassFilterType'] = 'include';
$conditions['ClassFilterArray'] = eZINI::instance('contentstructuremenu.ini')->variable('TreeMenu', 'ShowClasses');
$nodeElement->setAttribute('childMenuCount', eZContentObjectTreeNode::subTreeCountByNodeID($conditions, $node->attribute('node_id')));
// Get access rights element.
$nodeElement->appendChild($this->createAccessDOMElement($domDocument, $node));
// Get object element.
$nodeElement->appendChild($this->createObjectDOMElement($domDocument, $node->attribute('object')));
return $nodeElement;
}
示例6: modify
//.........这里部分代码省略.........
// Use custom node id. int|array (default: current node id)
if ( isset( $parameters['extra_menu_node_id'] ) )
{
$pageData['extra_menu_node_id'] = $parameters['extra_menu_node_id'];
}
// Use custom extra menu identifier list. false|array (default: infobox)
if ( isset( $parameters['extra_menu_class_list'] ) )
{
$pageData['extra_menu_class_list'] = $parameters['extra_menu_class_list'];
}
else if ( $menuIni->hasVariable('MenuContentSettings', 'ExtraIdentifierList') )
{
$pageData['extra_menu_class_list'] = $menuIni->variable('MenuContentSettings', 'ExtraIdentifierList');
}
if ( $menuIni->variable( 'MenuSettings', 'AlwaysAvailable' ) === 'false' )
{
// A set of cases where left/extra menu's are hidden unless set by parameters
if ( $pageData['is_edit'] || strpos( $uriString, 'content/versionview' ) === 0 )
{
if ( !isset( $parameters['left_menu'] ) ) $pageData['left_menu'] = false;
if ( !isset( $parameters['extra_menu'] ) ) $pageData['extra_menu'] = false;
}
else if ( !$currentNodeId || $uiContext === 'browse' )
{
if ( !isset( $parameters['left_menu'] ) ) $pageData['left_menu'] = false;
if ( !isset( $parameters['extra_menu'] ) ) $pageData['extra_menu'] = false;
}
}
// Count extra menu objects if all extra menu settings are present
if ( isset( $parameters['extra_menu_subitems'] ) )
{
$pageData['extra_menu_subitems'] = $parameters['extra_menu_subitems'];
if ( !$pageData['extra_menu_subitems'] ) $pageData['extra_menu'] = false;
}
else if ( $pageData['extra_menu'] && $pageData['extra_menu_class_list'] && $pageData['extra_menu_node_id'] )
{
if ( $menuIni->variable( 'MenuContentSettings', 'ExtraMenuSubitemsCheck' ) === 'enabled' )
{
$pageData['extra_menu_subitems'] = eZContentObjectTreeNode::subTreeCountByNodeID( array( 'Depth' => 1,
'DepthOperator' => 'eq',
'ClassFilterType' => 'include',
'ClassFilterArray' => $pageData['extra_menu_class_list'] ),
$pageData['extra_menu_node_id'] );
if ( !$pageData['extra_menu_subitems'] ) $pageData['extra_menu'] = false;
}
}
// Init path parameters
$pageData['path_array'] = array();
$pageData['path_id_array'] = array();
$pageData['path_normalized'] = '';
// Creating menu css classes for div#page
$pageData['css_classes'] = '';
// Add section css class for div#page
if ( isset( $moduleResult['section_id'] ))
{
$pageData['css_classes'] .= ' section_id_' . $moduleResult['section_id'];
}
// Generate relative path array as well full path id array and path css classes for div#page
$path = ( isset( $moduleResult['path'] ) && is_array( $moduleResult['path'] ) ) ? $moduleResult['path'] : array();
foreach ( $path as $key => $item )
{
if ( $key >= $pageData['page_root_depth'])
{
$pageData['path_array'][] = $item;
}
if ( isset( $item['node_id'] ) )
{
$pageData['path_normalized'] .= ' subtree_level_' . $key . '_node_id_' . $item['node_id'];
$pageData['path_id_array'][] = $item['node_id'];
}
}
$pageData['css_classes'] .= $pageData['path_normalized'];
if ( isset( $pageData['persistent_variable']['pagestyle_css_classes'] )
&& is_array( $pageData['persistent_variable']['pagestyle_css_classes'] ) )
{
$pageData['css_classes'] .= ' ' . implode( ' ', $pageData['persistent_variable']['pagestyle_css_classes'] );
}
$pageData['inner_column_size'] = 8;
if ( $pageData['left_menu'] && $pageData['extra_menu'] )
$pageData['inner_column_size'] = 6;
if ( !$pageData['left_menu'] && !$pageData['extra_menu'] )
$pageData['inner_column_size'] = 12;
$pageData['outer_column_size'] = 4;
if ( $pageData['left_menu'] && $pageData['extra_menu'] )
$pageData['outer_column_size'] = 3;
$operatorValue = $pageData;
} break;
}
}
示例7: createMFSitemap
public static function createMFSitemap()
{
eZDebug::writeDebug("Generating Standard Sitemap with images ...", __METHOD__);
$cli = $GLOBALS['cli'];
global $cli, $isQuiet;
if (!$isQuiet) {
$cli->output("Generating Sitemap for Siteaccess " . $GLOBALS['eZCurrentAccess']['name'] . " \n");
}
$ini = eZINI::instance('site.ini');
$googlesitemapsINI = eZINI::instance('xrowsitemap.ini');
// Get the Sitemap's root node
$contentINI = eZINI::instance('content.ini');
$rootNode = eZContentObjectTreeNode::fetch($contentINI->variable('NodeSettings', 'RootNode'));
if (!$rootNode instanceof eZContentObjectTreeNode) {
$cli->output("Invalid RootNode for Siteaccess " . $GLOBALS['eZCurrentAccess']['name'] . " \n");
continue;
}
// Settings variables
if ($googlesitemapsINI->hasVariable('MFSitemapSettings', 'ClassFilterType') and $googlesitemapsINI->hasVariable('MFSitemapSettings', 'ClassFilterArray')) {
$params2 = array('ClassFilterType' => $googlesitemapsINI->variable('MFSitemapSettings', 'ClassFilterType'), 'ClassFilterArray' => $googlesitemapsINI->variable('MFSitemapSettings', 'ClassFilterArray'));
}
$max = 49997;
// max. amount of links in 1 sitemap
$limit = 50;
// Fetch the content tree
$params = array('SortBy' => array(array('depth', true), array('published', false)));
if (isset($params2)) {
$params = array_merge($params, $params2);
}
$subtreeCount = eZContentObjectTreeNode::subTreeCountByNodeID($params, $rootNode->NodeID);
if ($subtreeCount == 1) {
$cli->output("No Items found under node #" . $contentINI->variable('NodeSettings', 'RootNode') . ".");
}
if (!$isQuiet) {
$amount = $subtreeCount + 1;
// +1 is root node
$cli->output("Adding {$amount} nodes to the sitemap.");
$output = new ezcConsoleOutput();
$bar = new ezcConsoleProgressbar($output, $amount);
}
$addPrio = false;
if ($googlesitemapsINI->hasVariable('MFSitemapSettings', 'AddPriorityToSubtree') and $googlesitemapsINI->variable('MFSitemapSettings', 'AddPriorityToSubtree') == 'true') {
$addPrio = true;
}
$sitemap = new xrowSitemap();
// Generate Sitemap
/** START Adding the root node **/
$object = $rootNode->object();
$meta = xrowMetaDataFunctions::fetchByObject($object);
$extensions = array();
$extensions[] = new xrowSitemapItemModified($rootNode->attribute('modified_subnode'));
$url = $rootNode->attribute('url_alias');
eZURI::transformURI($url, true);
if ($ini->variable('SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess') == 'enabled') {
$url = 'http://' . xrowSitemapTools::domain() . $url;
} else {
$url = 'http://' . xrowSitemapTools::domain() . '/' . $GLOBALS['eZCurrentAccess']['name'] . $url;
}
if ($meta and $meta->googlemap != '0') {
$extensions[] = new xrowSitemapItemFrequency($meta->change);
$extensions[] = new xrowSitemapItemPriority($meta->priority);
$sitemap->add($url, $extensions);
} elseif ($meta === false and $googlesitemapsINI->variable('Settings', 'AlwaysAdd') == 'enabled') {
if ($addPrio) {
$extensions[] = new xrowSitemapItemPriority('1');
}
$sitemap->add($url, $extensions);
}
if (isset($bar)) {
$bar->advance();
}
/** END Adding the root node **/
$max = min($max, $subtreeCount);
$params['Limit'] = min($max, $limit);
$params['Offset'] = 0;
while ($params['Offset'] < $max) {
$nodeArray = eZContentObjectTreeNode::subTreeByNodeID($params, $rootNode->NodeID);
foreach ($nodeArray as $subTreeNode) {
eZContentLanguage::expireCache();
$object = $subTreeNode->object();
$images = array();
$meta = xrowMetaDataFunctions::fetchByObject($object);
$extensions = array();
$extensions[] = new xrowSitemapItemModified($subTreeNode->attribute('modified_subnode'));
$url = $subTreeNode->attribute('url_alias');
eZURI::transformURI($url, true);
if ($ini->variable('SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess') == 'enabled') {
$url = 'http://' . xrowSitemapTools::domain() . $url;
} else {
$url = 'http://' . xrowSitemapTools::domain() . '/' . $GLOBALS['eZCurrentAccess']['name'] . $url;
}
if ($meta and $meta->googlemap != '0') {
$extensions[] = new xrowSitemapItemFrequency($meta->change);
$extensions[] = new xrowSitemapItemPriority($meta->priority);
} elseif ($meta === false and $googlesitemapsINI->variable('Settings', 'AlwaysAdd') == 'enabled') {
if ($addPrio) {
$rootDepth = $rootNode->attribute('depth');
$prio = 1 - ($subTreeNode->attribute('depth') - $rootDepth) / 10;
if ($prio > 0) {
$extensions[] = new xrowSitemapItemPriority($prio);
//.........这里部分代码省略.........
示例8: array
require 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "Remove archived content object versions according to " . "[VersionManagement/DefaultVersionHistoryLimit and " . "[VersionManagement]/VersionHistoryClass settings", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[n]", "", array("n" => "Do not wait"));
$script->initialize();
if (!isset($options['n'])) {
$cli->warning("This cleanup script is going to remove archived versions according to the settings");
$cli->warning("content.ini/[VersionManagement]/DefaultVersionHistoryLimit and content.ini/[VersionManagement]/VersionHistoryClass");
$cli->warning();
$cli->warning("You have 10 seconds to break the script (press Ctrl-C)");
sleep(10);
$cli->output();
}
$subTreeParams = array('Limitation' => array(), 'MainNodeOnly' => true, 'LoadDataMap' => false, 'IgnoreVisibility' => true);
$total = eZContentObjectTreeNode::subTreeCountByNodeID($subTreeParams, 1);
$cli->output("{$total} objects to check... (In the progess bar, 'R' means that at least a version was removed)");
$script->setIterationData('R', '.');
$script->resetIteration($total);
$subTreeParams['Offset'] = 0;
$subTreeParams['Limit'] = 100;
$db = eZDB::instance();
while (true) {
$nodes = eZContentObjectTreeNode::subTreeByNodeID($subTreeParams, 1);
if (empty($nodes)) {
break;
}
foreach ($nodes as $node) {
$object = $node->attribute('object');
$versionCount = $object->getVersionCount();
$versionLimit = eZContentClass::versionHistoryLimit($object->attribute('content_class'));
示例9: print_r
<?php
$offset = 0;
$limit = 30;
$db = eZDB::instance();
$siteINI = eZINI::instance('site.ini');
$refINI = eZINI::instance('sitemap.ini');
$siteURL = $siteINI->variable('SiteSettings', 'SiteURL');
$ClassFilterArray = $refINI->variable('SitemapSettings', 'ClassFilterArray');
$ClassFilterType = $refINI->variable('SitemapSettings', 'ClassFilterType');
print_r($ClassFilterType);
if ($ClassFilterType != 'include' && $ClassFilterType != 'exclude') {
eZExecution::cleanExit();
}
$params = array('ClassFilterType' => $ClassFilterType, 'ClassFilterArray' => $ClassFilterArray);
$count = eZContentObjectTreeNode::subTreeCountByNodeID($params, 2);
/* Clean de la base SQL */
$sql_truncate = "TRUNCATE TABLE `do_sitemap` ";
$db->query($sql_truncate);
$params['Limit'] = $limit;
while ($offset < $count) {
$params['Offset'] = $offset;
$elements = eZContentObjectTreeNode::subTreeByNodeID($params, 2);
foreach ($elements as $element) {
$info = array();
$info['dosm_loc'] = $siteURL . '/' . $element->url();
$info['dosm_lastmod'] = date('Y-m-d', $element->object()->attribute('modified'));
$info['dosm_changefreq'] = 'monthly';
$info['dosm_priority'] = '1';
$info['dosm_insertedDate'] = '';
$info['dosm_updatedDate'] = date('Y-m-d', $element->object()->attribute('published'));
示例10: createMobileSitemap
public static function createMobileSitemap()
{
eZDebug::writeDebug("Generating mobile sitemap ...", __METHOD__);
$cli = eZCLI::instance();
if (!$isQuiet) {
$cli->output("Generating mobile sitemap for siteaccess " . $GLOBALS['eZCurrentAccess']['name'] . " \n");
}
$ini = eZINI::instance('site.ini');
$xrowsitemapINI = eZINI::instance('xrowsitemap.ini');
// Get the Sitemap's root node
$rootNode = self::rootNode();
// Settings variables
if ($xrowsitemapINI->hasVariable('MobileSitemapSettings', 'ClassFilterType') and $xrowsitemapINI->hasVariable('MobileSitemapSettings', 'ClassFilterArray')) {
$params2 = array('ClassFilterType' => $xrowsitemapINI->variable('MobileSitemapSettings', 'ClassFilterType'), 'ClassFilterArray' => $xrowsitemapINI->variable('MobileSitemapSettings', 'ClassFilterArray'));
}
$max = self::MAX_PER_FILE;
$limit = 50;
// Fetch the content tree
$params = array('SortBy' => array(array('depth', true), array('published', true)));
if (isset($params2)) {
$params = array_merge($params, $params2);
}
$subtreeCount = eZContentObjectTreeNode::subTreeCountByNodeID($params, $rootNode->NodeID);
if ($subtreeCount == 1) {
$cli->output("No Items found under RootNode {$rootNode->NodeID}.");
}
if (!$isQuiet) {
$amount = $subtreeCount + 1;
// +1 is root node
$cli->output("Adding {$amount} nodes to the sitemap for RootNode {$rootNode->NodeID}.");
$output = new ezcConsoleOutput();
$bar = new ezcConsoleProgressbar($output, $amount);
}
$addPrio = false;
if ($xrowsitemapINI->hasVariable('Settings', 'AddPriorityToSubtree') and $xrowsitemapINI->variable('Settings', 'AddPriorityToSubtree') == 'true') {
$addPrio = true;
}
$sitemap = new xrowMobileSitemap();
// Generate Sitemap
/** START Adding the root node **/
$object = $rootNode->object();
$meta = xrowMetaDataFunctions::fetchByObject($object);
$extensions = array();
$extensions[] = new xrowSitemapItemModified($rootNode->attribute('modified_subnode'));
$url = $rootNode->attribute('url_alias');
eZURI::transformURI($url);
if ($xrowsitemapINI->hasVariable('SitemapSettings', 'MobileDomainName') && $xrowsitemapINI->hasVariable('SitemapSettings', 'MobileDomainName') != '') {
$mobileDomain = $xrowsitemapINI->variable('SitemapSettings', 'MobileDomainName');
} else {
$mobileDomain = self::domain();
}
$url = 'http://' . $mobileDomain . $url;
if ($meta and $meta->sitemap_use != '0') {
$extensions[] = new xrowSitemapItemFrequency($meta->change);
$extensions[] = new xrowSitemapItemPriority($meta->priority);
$sitemap->add($url, $extensions);
} elseif ($meta === false and $xrowsitemapINI->variable('Settings', 'AlwaysAdd') == 'enabled') {
if ($addPrio) {
$extensions[] = new xrowSitemapItemPriority('1');
}
$sitemap->add($url, $extensions);
}
if (isset($bar)) {
$bar->advance();
}
/** END Adding the root node **/
$max = min($max, $subtreeCount);
$params['Limit'] = min($max, $limit);
$params['Offset'] = 0;
while ($params['Offset'] < $max) {
$nodeArray = eZContentObjectTreeNode::subTreeByNodeID($params, $rootNode->NodeID);
foreach ($nodeArray as $subTreeNode) {
eZContentLanguage::expireCache();
$meta = xrowMetaDataFunctions::fetchByNode($subTreeNode);
$extensions = array();
$extensions[] = new xrowSitemapItemModified($subTreeNode->attribute('modified_subnode'));
$url = $subTreeNode->attribute('url_alias');
eZURI::transformURI($url);
$url = 'http://' . $mobileDomain . $url;
if ($meta and $meta->sitemap_use != '0') {
$extensions[] = new xrowSitemapItemFrequency($meta->change);
$extensions[] = new xrowSitemapItemPriority($meta->priority);
$sitemap->add($url, $extensions);
} elseif ($meta === false and $xrowsitemapINI->variable('Settings', 'AlwaysAdd') == 'enabled') {
if ($addPrio) {
$rootDepth = $rootNode->attribute('depth');
$prio = 1 - ($subTreeNode->attribute('depth') - $rootDepth) / 10;
if ($prio > 0) {
$extensions[] = new xrowSitemapItemPriority($prio);
}
}
$sitemap->add($url, $extensions);
}
if (isset($bar)) {
$bar->advance();
}
}
eZContentObject::clearCache();
$params['Offset'] += $params['Limit'];
}
//.........这里部分代码省略.........
示例11: microtime
$srcStopTime = microtime();
$startTime = @next(explode(" ", $srcStartTime)) + current(explode(" ", $srcStartTime));
$stopTime = @next(explode(" ", $srcStopTime)) + current(explode(" ", $srcStopTime));
$executionTime = round($stopTime - $startTime, 2);
/** Alert the user to how long the script execution took place **/
$cli->output("\n\nThis script execution completed in " . $executionTime . " seconds" . ".\n");
}
/** Login script to run as admin user This is required to see past content tree permissions, sections and other limitations **/
$currentuser = eZUser::currentUser();
$currentuser->logoutCurrent();
$user = eZUser::fetch($adminUserID);
$user->loginCurrent();
/** Fetch total files count from content tree **/
$totalFileCountParams = array('ClassFilterType' => 'include', 'ClassFilterArray' => $classes, 'Depth' => 10, 'MainNodeOnly' => true, 'SortBy' => array('published', true), 'IgnoreVisibility' => true);
/** Fetch total count for member content objects **/
$totalFileCount = eZContentObjectTreeNode::subTreeCountByNodeID($totalFileCountParams, $parentNodeID);
/** Debug verbose output **/
if (!$totalFileCount) {
$cli->error("No member objects found");
/** Call for display of execution time **/
executionTimeDisplay($srcStartTime, $cli);
$script->shutdown(3);
}
$cli->warning("Total number of objects to be checked: " . $totalFileCount . "\n");
/** Setup script iteration details **/
$script->setIterationData('.', '.');
$script->resetIteration($totalFileCount);
/** Iterate over nodes **/
while ($offset < $totalFileCount) {
/** Fetch nodes under starting node in content tree **/
$subTreeParams = array('Limit' => $limit, 'Offset' => $offset, 'ClassFilterType' => 'include', 'ClassFilterArray' => $classes, 'SortBy' => array('modified', false), 'Depth' => 10, 'MainNodeOnly' => true, 'IgnoreVisibility' => true);
示例12: _count
/**
* Fetches and returns the current subtree node count
*
* @return int Total number of nodes in subtree
*/
protected function _count()
{
$params = $this->_fetchParams();
$count = eZContentObjectTreeNode::subTreeCountByNodeID( $params, $this->_node );
return (int) $count;
}
示例13: fetchNodeInfoFromId
private function fetchNodeInfoFromId($nodeId)
{
if (!eepValidate::validateContentNodeId($nodeId)) {
throw new Exception("This is not a node id: [" . $nodeId . "]");
}
$keepers = array("Name", "ContentObjectID", "MainNodeID", "ClassIdentifier", "PathIdentificationString", "PathString", "ParentNodeID", "CurrentLanguage", "ContentObjectVersion", "RemoteID", "IsHidden", "IsInvisible", "ContentObjectIsPublished");
// get the node
$node = eZContentObjectTreeNode::fetch($nodeId);
//var_dump($node);
// extract the members we want
$results[] = array("key", "value");
foreach ($keepers as $key) {
$results[] = array($key, $node->{$key});
}
// additional info
$results[] = array("Reverse related count", eZContentObjectTreeNode::reverseRelatedCount(array($nodeId)));
$params = array('Depth' => 1, 'DepthOperator' => 'eq', 'Limitation' => array());
$results[] = array("Children count", eZContentObjectTreeNode::subTreeCountByNodeID($params, $nodeId));
$results[] = array("URL Alias", $node->urlAlias());
// do output
eep::printTable($results, "contentnode info [" . $nodeId . "]");
}