本文整理汇总了PHP中EfrontUser::convertDatabaseResultToUserObjects方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontUser::convertDatabaseResultToUserObjects方法的具体用法?PHP EfrontUser::convertDatabaseResultToUserObjects怎么用?PHP EfrontUser::convertDatabaseResultToUserObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EfrontUser
的用法示例。
在下文中一共展示了EfrontUser::convertDatabaseResultToUserObjects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLessonUsersIncludingUnassigned
/**
* Get lesson users based on the specified constraints, but include unassigned users as well.
* Assigned users have the flag 'has_lesson' set to 1
*
* @param array $constraints The constraints for the query
* @return array An array of EfrontUser objects
* @since 3.6.2
* @access public
*/
public function getLessonUsersIncludingUnassigned($constraints = array())
{
!empty($constraints) or $constraints = array('archive' => false, 'active' => true);
list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
$where[] = "user_type != 'administrator'";
$select = "u.*, r.lessons_ID is not null as has_lesson, r.completed,r.score, r.from_timestamp as active_in_lesson, r.role";
$from = "users u left outer join (select completed,score,lessons_ID,from_timestamp,users_LOGIN,user_type as role from users_to_lessons where lessons_ID='" . $this->lesson['id'] . "' and archive=0) r on u.login=r.users_LOGIN";
if (G_VERSIONTYPE == 'enterprise') {
#cpp#ifdef ENTERPRISE
if (isset($constraints['branch']) && $constraints['branch']) {
$from .= " JOIN module_hcd_employee_works_at_branch ON module_hcd_employee_works_at_branch.users_login = u.login";
}
if (isset($constraints['jobs']) && $constraints['jobs']) {
$from .= " LEFT OUTER JOIN module_hcd_employee_has_job_description ON module_hcd_employee_has_job_description.users_login = u.login JOIN module_hcd_job_description ON module_hcd_job_description.job_description_ID = module_hcd_employee_has_job_description.job_description_ID";
}
}
#cpp#endif
$result = eF_getTableData($from, $select, implode(" and ", $where), $orderby, false, $limit);
if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {
return EfrontUser::convertDatabaseResultToUserObjects($result);
} else {
return EfrontUser::convertDatabaseResultToUserArray($result);
}
}
示例2: getCourseUsersAggregatingResultsIncludingUnassigned
/**
* Get course users based on the specified constraints, but include unassigned users as well. If the course
* has instances, then propagate user status in the mother course
*
* @param array $constraints The constraints for the query
* @return array An array of EfrontUser objects
* @since 3.6.2
* @access public
*/
public function getCourseUsersAggregatingResultsIncludingUnassigned($constraints = array())
{
!empty($constraints) or $constraints = array('archive' => false, 'active' => true);
list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
$from = "users u left outer join\n\t\t\t\t\t(select users_LOGIN,max(score) as score, max(completed) as completed, 1 as has_course from\n\t\t\t\t\t\t(select uc.user_type as role, uc.score,uc.completed,uc.users_LOGIN from courses c left outer join users_to_courses uc on uc.courses_ID=c.id where (c.id=" . $this->course['id'] . " or c.instance_source=" . $this->course['id'] . ") and uc.archive=0) foo\n\t\t\t\t\tgroup by users_LOGIN) r on u.login=r.users_login";
$result = eF_getTableData($from, "u.*, r.*", implode(" and ", $where), $orderby, $groupby, $limit);
if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {
return EfrontUser::convertDatabaseResultToUserObjects($result);
} else {
return EfrontUser::convertDatabaseResultToUserArray($result);
}
}
示例3: getGroupUsersIncludingUnassigned
/**
* Get group users based on the specified constraints, but include unassigned users as well.
* Assigned users have the flag 'has_group' set to 1
*
* @param array $constraints The constraints for the query
* @return array An array of EfrontUser objects or user arrays
* @since 3.6.2
* @access public
*/
public function getGroupUsersIncludingUnassigned($constraints = array())
{
!empty($constraints) or $constraints = array('archive' => false, 'active' => true);
list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
$result = eF_getTableData("users u left outer join users_to_groups ug on ug.users_LOGIN=u.login and ug.groups_ID=" . $this->group['id'], "u.login,u.active,u.user_type,u.user_types_ID,u.name,u.surname,u.email, ug.groups_ID is not null as has_group", implode(" and ", $where), $orderby, "", $limit);
if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {
return EfrontUser::convertDatabaseResultToUserObjects($result);
} else {
return $result;
}
}