42 private function __construct(
int $user_id,
string $login,
string $email,
string $second_email)
55 if (
null === static::$instances[$user_id]) {
57 $orgUnitUser = $org_unit_user_repository->getOrgUnitUser($user_id);
58 if ($orgUnitUser ===
null) {
59 throw new Exception(
'no OrgUnitUser found with user_id ' . $user_id);
62 static::$instances[
$user_id] = $org_unit_user_repository->getOrgUnitUser($user_id);
68 public static function getInstance(
int $user_id,
string $login,
string $email,
string $second_email): self
70 if (!isset(static::$instances) ||
71 !array_key_exists($user_id, static::$instances) ||
72 is_null(static::$instances[$user_id])
83 $this->superiors[] = $org_unit_user;
88 $this->org_unit_positions[] = $org_unit_position;
97 if (count($this->superiors) === 0) {
107 $org_unit_user_repository->loadSuperiors([$this->user_id]);
116 if (count($this->org_unit_positions) == 0) {
130 $org_unit_user_repository->loadPositions([$this->user_id]);
__construct(int $user_id, string $login, string $email, string $second_email)
static getInstanceById(int $user_id)
Class ilOrgUnitUserRepository.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $org_unit_positions
login()
description: > Example for rendring a login glyph.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstance(int $user_id, string $login, string $email, string $second_email)
addPositions(\ilOrgUnitPosition $org_unit_position)
setSecondEmail(string $second_email)
addSuperior(ilOrgUnitUser $org_unit_user)