ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilOrgUnitOperationContext.php
Go to the documentation of this file.
1<?php
2
24{
25 public const CONTEXT_OBJECT = "object";
26 public const CONTEXT_CRS = "crs";
27 public const CONTEXT_GRP = "grp";
28 public const CONTEXT_IASS = "iass";
29 public const CONTEXT_TST = "tst";
30 public const CONTEXT_EXC = "exc";
31 public const CONTEXT_SVY = "svy";
32 public const CONTEXT_USRF = "usrf";
33 public const CONTEXT_PRG = "prg";
34 public const CONTEXT_ETAL = "etal";
35
39 public static array $available_contexts = [
50 ];
51
52 protected ?int $id = 0;
53 protected string $context = self::CONTEXT_OBJECT;
54 protected int $parent_context_id = 0;
55 protected array $path_names = [self::CONTEXT_OBJECT];
56 protected array $path_ids = [0];
57
58 public function __construct(?int $id = 0)
59 {
60 $this->id = $id;
61 $this->path_ids = [$id];
62 }
63
64 public function getId(): ?int
65 {
66 return $this->id;
67 }
68
69 public function getContext(): string
70 {
71 return $this->context;
72 }
73
74 public function withContext(string $context): self
75 {
76 $clone = clone $this;
77 $clone->context = $context;
78 return $clone;
79 }
80
81 public function getParentContextId(): int
82 {
84 }
85
86 public function withParentContextId(int $parent_context_id): self
87 {
88 $clone = clone $this;
89 $clone->parent_context_id = $parent_context_id;
90 return $clone;
91 }
92
93 public function getPathNames(): array
94 {
95 return $this->path_names;
96 }
97
98 public function withPathNames(array $path_names): self
99 {
100 $clone = clone $this;
101 $clone->path_names = $path_names;
102 return $clone;
103 }
104
105 public function getPathIds(): array
106 {
107 return $this->path_ids;
108 }
109
110 public function withPathIds(array $path_ids): self
111 {
112 $clone = clone $this;
113 $clone->path_ids = $path_ids;
114 return $clone;
115 }
116
121 public function getPopulatedContextNames(): array
122 {
123 return $this->getPathNames();
124 }
125
126
127
132 public function getPopulatedContextIds(): array
133 {
134 return $this->getPathIds();
135 }
136}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...