本文整理汇总了PHP中table::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP table::delete方法的具体用法?PHP table::delete怎么用?PHP table::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table
的用法示例。
在下文中一共展示了table::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: table
function action_comments_remove()
{
$comm = new table("comments");
$id = intval($_GET["id"]);
$comm->delete($id);
show_msg("删除成功", $_SERVER["HTTP_REFERER"]);
}
示例2: testDelete
/**
*
* @dataProvider tabeleTrue
*
*/
public function testDelete($tabel, $args, $id)
{
$table = new table($tabel, $id);
$this->assertNotEmpty($table->getData(), 'This' . $id . ' failed');
$table->delete();
$this->assertEmpty($table->getData(), $id);
$table = new table($tabel, $id);
$this->assertEmpty($table->getData());
}
示例3: controllerRouterQueue
function controllerRouterQueue($routerId, $mode, $userId = false)
{
if (!$routerId) {
return;
}
//Add entry to updqueue table
$updqueueTable = new table('routerupdatequeue');
$updqueueTable->setLogging(false);
// Check for the same action records
$req = "WHERE router={$routerId} AND mode='{$mode}'";
if ($userId) {
$req .= " AND user={$userId}";
}
$similarRes = $updqueueTable->load($req);
if (!count($similarRes)) {
$updqueueTable->add(array('router' => $routerId, 'mode' => $mode, 'user' => $userId));
}
//fork('/updaterouter.php', false);
$unavailableRouters = array();
$queRes = $updqueueTable->load("WHERE `router`={$routerId}");
foreach ($queRes as $queRow) {
if (controllerRouter($queRow['router'], $queRow['mode'], $queRow['user']) || controllerRouter($queRow['router'], 'checkConnection', $queRow['user'])) {
$updqueueTable->delete(array('id' => $queRow['id']));
} else {
break;
}
}
}
示例4: unset
}
}
}
// Extract cash difference from user and proceed as moneflow
if ($target == 'user' && ($action == 'dbedit' || $action == 'dbadd') && isset($data['cash'])) {
unset($data['cash']);
}
switch ($action) {
case 'dbadd':
$id = $table->add($data);
break;
case 'dbedit':
$id = $table->edit($data);
break;
case 'dbremove':
$id = $table->delete($data);
break;
}
if ($target == 'user' && ($action == 'dbedit' || $action == 'dbadd') && isset($_POST['cash']) && checkPermission($sessionId, array('table', $target, 'edit', 'cash'))) {
if ($action === 'dbedit') {
$user = $table->loadById($id);
$sum = money($_POST['cash']) - money($user['cash']);
} else {
$sum = money($_POST['cash']);
}
if ($sum) {
$moneyflowTable = new table('moneyflow');
$moneyflowTable->add(array("user" => $id, "sum" => $sum, "detailsname" => "adminpay", "detailsid" => $sessionId));
}
payment(0, $id);
}