ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTGroupDefinition.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected array $elements = [];
24
25 public function __clone()
26 {
27 if (is_array($this->elements)) {
28 foreach ($this->elements as $id => $element) {
29 $this->elements[$id] = clone $element;
30 }
31 }
32 }
33
34 // defaults
35
36 public function reset(): void
37 {
38 parent::reset();
39 $this->elements = array();
40 }
41
42 // properties
43
44 public function addElement($a_name, ilADTDefinition $a_def): void
45 {
46 $this->elements[$a_name] = $a_def;
47 }
48
49 public function hasElement($a_name): bool
50 {
51 return array_key_exists($a_name, $this->elements);
52 }
53
54 public function getElement(string $a_name): ?ilADTDefinition
55 {
56 if ($this->hasElement($a_name)) {
57 return $this->elements[$a_name];
58 }
59 return null;
60 }
61
62 public function getElements(): array
63 {
64 return $this->elements;
65 }
66
67 // comparison
68
69 public function isComparableTo(ilADT $a_adt): bool
70 {
71 // has to be group-based
72 return ($a_adt instanceof ilADTGroup);
73 }
74}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
ADT definition base class.
addElement($a_name, ilADTDefinition $a_def)
reset()
Init property defaults.
isComparableTo(ilADT $a_adt)
Check if given ADT is comparable to self.
ADT base class.
Definition: class.ilADT.php:26