本文整理汇总了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);