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