本文整理汇总了PHP中CMbArray::insertAfterKey方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbArray::insertAfterKey方法的具体用法?PHP CMbArray::insertAfterKey怎么用?PHP CMbArray::insertAfterKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbArray
的用法示例。
在下文中一共展示了CMbArray::insertAfterKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInsertAfterKey
public function testInsertAfterKey()
{
$array = array("key" => "val", "key2" => "val2");
$this->stub->insertAfterKey($array, "key", "newKey", "newValue");
$this->assertArrayHasKey("newKey", $array);
$this->assertEquals($array["newKey"], "newValue");
}
示例2: initParams
/**
* Intialize params
*
* @return void
*/
static function initParams()
{
if (CAppUi::conf('ref_pays') == 2) {
self::$list_constantes['saturation_air'] = array('type' => 'physio', 'unit' => '%', 'min' => 50, 'max' => 100);
}
// make a copy of the array as it will be modified
$list_constantes = CConstantesMedicales::$list_constantes;
foreach ($list_constantes as $_constant => &$_params) {
self::$list_constantes_type[$_params["type"]][$_constant] =& $_params;
// Champs de cumuls
if (isset($_params["cumul_reset_config"])) {
if (!isset(CConstantesMedicales::$list_constantes[$_constant]["cumul_in"])) {
CConstantesMedicales::$list_constantes[$_constant]["cumul_in"] = array();
}
if (empty($_params["formula"])) {
CMbArray::insertAfterKey(CConstantesMedicales::$list_constantes, $_constant, "_{$_constant}_cumul", array("cumul_for" => $_constant, "unit" => $_params["unit"]));
CConstantesMedicales::$list_constantes[$_constant]["cumul_in"][] = "_{$_constant}_cumul";
} else {
foreach ($_params["formula"] as $_const => $_sign) {
CConstantesMedicales::$list_constantes[$_const]["cumul_in"][] = $_constant;
}
}
}
}
}
示例3: 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;
}