本文整理汇总了PHP中eZContentOperationCollection::removeNodes方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection::removeNodes方法的具体用法?PHP eZContentOperationCollection::removeNodes怎么用?PHP eZContentOperationCollection::removeNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentOperationCollection
的用法示例。
在下文中一共展示了eZContentOperationCollection::removeNodes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_keys
if ($count > 0) {
$hasChildren = true;
}
}
}
if ($hasChildren) {
$http->setSessionVariable('CurrentViewMode', $viewMode);
$http->setSessionVariable('DeleteIDArray', array_keys($removeList));
$http->setSessionVariable('ContentNodeID', $nodeID);
$http->setSessionVariable('ContentLanguage', $languageCode);
return $module->redirectToView('removeobject');
} else {
if (eZOperationHandler::operationIsAvailable('content_removelocation')) {
$operationResult = eZOperationHandler::execute('content', 'removelocation', array('node_list' => array_keys($removeList)), null, true);
} else {
eZContentOperationCollection::removeNodes(array_keys($removeList));
}
}
return $module->redirectToView('view', array($viewMode, $redirectNodeID, $languageCode));
} else {
if ($http->hasPostVariable('EditButton')) {
if ($http->hasPostVariable('ContentObjectID')) {
$parameters = array($http->postVariable('ContentObjectID'));
if ($http->hasPostVariable('ContentObjectVersion')) {
$parameters[] = $http->postVariable('ContentObjectVersion');
if ($http->hasPostVariable('ContentObjectLanguageCode')) {
$parameters[] = $http->postVariable('ContentObjectLanguageCode');
}
} else {
if ($http->hasPostVariable('ContentObjectLanguageCode')) {
$languageCode = $http->postVariable('ContentObjectLanguageCode');
示例2: foreach
// to do this the following must be true:
// - The total child count must be zero
// - There must be no object removal (i.e. it is the only node for the object)
if ($totalChildCount == 0) {
$canRemove = true;
foreach ($deleteResult as $item) {
if ($item['object_node_count'] <= 1) {
$canRemove = false;
break;
}
}
if ($canRemove) {
if (eZOperationHandler::operationIsAvailable('content_removelocation')) {
$operationResult = eZOperationHandler::execute('content', 'removelocation', array('node_list' => array_keys($deleteNodeIdArray), 'move_to_trash' => $moveToTrash), null, true);
} else {
eZContentOperationCollection::removeNodes(array_keys($deleteNodeIdArray));
}
if ($http->hasSessionVariable('RedirectURIAfterRemove') && $http->sessionVariable('RedirectURIAfterRemove')) {
$Module->redirectTo($http->sessionVariable('RedirectURIAfterRemove'));
$http->removeSessionVariable('RedirectURIAfterRemove');
return $http->removeSessionVariable('RedirectIfCancel');
} else {
return $Module->redirectToView('view', array($viewMode, $contentNodeID, $contentLanguage));
}
}
}
$tpl = eZTemplate::factory();
$tpl->setVariable('reverse_related', $info['reverse_related_count']);
$tpl->setVariable('module', $Module);
$tpl->setVariable('moveToTrashAllowed', $moveToTrashAllowed);
// Backwards compatibility