本文整理汇总了PHP中CFunctions::loadBackRefs方法的典型用法代码示例。如果您正苦于以下问题:PHP CFunctions::loadBackRefs方法的具体用法?PHP CFunctions::loadBackRefs怎么用?PHP CFunctions::loadBackRefs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunctions
的用法示例。
在下文中一共展示了CFunctions::loadBackRefs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CFunctions
$function = new CFunctions();
$functions = array();
$praticiens = array();
// Aucun filtre de séléctionné : tous les éléments auxquels on a le droit
if (!$filter->_specialite && !$filter->_prat_id) {
if (!$user->isFromType(array("Anesthésiste")) && !$praticien->isFromType(array("Anesthésiste"))) {
$functions = $function->loadListWithPerms(PERM_READ);
$praticiens = $user->loadPraticiens();
} else {
$functions = $function->loadList();
$praticiens = $praticien->loadList();
}
} elseif ($filter->_specialite) {
// Filtre sur la specialité : la spec et ses chirs primaires et secondaires
$function->load($filter->_specialite);
$function->loadBackRefs("users");
$function->loadBackRefs("secondary_functions");
$functions[$function->_id] = $function;
$praticiens = $function->_back["users"];
/** @var CSecondaryFunction $sec_func */
foreach ($function->_back["secondary_functions"] as $sec_func) {
if (!isset($praticiens[$sec_func->user_id])) {
$sec_func->loadRefUser();
$praticiens[$sec_func->user_id] = $sec_func->_ref_user;
}
}
} elseif ($filter->_prat_id) {
// Filtre sur le chir : le chir et ses specs primaires et secondaires
$praticien->loadRefFunction();
$praticien->loadBackRefs("secondary_functions");
$praticiens[$praticien->_id] = $praticien;
示例2: intval
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:\$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
$function_id = CValue::getOrSession("function_id");
$page_function = intval(CValue::get('page_function', 0));
$step_sec_function = 25;
$primary_users = array();
$total_sec_functions = null;
$function = new CFunctions();
$function->load($function_id);
$total_sec_functions = $function->countBackRefs("users");
/** @var CMediusers[] $primary_users */
$primary_users = $function->loadBackRefs("users", null, "{$page_function}, {$step_sec_function}");
CStoredObject::massLoadFwdRef($primary_users, "_profile_id");
foreach ($primary_users as $_mediuser) {
$_mediuser->loadRefProfile();
}
/** @var CSecondaryFunction[] $secondaries_functions */
$secondaries_functions = $function->loadBackRefs("secondary_functions");
$users = CMbObject::massLoadFwdRef($secondaries_functions, "user_id");
CStoredObject::massLoadFwdRef($users, "_profile_id");
foreach ($secondaries_functions as $_sec_function) {
$_sec_function->loadRefUser();
$_sec_function->_ref_user->loadRefProfile();
}
$smarty = new CSmartyDP();
$smarty->assign("function", $function);
$smarty->assign("primary_users", $primary_users);