本文整理匯總了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