本文整理汇总了PHP中eZContentOperationCollection::deleteObject方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection::deleteObject方法的具体用法?PHP eZContentOperationCollection::deleteObject怎么用?PHP eZContentOperationCollection::deleteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentOperationCollection
的用法示例。
在下文中一共展示了eZContentOperationCollection::deleteObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($http->hasPostVariable('SupportsMoveToTrash')) {
if ($http->hasPostVariable('MoveToTrash')) {
$moveToTrash = $http->postVariable('MoveToTrash') ? true : false;
} else {
$moveToTrash = false;
}
}
$hideRemoveConfirm = $contentINI->hasVariable('RemoveSettings', 'HideRemoveConfirmation') ? $contentINI->variable('RemoveSettings', 'HideRemoveConfirmation') == 'true' ? true : false : false;
if ($http->hasSessionVariable('HideRemoveConfirmation')) {
$hideRemoveConfirm = $http->sessionVariable('HideRemoveConfirmation');
}
if ($http->hasPostVariable("ConfirmButton") or $hideRemoveConfirm) {
if (eZOperationHandler::operationIsAvailable('content_delete')) {
$operationResult = eZOperationHandler::execute('content', 'delete', array('node_id_list' => $deleteIDArray, 'move_to_trash' => $moveToTrash), null, true);
} else {
eZContentOperationCollection::deleteObject($deleteIDArray, $moveToTrash);
}
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));
}
}
$showCheck = $contentINI->hasVariable('RemoveSettings', 'ShowRemoveToTrashCheck') ? $contentINI->variable('RemoveSettings', 'ShowRemoveToTrashCheck') == 'false' ? false : true : true;
$info = eZContentObjectTreeNode::subtreeRemovalInformation($deleteIDArray);
$deleteResult = $info['delete_list'];
$moveToTrashAllowed = $info['move_to_trash'];
$totalChildCount = $info['total_child_count'];
$hasPendingObject = $info['has_pending_object'];
示例2: testRemovePendingSearchNotAllNodesRemoved
/**
* Same test as {@link self::testRemovePendingSearchSeveralNodesForObject()}, with not all nodes removed
* Use case
* --------
* 1. If all nodes are removed, pending action must also be removed
* 2. If NOT all nodes are removed (at least one node remaining for object), pending action must NOT be removed (case tested here)
*
* @group issue_17932
*/
public function testRemovePendingSearchNotAllNodesRemoved()
{
$this->folder->addNode( 43 );
$folderObjectID = $this->folder->object->attribute( 'id' );
$aNodeID = array( $this->folder->nodes[0]->attribute( 'node_id' ) ); // Only delete the first node
eZContentOperationCollection::deleteObject( $aNodeID );
$filterConds = array(
'action' => 'index_object',
'param' => $folderObjectID
);
$pendingCount = eZPersistentObject::count( eZPendingActions::definition(), $filterConds );
self::assertGreaterThan( 0, $pendingCount, "eZContentOperationCollection::deleteObject() must remove pending action for object #$folderObjectID as all nodes have been removed" );
}
示例3: doRemove
/**
* Does the remove job.
* Will use content_delete operation if available (workflow support)
* @param array $aNodeID
* @param bool $moveToTrash Indicates if we move content to trash or not. True by default
* @internal
*/
private function doRemove(array $aNodeID, $moveToTrash = true)
{
if (eZOperationHandler::operationIsAvailable('content_delete')) {
$operationResult = eZOperationHandler::execute('content', 'delete', array('node_id_list' => $aNodeID, 'move_to_trash' => $moveToTrash), null, true);
} else {
eZContentOperationCollection::deleteObject($aNodeID, $moveToTrash);
}
}
示例4: json_encode
<?php
$return = false;
$objectId = (int) $_REQUEST['contentobjectid'];
if ($objectId) {
$eZObj = eZContentObject::fetch($objectId);
if ($eZObj && $eZObj->attribute('can_remove') && $eZObj->attribute('status') != eZContentObject::STATUS_ARCHIVED) {
$result = eZContentOperationCollection::deleteObject(array($eZObj->attribute('main_node_id')), true);
$return = $result['status'];
}
}
header('Content-Type: application/json');
echo json_encode($return);
eZExecution::cleanExit();