本文整理汇总了PHP中CMbArray::ksortByArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbArray::ksortByArray方法的具体用法?PHP CMbArray::ksortByArray怎么用?PHP CMbArray::ksortByArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbArray
的用法示例。
在下文中一共展示了CMbArray::ksortByArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testKsortByArray
public function testKsortByArray()
{
$array = array("key1" => "val1", "key2" => "val2", "key3" => "val3");
$order = array("key3", "key1", "key2");
$res = array("key3" => "val3", "key1" => "val1", "key2" => "val2");
$this->assertEquals($res, $this->stub->ksortByArray($array, $order));
}
示例2: foreach
if ($_prescription->_ref_lines_elt_for_plan) {
foreach ($_prescription->_ref_lines_elt_for_plan as $_elements_by_chap) {
foreach ($_elements_by_chap as $elements_cat) {
foreach ($elements_cat as $_element) {
$nb_lines_element += count($_element);
}
}
}
}
$bed = $_prescription->_ref_object->_ref_curr_affectation->_ref_lit;
$bedroom_name = $bed->_ref_chambre->nom . $bed->nom . $_prescription->_ref_object->_ref_curr_affectation->_id;
$prescriptions_order[$bedroom_name] = $key;
}
// Tri par numéro de chambre
ksort($prescriptions_order);
$prescriptions = CMbArray::ksortByArray($prescriptions, $prescriptions_order);
// Chargement des categories pour chaque chapitre
$categories = CCategoryPrescription::loadCategoriesByChap();
$smarty = new CSmartyDP();
$smarty->assign("lines", $lines);
$smarty->assign("patients", $patients);
$smarty->assign("tabHours", $tabHours);
$smarty->assign("prescriptions", $prescriptions);
$smarty->assign("categories", $categories);
$smarty->assign("tabHours", $tabHours);
$smarty->assign("composition_dossier", $composition_dossier);
$smarty->assign("bornes_composition_dossier", $bornes_composition_dossier);
$smarty->assign("count_composition_dossier", $count_composition_dossier);
$smarty->assign("operations", array());
$smarty->assign("nb_decalage", $nb_decalage);
$smarty->assign("mode_dossier", $mode_dossier);