本文整理汇总了PHP中Entrepot::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Entrepot::update方法的具体用法?PHP Entrepot::update怎么用?PHP Entrepot::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entrepot
的用法示例。
在下文中一共展示了Entrepot::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Entrepot
$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"];
$object->lieu = $_POST["lieu"];
$object->address = $_POST["address"];
$object->zip = $_POST["zipcode"];
$object->town = $_POST["town"];
$object->country_id = $_POST["country_id"];
if ($object->update($id, $user) > 0) {
$action = '';
//$mesg = '<div class="ok">Fiche mise a jour</div>';
} else {
$action = 'edit';
$mesg = '<div class="error">' . $object->error . '</div>';
}
} else {
$action = 'edit';
$mesg = '<div class="error">' . $object->error . '</div>';
}
}
if ($_POST["cancel"] == $langs->trans("Cancel")) {
$action = '';
}
/*
示例2: testEntrepotUpdate
/**
* testEntrepotUpdate
*
* @param Entrepot $localobject Entrepot
* @return void
*
* @depends testEntrepotFetch
* The depends says test is run only if previous is ok
*/
public function testEntrepotUpdate($localobject)
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject->note = 'New note after update';
$result = $localobject->update($localobject->id, $user);
print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n";
$this->assertLessThan($result, 0);
return $localobject;
}
示例3: Entrepot
$object = new Entrepot($db);
if ($object->fetch($_POST["id"]))
{
$object->libelle = $_POST["libelle"];
$object->description = $_POST["desc"];
$object->statut = $_POST["statut"];
$object->lieu = $_POST["lieu"];
$object->address = $_POST["address"];
$object->cp = $_POST["zipcode"];
$object->ville = $_POST["town"];
$object->pays_id = $_POST["country_id"];
$object->zip = $_POST["zipcode"];
$object->town = $_POST["town"];
$object->country_id = $_POST["country_id"];
if ( $object->update($_POST["id"], $user) > 0)
{
$action = '';
$_GET["id"] = $_POST["id"];
//$mesg = '<div class="ok">Fiche mise a jour</div>';
}
else
{
$action = 'edit';
$_GET["id"] = $_POST["id"];
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
else
{
$action = 'edit';
示例4: Entrepot
// Modification entrepot
if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$entrepot = new Entrepot($db);
if ($entrepot->fetch($_POST["id"]))
{
$entrepot->libelle = $_POST["libelle"];
$entrepot->description = $_POST["desc"];
$entrepot->statut = $_POST["statut"];
$entrepot->lieu = $_POST["lieu"];
$entrepot->address = $_POST["address"];
$entrepot->cp = $_POST["cp"];
$entrepot->ville = $_POST["ville"];
$entrepot->pays_id = $_POST["pays_id"];
if ( $entrepot->update($_POST["id"], $user) > 0)
{
$_GET["action"] = '';
$_GET["id"] = $_POST["id"];
//$mesg = '<div class="ok">Fiche mise � jour</div>';
}
else
{
$_GET["action"] = 'edit';
$_GET["id"] = $_POST["id"];
$mesg = '<div class="error">'.$entrepot->error.'</div>';
}
}
else
{
$_GET["action"] = 'edit';