本文整理汇总了PHP中CFunctions::loadMatchingObjectEsc方法的典型用法代码示例。如果您正苦于以下问题:PHP CFunctions::loadMatchingObjectEsc方法的具体用法?PHP CFunctions::loadMatchingObjectEsc怎么用?PHP CFunctions::loadMatchingObjectEsc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunctions
的用法示例。
在下文中一共展示了CFunctions::loadMatchingObjectEsc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getImportFunction
/**
* Get import function
*
* @return CFunctions
*/
function getImportFunction()
{
static $function;
if ($function) {
return $function;
}
$function_name = CAppUI::conf($this->_import_function_name_conf);
$function = new CFunctions();
$function->text = $function_name;
$function->loadMatchingObjectEsc();
if (!$function->_id) {
$function->group_id = CGroups::loadCurrent()->_id;
$function->type = "cabinet";
$function->compta_partagee = 0;
$function->color = "#CCCCCC";
if ($msg = $function->store()) {
CAppUI::setMsg($msg, UI_MSG_WARNING);
}
}
return $function;
}
示例2: createDoctor
/**
* Create the mediuser
*
* @param CMediusers $mediuser mediuser
*
* @return int
*/
function createDoctor(CMediusers $mediuser)
{
$sender = $this->_ref_sender;
$function = new CFunctions();
$function->text = CAppUI::conf("hl7 importFunctionName");
$function->group_id = $sender->group_id;
$function->loadMatchingObjectEsc();
if (!$function->_id) {
$function->type = "cabinet";
$function->compta_partagee = 0;
$function->color = "ffffff";
$function->store();
}
$mediuser->function_id = $function->_id;
$mediuser->makeUsernamePassword($mediuser->_user_first_name, $mediuser->_user_last_name, null, true);
$mediuser->_user_type = 13;
// Medecin
$mediuser->actif = CAppUI::conf("hl7 doctorActif") ? 1 : 0;
$user = new CUser();
$user->user_last_name = $mediuser->_user_last_name;
$user->user_first_name = $mediuser->_user_first_name;
// On recherche par le seek
$users = $user->seek("{$user->user_last_name} {$user->user_first_name}");
if (count($users) == 1) {
$user = reset($users);
$user->loadRefMediuser();
$mediuser = $user->_ref_mediuser;
} else {
// Dernière recherche si le login est déjà existant
$user = new CUser();
$user->user_username = $mediuser->_user_username;
if ($user->loadMatchingObject()) {
// On affecte un username aléatoire
$mediuser->_user_username .= rand(1, 10);
}
$mediuser->store();
}
return $mediuser->_id;
}