ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilOrgUnitPosition.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 public const CORE_POSITION_EMPLOYEE = 1;
28 public const CORE_POSITION_SUPERIOR = 2;
29
30 protected int $id;
31 protected string $title = "";
32 protected string $description = "";
33 protected bool $core_position = false;
34 protected int $core_identifier = 0;
35
39 protected array $authorities = [];
40
41 public function __construct($id = 0)
42 {
43 $this->id = $id;
44 }
45
46 public function __toString(): string
47 {
48 return $this->getTitle();
49 }
50
51 public function getId(): int
52 {
53 return $this->id;
54 }
55
56 public function getTitle(): string
57 {
58 return $this->title;
59 }
60
61 public function withTitle(string $title): self
62 {
63 $clone = clone $this;
64 $clone->title = $title;
65 return $clone;
66 }
67
68 public function getDescription(): string
69 {
70 return $this->description;
71 }
72
73 public function withDescription(string $description): self
74 {
75 $clone = clone $this;
76 $clone->description = $description;
77 return $clone;
78 }
79
80 public function isCorePosition(): bool
81 {
83 }
84
85 public function withCorePosition(bool $core_position): self
86 {
87 $clone = clone $this;
88 $clone->core_position = $core_position;
89 return $clone;
90 }
91
92 public function getCoreIdentifier(): int
93 {
95 }
96
97 public function withCoreIdentifier(int $core_identifier): self
98 {
99 $clone = clone $this;
100 $clone->core_identifier = $core_identifier;
101 return $clone;
102 }
103
107 public function getAuthorities(): array
108 {
109 return $this->authorities;
110 }
111
112 public function getAuthoritiesAsArray(): array
113 {
114 $return = [];
115 foreach ($this->authorities as $authority) {
116 $return[] = [
117 'id' => $authority->getId(),
118 'over' => $authority->getOver(),
119 'scope' => $authority->getScope(),
120 'position_id' => $authority->getPositionId()
121 ];
122 }
123
124 return $return;
125 }
126
130 public function withAuthorities(array $authorities): self
131 {
132 $clone = clone $this;
133 $clone->authorities = $authorities;
134 return $clone;
135 }
136}
Class ilOrgUnitPosition.
withDescription(string $description)
withCorePosition(bool $core_position)
withCoreIdentifier(int $core_identifier)
withAuthorities(array $authorities)