ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 {
11 foreach($this->elements as $id => $element)
12 {
13 $this->elements[$id] = clone $element;
14 }
15 }
16 }
17
18
19 // defaults
20
21 public function reset()
22 {
23 parent::reset();
24
25 $this->elements = array();
26 }
27
28
29 // properties
30
31 public function addElement($a_name, ilADTDefinition $a_def)
32 {
33 $this->elements[$a_name] = $a_def;
34 }
35
36 public function hasElement($a_name)
37 {
38 return array_key_exists($a_name, $this->elements);
39 }
40
41 public function getElement($a_name)
42 {
43 if($this->hasElement($a_name))
44 {
45 return $this->elements[$a_name];
46 }
47 }
48
49 public function getElements()
50 {
51 return $this->elements;
52 }
53
54
55 // comparison
56
57 public function isComparableTo(ilADT $a_adt)
58 {
59 // has to be group-based
60 return ($a_adt instanceof ilADTGroup);
61 }
62}
63
64?>
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:12