当前位置: 首页>>代码示例>>PHP>>正文


PHP Commande::delete方法代码示例

本文整理汇总了PHP中Commande::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Commande::delete方法的具体用法?PHP Commande::delete怎么用?PHP Commande::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Commande的用法示例。


在下文中一共展示了Commande::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Delete order
  *
  * @param   int     $id         Order ID
  * 
  * @url     DELETE  order/{id}
  * 
  * @return  array
  */
 function delete($id)
 {
     if (!DolibarrApiAccess::$user->rights->commande->supprimer) {
         throw new RestException(401);
     }
     $result = $this->commande->fetch($id);
     if (!$result) {
         throw new RestException(404, 'Order not found');
     }
     if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
         throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
     }
     if (!$this->commande->delete(DolibarrApiAccess::$user)) {
         throw new RestException(500, 'Error when delete order : ' . $this->commande->error);
     }
     return array('success' => array('code' => 200, 'message' => 'Order deleted'));
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:26,代码来源:api_commande.class.php

示例2: testCommandeDelete

 /**
  * testCommandeDelete
  *
  * @param   int $id         Id of order
  * @return  void
  *
  * @depends testCommandeOther
  * The depends says test is run only if previous is ok
  */
 public function testCommandeDelete($id)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $localobject = new Commande($this->savdb);
     $result = $localobject->fetch($id);
     $result = $localobject->delete($user);
     print __METHOD__ . " id=" . $id . " result=" . $result . "\n";
     $this->assertLessThan($result, 0);
     return $result;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:23,代码来源:CommandeTest.php

示例3: count

        $row = $db->fetch_array($resql);
        $db->begin();
        $db->query("DELETE FROM " . MAIN_DB_PREFIX . "commandedet WHERE rowid = {$row['0']};");
        $db->commit();
    } else {
        $db->begin();
        $db->query("delete from " . MAIN_DB_PREFIX . "commandedet where rowid='{$id}'");
        $db->commit();
    }
    $sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "commandedet where fk_commande={$placeid}";
    $resql = $db->query($sql);
    $row = $db->fetch_array($resql);
    if ($row[0] == 0) {
        $object = new Commande($db);
        $ret = $object->fetch($placeid);
        $result = $object->delete($user);
    }
}
if ($action == "q") {
    $db->begin();
    $db->query("update " . MAIN_DB_PREFIX . "commandedet set qty='{$number}', total_ht=subprice*qty, total_tva=total_ht*tva_tx/100, total_ttc=total_ht+total_tva where rowid='{$id}'");
    $db->commit();
}
if ($action == "p") {
    $db->begin();
    $db->query("update " . MAIN_DB_PREFIX . "commandedet set price='{$number}', remise=remise_percent*price/100, subprice=(price-remise)/(tva_tx/100+1), total_ht=subprice*qty, total_tva=total_ht*tva_tx/100, total_ttc=total_ht+total_tva where rowid='{$id}'");
    $db->commit();
}
if ($action == "d") {
    $db->begin();
    $db->query("update " . MAIN_DB_PREFIX . "commandedet set remise_percent='{$number}', remise=remise_percent*price/100, subprice=(price-remise)/(tva_tx/100+1), total_ht=subprice*qty, total_tva=total_ht*tva_tx/100, total_ttc=total_ht+total_tva where rowid='{$id}'");
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:loadticket.php


注:本文中的Commande::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。