本文整理匯總了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));
}
示例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();
}
}
示例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());
}
示例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);