ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPRGUserInformation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public const MANDATORY_FIELDS = [
27 'firstname',
28 'lastname',
29 'login',
30 'active',
31 'email',
32 'gender',
33 'title',
34 'org_units',
35 ];
36
37 public function __construct(
38 protected array $user_data
39 ) {
40 }
41
42 public function getAvailableUserFields(): array
43 {
44 return array_keys($this->user_data);
45 }
46
47 public function getUserData(string $field)
48 {
49 return $this->user_data[$field];
50 }
51
52 public function getFirstname(): string
53 {
54 return $this->user_data['firstname'];
55 }
56 public function getLastname(): string
57 {
58 return $this->user_data['lastname'];
59 }
60 public function isActive(): bool
61 {
62 return (bool)$this->user_data['active'];
63 }
64 public function getEmail(): string
65 {
66 return $this->user_data['email'];
67 }
68 public function getLogin(): string
69 {
70 return $this->user_data['login'];
71 }
72 public function getOrguRepresentation(): string
73 {
74 return $this->user_data['org_units'];
75 }
76 public function getFullname(): string
77 {
78 return $this->user_data['lastname'] . ', ' . $this->user_data['firstname'];
79 }
80 public function getGender(): string
81 {
82 return $this->user_data['gender'];
83 }
84 public function getTitle(): string
85 {
86 return $this->user_data['title'];
87 }
88}
Additional information about a user, used in context of assignments.
__construct(protected array $user_data)