54 $this->with_superiors =
true;
65 $this->with_positions =
true;
80 if ($this->with_superiors ===
true) {
84 if ($this->with_positions ===
true) {
85 $this->loadPositions($arr_user_id);
101 if (count($this->orgu_users) == 0) {
105 if ($this->with_superiors ===
true) {
109 return $this->orgu_users[0];
122 $empl_id_sup_ids = [];
123 while (
$data = $DIC->database()->fetchAssoc($st)) {
126 $org_unit_user->addSuperior($superior);
143 while (
$data = $DIC->database()->fetchAssoc($st)) {
144 $arr_email_sup[] =
$data[
'sup_email'];
147 return $arr_email_sup;
161 orgu_ua.orgu_id AS orgu_id, 162 orgu_ua.user_id AS empl_usr_id, 163 orgu_ua2.user_id as sup_usr_id, 164 superior.email as sup_email, 165 superior.second_email as sup_second_email, 166 superior.login as sup_login 168 il_orgu_ua as orgu_ua, 169 il_orgu_ua as orgu_ua2 170 inner join usr_data as superior on superior.usr_id = orgu_ua2.user_id 172 orgu_ua.orgu_id = orgu_ua2.orgu_id 173 and orgu_ua.user_id <> orgu_ua2.user_id 176 AND " . $DIC->database()->in(
'orgu_ua.user_id', $user_ids,
false,
'integer');
187 public function loadPositions(array $user_ids) : array
195 if (count($assignments) > 0) {
196 foreach ($assignments as $assignment) {
198 $org_unit_user->addPositions(ilOrgUnitPosition::find($assignment->getPositionId()));
215 $q =
"SELECT * FROM usr_data WHERE " . $this->dic->database()->in(
'usr_id', $user_ids,
false,
'int');
217 $set = $this->dic->database()->query($q);
219 while ($row = $this->dic->database()->fetchAssoc($set)) {
220 $users[] =
ilOrgUnitUser::getInstance($row[
'usr_id'], (
string)$row[
'login'], (
string)$row[
'email'], (
string)$row[
'second_email']);
static getInstanceById(int $user_id)
Class ilOrgUnitUserRepository.
loadUsersByUserIds(array $user_ids)
__construct()
ilOrgUnitUserRepository constructor.
const CORE_POSITION_EMPLOYEE
getOrgUnitUser(int $user_id)
loadSuperiors(array $user_ids)
static where($where, $operator=null)
static getInstance(int $user_id, string $login, string $email, string $second_email)
getOrgUnitUsers(array $arr_user_id)
getSuperiorsSql(array $user_ids)
const CORE_POSITION_SUPERIOR
getEmailAdressesOfSuperiors(array $user_ids)