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


PHP CMbObject::delete方法代码示例

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


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

示例1: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     // Suppression ou non de document en cours de modification
     $this->load($this->doc_ged_id);
     if (!$this->_lastactif) {
         $this->loadLastActif();
     }
     if (!$this->_lastentry) {
         $this->loadLastEntry();
     }
     if ($msg = $this->canDeleteEx()) {
         return $msg;
     }
     $this->_lastactif->delete_suivi($this->doc_ged_id, $this->_lastactif->doc_ged_suivi_id);
     if ($this->_lastactif->doc_ged_suivi_id) {
         $this->etat = self::TERMINE;
         $this->user_id = 0;
         $this->store();
     } else {
         return parent::delete();
     }
     return null;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:26,代码来源:CDocGed.class.php

示例2: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $consults = $this->loadRefsConsultations();
     $sejours = $this->loadRefsSejours();
     if ($msg = parent::delete()) {
         return $msg;
     }
     $msg = "";
     foreach ($consults as $_consult) {
         $_consult->grossesse_id = "";
         if ($_msg = $_consult->store()) {
             $msg .= "\n {$_msg}";
         }
     }
     foreach ($sejours as $_sejour) {
         $_sejour->grossesse_id = "";
         if ($_msg = $_sejour->store()) {
             $msg .= "\n {$_msg}";
         }
     }
     if ($msg) {
         return $msg;
     }
     return null;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:28,代码来源:CGrossesse.class.php

示例3: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField("order_item_id", "quantity");
     $this->loadRefOrderItem();
     $item = $this->_ref_order_item;
     $item->loadReference();
     $reference = $item->_ref_reference;
     $reference->loadRefProduct();
     $product = $reference->_ref_product;
     if ($product->loadRefStock()) {
         $product->_ref_stock_group->quantity -= $this->quantity;
     }
     // If the order is already flagged as received,
     // we check if it will still be after deletion
     $item->loadOrder();
     $order = $item->_ref_order;
     if ($order->_id && $order->received) {
         $count_renewed = $order->countRenewedItems();
         $count_received = $order->countReceivedItems() - (count($order->_ref_order_items) - $count_renewed);
         if ($count_received < $count_renewed) {
             $order->received = 0;
         }
     }
     if ($msg = parent::delete()) {
         return $msg;
     }
     // we store other objects only if deletion was ok !
     if ($product->_ref_stock_group && $product->_ref_stock_group->_id) {
         $product->_ref_stock_group->store();
     }
     if ($order && $order->_id) {
         $order->store();
     }
     return null;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:38,代码来源:CProductOrderItemReception.class.php

示例4: delete

 /**
  * Redéfinition du delete
  *
  * @return void|string
  **/
 function delete()
 {
     if (count($this->_ref_reglements)) {
         return "Vous ne pouvez pas supprimer une facture ayant des règlements";
     }
     if (count($this->_ref_relances)) {
         return "Vous ne pouvez pas supprimer une facture ayant des relances";
     }
     if (CModule::getActive("dPfacturation")) {
         $where = array();
         $where["object_id"] = " = '{$this->_id}'";
         $where["object_class"] = " = '{$this->_class}'";
         $item = new CFactureItem();
         $items = $item->loadList($where);
         foreach ($items as $_item) {
             if ($msg = $_item->delete()) {
                 return $msg;
             }
         }
         $where = array();
         $where["facture_id"] = " = '{$this->_id}'";
         $where["facture_class"] = " = '{$this->_class}'";
         $where[] = "object_class = 'Sejour' OR object_class = 'CConsultation'";
         $liaison = new CFactureLiaison();
         $liaisons = $liaison->loadList($where);
         foreach ($liaisons as $lien) {
             if ($msg = $lien->delete()) {
                 return $msg;
             }
         }
     }
     // Standard delete
     if ($msg = parent::delete()) {
         return $msg;
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:41,代码来源:CFacture.class.php

示例5: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField("devenir_dentaire_id", "rank");
     /** @var CDevenirDentaire $devenir_dentaire */
     $devenir_dentaire = $this->loadFwdRef("devenir_dentaire_id");
     $actes_dentaires = $devenir_dentaire->loadRefsActesDentaires();
     foreach ($actes_dentaires as &$_acte_dentaire) {
         if ($_acte_dentaire->_id == $this->_id) {
             continue;
         }
         if ($_acte_dentaire->rank > $this->rank) {
             $_acte_dentaire->rank--;
             if ($msg = $_acte_dentaire->store()) {
                 CAppUI::setMsg($msg);
             }
         }
     }
     parent::delete();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:22,代码来源:CActeDentaire.class.php

示例6: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField('delivery_id', 'quantity', 'date_delivery', 'date_reception');
     $this->loadRefsFwd();
     $stock = $this->getStock();
     $stock->loadRefsFwd();
     $infinite_group_stock = CAppUI::conf('dPstock CProductStockGroup infinite_quantity') == '1';
     $stock_service = new CProductStockService();
     $stock_service->product_id = $stock->product_id;
     $stock_service->object_id = $this->_ref_delivery->service_id;
     $stock_service->object_class = "CService";
     // XXX
     $stock_service->loadMatchingObject();
     if (!$infinite_group_stock && $this->date_delivery) {
         $stock->quantity += $this->quantity;
         if ($msg = $stock->store()) {
             return $msg;
         }
     }
     if ($stock_service->_id && $this->date_reception) {
         $stock_service->quantity -= $this->quantity;
         if ($msg = $stock_service->store()) {
             return $msg;
         }
     }
     // Calcul du stock du sejour
     if ($this->_code_cis && $this->_ref_delivery->sejour_id && CModule::getActive("pharmacie")) {
         $stock_sejour = CStockSejour::getFromCIS($this->_code_cis, $this->_ref_delivery->sejour_id);
         if ($stock_sejour->_id) {
             $codes_cip = CMedicamentProduit::getArticleCodes($this->_code_cis);
             $ds = $this->getDS();
             $where = array();
             $where["product.code"] = $ds->prepareIn($codes_cip);
             $where["product_delivery.sejour_id"] = $ds->prepare("= '{$this->_ref_delivery->sejour_id}'");
             $ljoin = array();
             $ljoin["product_stock_group"] = "product_stock_group.stock_id = product_delivery.stock_id\r\n                                           AND product_delivery.stock_class = 'CProductStockGroup'";
             $ljoin["product"] = "product.product_id = product_stock_group.product_id";
             $delivery = new CProductDelivery();
             $delivery->loadObject($where, "product_delivery.date_dispensation DESC", null, $ljoin);
             // Si la delivrance actuelle est la derniere pour ce sejour et ce CIS
             if ($delivery->_id == $this->delivery_id) {
                 // Mise a jour de la quantité du stock en quantité d'administration
                 $code_cip = $this->_ref_delivery->loadRefStock()->loadRefProduct()->code;
                 $product = CMedicamentArticle::get($code_cip);
                 if ($product->getId()) {
                     $ratio = $product->_ratio_cis_cip;
                     // Mise à jour du stock
                     $stock_sejour->datetime = $this->_ref_delivery->datetime_min;
                     $stock_sejour->quantite -= $this->quantity / $ratio;
                     $stock_sejour->quantite = round($stock_sejour->quantite, 4);
                     if ($msg = $stock_sejour->store()) {
                         return $msg;
                     }
                 }
             }
         }
     }
     return parent::delete();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:62,代码来源:CProductDeliveryTrace.class.php

示例7: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField("type", "dossier_medical_id");
     if ($this->type == "alle") {
         $this->loadRefDossierMedical();
         $dossier_medical = $this->_ref_dossier_medical;
         if ($dossier_medical->object_class == "CPatient") {
             DSHM::remKeys("alertes-*-CPatient-" . $dossier_medical->object_id);
         }
     }
     return parent::delete();
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:15,代码来源:CAntecedent.class.php

示例8: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     // Suppression du fichier correspondant
     if ($this->file_id) {
         $this->loadFile();
         if ($this->_ref_file->file_id) {
             $this->_ref_file->delete();
         }
     }
     //suppression de la doc
     return parent::delete();
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:15,代码来源:CDocGedSuivi.class.php

示例9: deleteObject

 /**
  * Delete object
  *
  * @param CMbObject $object Object
  *
  * @throws CMbException
  *
  * @return null|string null if successful otherwise returns and error message
  */
 static function deleteObject(CMbObject $object)
 {
     if ($msg = $object->delete()) {
         throw new CMbException($msg);
     }
     return null;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:16,代码来源:CIHETestCase.class.php

示例10: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     if ($msg = $this->canDeleteEx()) {
         return $msg;
     }
     // suppression des objets des champs sans supprimer les colonnes de la table
     $fields = $this->loadRefsAllFields();
     foreach ($fields as $_field) {
         $_field->_dont_drop_column = true;
         $_field->delete();
     }
     /*$table_name = $this->getTableName();
       $query = "DROP TABLE `$table_name`";
       
       $ds = $this->_spec->ds;
       if (!$ds->query($query)) {
         return "La table '$table_name' n'a pas pu être supprimée (".$ds->error().")";
       }*/
     return parent::delete();
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:23,代码来源:CExClass.class.php

示例11: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $order = $this->loadOrder(false);
     if ($msg = parent::delete()) {
         return $msg;
     }
     if ($order->countBackRefs("order_items") == 0) {
         return $order->delete();
     }
     return null;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:14,代码来源:CProductOrderItem.class.php

示例12: deleteOne

 /**
  * Delete only one
  *
  * @return null|string
  */
 function deleteOne()
 {
     return parent::delete();
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:9,代码来源:CAffectation.class.php

示例13: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField("patient_id1", "patient_id2");
     $patient1 = $this->loadRefPatient1();
     $patient2 = $this->loadRefPatient2();
     if ($msg = parent::delete()) {
         return $msg;
     }
     if (!$patient1->loadPatientLinks()) {
         $patient1->status = $patient1->vip ? "VIP" : "PROV";
         $patient1->store();
     }
     if (!$patient2->loadPatientLinks()) {
         $patient2->status = $patient2->vip ? "VIP" : "PROV";
         $patient2->store();
     }
     return null;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:21,代码来源:CPatientLink.class.php

示例14: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     if ($msg = parent::delete()) {
         return $msg;
     }
     // Remove html content
     $content = $this->loadContentHTML();
     if ($content->_id) {
         if ($msg = $content->delete()) {
             return $msg;
         }
     }
     // Remove plain content
     $content = $this->loadContentPlain();
     if ($content->_id) {
         if ($msg = $content->delete()) {
             return $msg;
         }
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:23,代码来源:CUserMail.class.php

示例15: delete

 /**
  * @see parent::delete()
  */
 function delete()
 {
     $this->completeField("manual");
     //if ($this->manual) {
     /** @var CProductDeliveryTrace[] $traces */
     $traces = $this->loadBackRefs("delivery_traces");
     foreach ($traces as $_trace) {
         $_trace->_code_cis = $this->_code_cis;
         $_trace->_code_cip = $this->_code_cip;
         $_trace->delete();
     }
     //}
     return parent::delete();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:17,代码来源:CProductDelivery.class.php


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