本文整理汇总了PHP中UserListFactory::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP UserListFactory::getByID方法的具体用法?PHP UserListFactory::getByID怎么用?PHP UserListFactory::getByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserListFactory
的用法示例。
在下文中一共展示了UserListFactory::getByID方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Invalid User'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例2: setIncludeUser
function setIncludeUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($this->Validator->isResultSetWithRows('include_user', $ulf->getByID($id), TTi18n::gettext('Selected User is invalid'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例3: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($id != 0 and $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Selected Employee is invalid')) and $this->Validator->isTrue('user', $this->isUniqueUser($id), TTi18n::gettext('Selected Employee is already assigned to another Permission Group'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例4: BranchListFactory
$utlf->getByCompanyId($current_company->getId());
$title_options = $utlf->getArrayByListFactory($utlf, FALSE, TRUE);
$blf = new BranchListFactory();
$blf->getByCompanyId($current_company->getId());
$branch_options = $blf->getArrayByListFactory($blf, FALSE, TRUE);
$dlf = new DepartmentListFactory();
$dlf->getByCompanyId($current_company->getId());
$department_options = $dlf->getArrayByListFactory($dlf, FALSE, TRUE);
$uglf = new UserGroupListFactory();
$group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'TEXT', TRUE));
$rstclf = new RecurringScheduleTemplateControlListFactory();
$template_options = $rstclf->getByCompanyIdArray($current_company->getId(), FALSE, TRUE);
foreach ($rsclf as $rsc_obj) {
$user_id = $rsc_obj->getColumn('user_id');
$ulf = new UserListFactory();
$ulf->getByID($user_id);
if ($ulf->getRecordCount() == 1) {
$u_obj = $ulf->getCurrent();
} else {
//Skip this row.
Debug::Text('Skipping Row: User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
continue;
}
$rows[] = array('id' => $rsc_obj->getId(), 'user_id' => $user_id, 'name' => $rsc_obj->getColumn('name'), 'description' => $rsc_obj->getColumn('description'), 'start_week' => $rsc_obj->getStartWeek(), 'start_date' => $rsc_obj->getStartDate(), 'end_date' => $rsc_obj->getEndDate(), 'first_name' => $u_obj->getFirstName(), 'middle_name' => $u_obj->getMiddleName(), 'last_name' => $u_obj->getLastName(), 'user_full_name' => $u_obj->getFullName(TRUE), 'is_owner' => $permission->isOwner($u_obj->getCreatedBy(), $u_obj->getId()), 'is_child' => $permission->isChild($u_obj->getId(), $permission_children_ids), 'deleted' => $rsc_obj->getDeleted());
}
$all_array_option = array('-1' => TTi18n::gettext('-- Any --'));
$ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
$filter_data['user_options'] = Misc::prependArray($all_array_option, UserListFactory::getArrayByListFactory($ulf, FALSE, TRUE));
//Select box options;
$filter_data['template_options'] = Misc::prependArray($all_array_option, $template_options);
$filter_data['branch_options'] = Misc::prependArray($all_array_option, $branch_options);
示例5: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
$hllf = new HierarchyLevelListFactory();
if ($id != 0 and $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Selected Employee is invalid')) and $this->Validator->isNotResultSetWithRows('user', $hllf->getByHierarchyControlIdAndUserId($this->getHierarchyControl(), $id), TTi18n::gettext('Selected employee is assigned as both a superior and subordinate')) and $this->Validator->isTrue('user', $this->isUniqueUser($id), TTi18n::gettext('Selected Employee is already assigned to another hierarchy'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例6: setSupportContact
function setSupportContact($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if (!empty($id) and $this->Validator->isResultSetWithRows('support_contact', $ulf->getByID($id), TTi18n::gettext('Contact User is invalid'))) {
$this->data['support_contact'] = $id;
return TRUE;
}
return FALSE;
}
示例7: setStatusBy
function setStatusBy($id = NULL)
{
$id = trim($id);
if (empty($id)) {
global $current_user;
if (is_object($current_user)) {
$id = $current_user->getID();
} else {
return FALSE;
}
}
$ulf = new UserListFactory();
if ($this->Validator->isResultSetWithRows('created_by', $ulf->getByID($id), TTi18n::gettext('Incorrect User'))) {
$this->data['status_by'] = $id;
return TRUE;
}
return FALSE;
}
示例8: setObject
function setObject($user_id)
{
if (!empty($user_id)) {
$ulf = new UserListFactory();
$ulf->getByID($user_id);
foreach ($ulf as $user) {
$this->obj = $user;
return TRUE;
}
}
return FALSE;
}
示例9: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
$hulf = new HierarchyUserListFactory();
if ($this->getHierarchyControl() == FALSE) {
return FALSE;
}
//Get user object so we can get the users full name to display as an error message.
$ulf->getById($id);
if ($id == 0 or $ulf->getRecordCount() > 0 and $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Invalid Employee')) and $this->Validator->isNotResultSetWithRows('user', $hulf->getByHierarchyControlAndUserId($this->getHierarchyControl(), $id), TTi18n::gettext($ulf->getCurrent()->getFullName() . ' is assigned as both a superior and subordinate'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例10: setUser
function setUser($id)
{
$id = trim($id);
//Allow NULL ids.
if ($id == '' or $id == NULL) {
$id = 0;
}
$ulf = new UserListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('User is invalid'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}