當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZContentOperationCollection::deleteObject方法代碼示例

本文整理匯總了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'];
開發者ID:legende91,項目名稱:ez,代碼行數:31,代碼來源:removeobject.php

示例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" );
    }
開發者ID:robinmuilwijk,項目名稱:ezpublish,代碼行數:24,代碼來源:ezcontentoperationdelete_regression.php

示例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);
     }
 }
開發者ID:nicolasaguenot,項目名稱:sqliimport,代碼行數:15,代碼來源:sqlicontent.php

示例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();
開發者ID:pkamps,項目名稱:mugo_bootstrap_admin,代碼行數:14,代碼來源:remove_object.php


注:本文中的eZContentOperationCollection::deleteObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。