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


PHP CMbArray::mergeKeys方法代码示例

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


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

示例1: getSiblings

 /**
  * Finds patient siblings with at least two exact matching traits out of
  * nom, prenom, naissance
  * Optimized version with split queries for index usage forcing
  *
  * @return CPatient[] Array of siblings
  */
 function getSiblings()
 {
     $ds =& $this->_spec->ds;
     $where = array("nom" => $ds->prepareLikeName($this->nom), "prenom" => $ds->prepareLikeName($this->prenom), "patient_id" => "!= '{$this->_id}'");
     if (CAppUI::conf('dPpatients CPatient function_distinct')) {
         $function_id = CMediusers::get()->function_id;
         $where["function_id"] = "= '{$function_id}'";
     }
     $siblings = $this->loadList($where);
     if ($this->naissance !== "0000-00-00") {
         $where = array("nom" => $ds->prepareLikeName($this->nom), "naissance" => $ds->prepare(" = %", $this->naissance), "patient_id" => "!= '{$this->_id}'");
         if (CAppUI::conf('dPpatients CPatient function_distinct')) {
             $function_id = CMediusers::get()->function_id;
             $where["function_id"] = "= '{$function_id}'";
         }
         $siblings = CMbArray::mergeKeys($siblings, $this->loadList($where, null, null, "patients.patient_id"));
         $where = array("prenom" => $ds->prepareLikeName($this->prenom), "naissance" => $ds->prepare(" = %", $this->naissance), "patient_id" => "!= '{$this->_id}'");
         if (CAppUI::conf('dPpatients CPatient function_distinct')) {
             $function_id = CMediusers::get()->function_id;
             $where["function_id"] = "= '{$function_id}'";
         }
         $siblings = CMbArray::mergeKeys($siblings, $this->loadList($where, null, null, "patients.patient_id"));
     }
     return $siblings;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:32,代码来源:CPatient.class.php

示例2: loadRefsFiles

 /**
  * @see parent::loadRefsFiles()
  */
 function loadRefsFiles()
 {
     parent::loadRefsFiles();
     if (!$this->_docitems_from_dossier_anesth) {
         // On ajoute les fichiers des dossiers d'anesthésie
         if (!$this->_refs_dossiers_anesth) {
             $this->loadRefConsultAnesth();
         }
         foreach ($this->_refs_dossiers_anesth as $_dossier_anesth) {
             $_dossier_anesth->_docitems_from_consult = true;
             $_dossier_anesth->loadRefsFiles();
             $this->_ref_files = CMbArray::mergeKeys($this->_ref_files, $_dossier_anesth->_ref_files);
         }
     }
     return count($this->_ref_files);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:19,代码来源:CConsultation.class.php

示例3: testMergeKeys

 public function testMergeKeys()
 {
     $this->assertNotEmpty($this->stub->mergeKeys(array(1), array(1)));
     $this->assertEquals(array(1 => 1, 2 => 1), $this->stub->mergeKeys(array(1 => 1), array(2 => 1)));
     $this->assertEquals(array(1 => 1, 2 => 1, 3 => 1), $this->stub->mergeKeys(array(1 => 1), array(2 => 1), array(3 => 1)));
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:6,代码来源:CMbArrayTest.php

示例4: store


//.........这里部分代码省略.........
             $besoin = new CBesoinRessource();
             $besoin->type_ressource_id = $_type_ressource_id;
             $besoin->operation_id = $this->_id;
             if ($msg = $besoin->store()) {
                 return $msg;
             }
         }
     }
     $this->createAlert($comments);
     // Mise à jour du type de PeC du séjour en Chirurgical si pas déja obstétrique
     $sejour->completeField("type_pec");
     if (!$this->_id && $sejour->type_pec != "O") {
         $sejour->type_pec = "C";
         $do_store_sejour = true;
     }
     // Cas d'une annulation
     if (!$this->annulee) {
         // Si pas une annulation on recupére le sejour
         // et on regarde s'il n'est pas annulé
         if ($sejour->annule) {
             $sejour->annule = 0;
             $do_store_sejour = true;
         }
         // Application des protocoles de prescription en fonction de l'operation->_id
         if ($this->_protocole_prescription_chir_id || $this->_protocole_prescription_anesth_id) {
             $sejour->_protocole_prescription_chir_id = $this->_protocole_prescription_chir_id;
             $sejour->_protocole_prescription_anesth_id = $this->_protocole_prescription_anesth_id;
             $sejour->applyProtocolesPrescription($this->_id);
             // On les nullify pour eviter de les appliquer 2 fois
             $this->_protocole_prescription_anesth_id = null;
             $this->_protocole_prescription_chir_id = null;
             $sejour->_protocole_prescription_chir_id = null;
             $sejour->_protocole_prescription_anesth_id = null;
         }
     } elseif ($this->rank != 0 && !CAppUI::conf("dPplanningOp COperation save_rank_annulee_validee")) {
         $this->rank = 0;
         $this->time_operation = "00:00:00";
     }
     // Store du séjour (une seule fois)
     if ($do_store_sejour) {
         $sejour->store();
     }
     // Vérification qu'on a pas des actes CCAM codés obsolètes
     if ($this->codes_ccam) {
         $this->loadRefsActesCCAM();
         foreach ($this->_ref_actes_ccam as $keyActe => $acte) {
             if (stripos($this->codes_ccam, $acte->code_acte) === false) {
                 $this->_ref_actes_ccam[$keyActe]->delete();
             }
         }
     }
     $reorder_rank_voulu = $this->_reorder_rank_voulu;
     $this->_reorder_rank_voulu = null;
     if ($this->plageop_id) {
         $plage = $this->loadRefPlageOp();
         // Cas de la création dans une plage de spécialité
         if ($plage->spec_id && $plage->unique_chir) {
             $plage->chir_id = $this->chir_id;
             $plage->spec_id = "";
             $plage->store();
         }
         // Placement de l'interv selon la preference (placement souhaité)
         if ($place_after_interv_id) {
             $plage->loadRefsOperations(false, "rank, rank_voulu, horaire_voulu", true);
             unset($plage->_ref_operations[$this->_id]);
             if ($place_after_interv_id == -1) {
                 $reorder = true;
                 $reorder_rank_voulu = true;
                 $plage->_ref_operations = CMbArray::mergeKeys(array($this->_id => $this), $plage->_ref_operations);
                 // To preserve keys (array_unshift does not)
             } elseif (isset($plage->_ref_operations[$place_after_interv_id])) {
                 $reorder = true;
                 $reorder_rank_voulu = true;
                 CMbArray::insertAfterKey($plage->_ref_operations, $place_after_interv_id, $this->_id, $this);
             }
             if ($reorder_rank_voulu) {
                 $plage->_reorder_up_to_interv_id = $this->_id;
             }
         }
     }
     // Gestion du tarif et precodage des actes
     if ($this->_bind_tarif && $this->_id) {
         if ($msg = $this->bindTarif()) {
             return $msg;
         }
     }
     // Standard storage bis
     if ($msg = parent::store()) {
         return $msg;
     }
     // Réordonnancement post-store
     if ($reorder) {
         // Réordonner la plage que l'on quitte
         if ($old_plage) {
             $old_plage->reorderOp();
         }
         $this->_ref_plageop->reorderOp($reorder_rank_voulu ? CPlageOp::RANK_REORDER : null);
     }
     return null;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:COperation.class.php

示例5: loadRefsOperations

 /**
  * Chargement des interventions
  *
  * @param bool   $annulee   Prise en compte des interventions annulées
  * @param string $order     Paramètre ORDER SQL
  * @param bool   $sorted    Utilisation du paramètre ORDER SQL passé en paramètre
  * @param null   $validated Uniquement les validées
  * @param array  $where     Tableau de paramètres WHERE SQL
  *
  * @return COperation[]
  */
 function loadRefsOperations($annulee = true, $order = "rank, time_operation, rank_voulu, horaire_voulu", $sorted = false, $validated = null, $where = array())
 {
     $where += array("plageop_id" => "= '{$this->plageop_id}'");
     if (!$annulee) {
         $where["annulee"] = "= '0'";
     }
     /** @var COperation[] $operations */
     $operations = array();
     $op = new COperation();
     if (!$sorted) {
         $operations = $op->loadList($where, $order);
     } else {
         $order = "rank, rank_voulu, horaire_voulu";
         if ($validated === null || $validated === true) {
             $where["rank"] = "> 0";
             $operations = CMbArray::mergeKeys($operations, $op->loadList($where, $order));
         }
         if ($validated === null || $validated === false) {
             // Sans rank
             $where["rank"] = "= 0";
             $where["rank_voulu"] = "> 0";
             $operations = CMbArray::mergeKeys($operations, $op->loadList($where, $order));
             // Sans rank voulu
             $where["rank_voulu"] = "= 0";
             $where["horaire_voulu"] = "IS NOT NULL";
             $operations = CMbArray::mergeKeys($operations, $op->loadList($where, $order));
             $where["horaire_voulu"] = "IS NULL";
             $operations = CMbArray::mergeKeys($operations, $op->loadList($where, $order));
         }
     }
     foreach ($operations as $_operation) {
         $_operation->_ref_plageop = $this;
         if ($_operation->temp_operation) {
             $this->_cumulative_minutes = $this->_cumulative_minutes + CMbDT::minutesRelative("00:00:00", $_operation->temp_operation);
         }
     }
     return $this->_ref_operations = $operations;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:49,代码来源:CPlageOp.class.php


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