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