本文整理汇总了PHP中CUser::seek方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::seek方法的具体用法?PHP CUser::seek怎么用?PHP CUser::seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::seek方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: createPraticien
/**
* Création du praticien
*
* @param CMediusers $mediuser Mediuser
*
* @return int
*/
function createPraticien(CMediusers $mediuser)
{
$sender = $this->_ref_echange_hprim->_ref_sender;
$functions = new CFunctions();
$functions->text = CAppUI::conf("hprimxml functionPratImport");
$functions->group_id = $sender->group_id;
$functions->loadMatchingObject();
if (!$functions->loadMatchingObject()) {
$functions->type = "cabinet";
$functions->compta_partagee = 0;
$functions->store();
}
$mediuser->function_id = $functions->_id;
$mediuser->makeUsernamePassword($mediuser->_user_first_name, $mediuser->_user_last_name, null, true);
$user_type = CAppUI::conf("hprimxml user_type");
$mediuser->_user_type = $user_type ? $user_type : 13;
// Medecin
$mediuser->actif = CAppUI::conf("hprimxml medecinActif") ? 1 : 0;
$user = new CUser();
$user->user_last_name = $mediuser->_user_last_name;
$user->user_first_name = $mediuser->_user_first_name;
$listPrat = $user->seek("{$user->user_last_name} {$user->user_first_name}");
if (count($listPrat) == 1) {
$user = reset($listPrat);
$user->loadRefMediuser();
$mediuser = $user->_ref_mediuser;
} else {
$mediuser->store();
}
return $mediuser->_id;
}