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


PHP Batch::delete方法代碼示例

本文整理匯總了PHP中Batch::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Batch::delete方法的具體用法?PHP Batch::delete怎麽用?PHP Batch::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Batch的用法示例。


在下文中一共展示了Batch::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteRelationship

 /**
  * Delete the given relationship
  *
  * @param Relationship $relationship
  * @return boolean
  */
 public function deleteRelationship(Relationship $relationship)
 {
     if ($this->openBatch) {
         $this->openBatch->delete($relationship);
         return true;
     }
     return $this->runCommand(new Command\DeleteRelationship($this, $relationship));
 }
開發者ID:momoim,項目名稱:momo-api,代碼行數:14,代碼來源:Client.php

示例2: actionDelete

 public function actionDelete()
 {
     if (array_key_exists("batchIds", $_POST)) {
         $batchIds = (array) $_POST["batchIds"];
         $batch = new Batch();
         $batch->organizationId = Yii::app()->user->getOrgId();
         /*this is important to avoid one moderator to edit/delete other org batches*/
         foreach ($batchIds as $bId) {
             $batch->id = $bId;
             $batch->delete();
         }
         $this->render('delete');
     } else {
         Yii::app()->end();
     }
 }
開發者ID:rhl4ttr,項目名稱:hello-world,代碼行數:16,代碼來源:BatchController.php

示例3: testBranchDelete_DeleteManyObjects_ObjectsDeleted

 /**
  * @throws \ValidationException
  * @throws null
  */
 public function testBranchDelete_DeleteManyObjects_ObjectsDeleted()
 {
     $objects = array();
     for ($i = 0; $i < 100; $i++) {
         $human = new Human();
         $human->Name = 'Proud Owner ' . $i;
         $human->write();
         $dog = new Dog();
         $dog->Name = 'Pup ' . $i;
         $dog->Color = 'Fifty Shade No. ' . $i;
         $dog->Owner($human);
         $dog->write();
         $objects[] = $human;
         $objects[] = $dog;
     }
     $batch = new \Batch();
     $batch->delete($objects);
     $this->assertEquals(0, Dog::get()->Count());
     $this->assertEquals(0, Human::get()->Count());
 }
開發者ID:helpfulrobot,項目名稱:littlegiant-silverstripe-batchwrite,代碼行數:24,代碼來源:BatchDeleteTest.php

示例4: verify_oauth_session_exists

<?php

require_once './global.inc.php';
verify_oauth_session_exists();
if (HttpSession::currentUser()->getOrganization()->access_level < 4) {
    echo "Access denied";
    die;
}
$id = $_POST["id"];
$result = Batch::delete($id);
echo json_encode($result);
開發者ID:shiyamalan,項目名稱:csespn,代碼行數:11,代碼來源:admin.batches.delete.php


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