本文整理匯總了PHP中Contrat::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contrat::delete方法的具體用法?PHP Contrat::delete怎麽用?PHP Contrat::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contrat
的用法示例。
在下文中一共展示了Contrat::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testContratDelete
/**
* testContratDelete
*
* @param int $id Id of contract
* @return int
*
* @depends testContratOther
* The depends says test is run only if previous is ok
*/
public function testContratDelete($id)
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject = new Contrat($this->savdb);
$result = $localobject->fetch($id);
$result = $localobject->delete($user);
print __METHOD__ . " id=" . $id . " result=" . $result . "\n";
$this->assertLessThan($result, 0);
return $result;
}
示例2:
$result = $object->validate($user,$langs,$conf);
}
// Close all lines
if ($action == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($_GET["id"]);
$result = $object->cloture($user,$langs,$conf);
}
if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
{
if ($user->rights->contrat->supprimer)
{
$object->id = $_GET["id"];
$result=$object->delete($user,$langs,$conf);
if ($result >= 0)
{
Header("Location: index.php");
return;
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}
}
if ($action == 'confirm_move' && $_REQUEST["confirm"] == 'yes')
{
if ($user->rights->contrat->creer)