ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilADTGroupDefinition.php
Go to the documentation of this file.
1 <?php
2 
4 {
5  protected $elements = []; // [array]
6 
7  public function __clone()
8  {
9  if (is_array($this->elements)) {
10  foreach ($this->elements as $id => $element) {
11  $this->elements[$id] = clone $element;
12  }
13  }
14  }
15 
16 
17  // defaults
18 
19  public function reset()
20  {
21  parent::reset();
22 
23  $this->elements = array();
24  }
25 
26 
27  // properties
28 
29  public function addElement($a_name, ilADTDefinition $a_def)
30  {
31  $this->elements[$a_name] = $a_def;
32  }
33 
34  public function hasElement($a_name)
35  {
36  return array_key_exists($a_name, $this->elements);
37  }
38 
39  public function getElement($a_name)
40  {
41  if ($this->hasElement($a_name)) {
42  return $this->elements[$a_name];
43  }
44  }
45 
46  public function getElements()
47  {
48  return $this->elements;
49  }
50 
51 
52  // comparison
53 
54  public function isComparableTo(ilADT $a_adt)
55  {
56  // has to be group-based
57  return ($a_adt instanceof ilADTGroup);
58  }
59 }
if(!array_key_exists('StateId', $_REQUEST)) $id
ADT base class.
Definition: class.ilADT.php:11
addElement($a_name, ilADTDefinition $a_def)
ADT definition base class.