本文整理汇总了PHP中Entrepot::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Entrepot::delete方法的具体用法?PHP Entrepot::delete怎么用?PHP Entrepot::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entrepot
的用法示例。
在下文中一共展示了Entrepot::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testEntrepotDelete
/**
* testEntrepotDelete
*
* @param int $id Id of entrepot
* @return void
*
* @depends testEntrepotOther
* The depends says test is run only if previous is ok
*/
public function testEntrepotDelete($id)
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject = new Entrepot($this->savdb);
$result = $localobject->fetch($id);
$result = $localobject->delete($id);
print __METHOD__ . " id=" . $id . " result=" . $result . "\n";
$this->assertLessThan($result, 0);
return $result;
}
示例2: header
header("Location: fiche.php?id=" . $id);
exit;
}
$action = 'create';
$mesg = '<div class="error">' . $object->error . '</div>';
} else {
$mesg = '<div class="error">' . $langs->trans("ErrorWarehouseRefRequired") . '</div>';
$action = "create";
// Force retour sur page creation
}
}
// Delete warehouse
if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->stock->supprimer) {
$object = new Entrepot($db);
$object->fetch($_REQUEST["id"]);
$result = $object->delete($user);
if ($result > 0) {
header("Location: " . DOL_URL_ROOT . '/product/stock/liste.php');
exit;
} else {
$mesg = '<div class="error">' . $object->error . '</div>';
$action = '';
}
}
// Modification entrepot
if ($action == 'update' && $_POST["cancel"] != $langs->trans("Cancel")) {
$object = new Entrepot($db);
if ($object->fetch($id)) {
$object->libelle = $_POST["libelle"];
$object->description = $_POST["desc"];
$object->statut = $_POST["statut"];
示例3: Entrepot
$_GET["action"] = 'create';
$mesg="<div class='error'>".$entrepot->error."</div>";
}
else {
$mesg="<div class='error'>".$langs->trans("ErrorWarehouseRefRequired")."</div>";
$_GET["action"]="create"; // Force retour sur page cr�ation
}
}
// Delete warehouse
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->stock->supprimer)
{
$entrepot = new Entrepot($db);
$entrepot->fetch($_REQUEST["id"]);
$result=$entrepot->delete($user);
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT.'/product/stock/liste.php');
exit;
}
else
{
$mesg='<div class="error">'.$entrepot->error.'</div>';
$_REQUEST['action']='';
}
}
// Modification entrepot
if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{