ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilOrgUnitPermission.php
Go to the documentation of this file.
1<?php
2
24{
25 public const PARENT_TEMPLATE = -1;
26 public const TABLE_NAME = 'il_orgu_permissions';
27
28 protected int $id = 0;
30 protected int $context_id = 0;
31 protected int $position_id = 0;
32 protected bool $protected = false;
36 protected array $operations = [];
37
41 protected array $possible_operations = [];
45 protected array $selected_operation_ids = [];
47
48 public function __construct($id = 0)
49 {
50 $this->id = $id;
51 }
52
53 public function getId(): ?int
54 {
55 return $this->id;
56 }
57
58 public function getParentId(): int
59 {
60 return $this->parent_id;
61 }
62
63 public function withParentId(int $parent_id): self
64 {
65 $clone = clone $this;
66 $clone->parent_id = $parent_id;
67 return $clone;
68 }
69
70 public function getContextId(): int
71 {
72 return $this->context_id;
73 }
74
75 public function withContextId(int $context_id): self
76 {
77 $clone = clone $this;
78 $clone->context_id = $context_id;
79 return $clone;
80 }
81
82 public function getPositionId(): int
83 {
84 return $this->position_id;
85 }
86
87 public function withPositionId(int $position_id): self
88 {
89 $clone = clone $this;
90 $clone->position_id = $position_id;
91 return $clone;
92 }
93
97 public function getOperations(): array
98 {
99 return $this->operations;
100 }
101
102 public function withOperations(array $operations): self
103 {
104 $clone = clone $this;
105 $clone->operations = $operations;
106 return $clone;
107 }
108
109 public function getPossibleOperations(): array
110 {
112 }
113
114 public function withPossibleOperations(array $possible_operations): self
115 {
116 $clone = clone $this;
117 $clone->possible_operations = $possible_operations;
118 return $clone;
119 }
120
121 public function getSelectedOperationIds(): array
122 {
124 }
125
127 {
128 $clone = clone $this;
129 $clone->selected_operation_ids = $selected_operation_ids;
130 return $clone;
131 }
132
133 public function isOperationIdSelected(int $operation_id): bool
134 {
135 return in_array($operation_id, $this->selected_operation_ids);
136 }
137
139 {
140 return $this->context;
141 }
142
144 {
145 $clone = clone $this;
146 $clone->context = $context;
147 return $clone;
148 }
149
150 public function isProtected(): bool
151 {
152 return $this->protected;
153 }
154
155 public function withProtected(bool $protected): self
156 {
157 $clone = clone $this;
158 $clone->protected = $protected;
159 return $clone;
160 }
161
162 public function isTemplate(): bool
163 {
164 return ($this->getParentId() === self::PARENT_TEMPLATE);
165 }
166}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
withOperations(array $operations)
withPositionId(int $position_id)
withPossibleOperations(array $possible_operations)
withSelectedOperationIds(array $selected_operation_ids)
ilOrgUnitOperationContext $context
isOperationIdSelected(int $operation_id)
withContext(ilOrgUnitOperationContext $context)