ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilADTBoolean.php
Go to the documentation of this file.
1<?php
2
3class ilADTBoolean extends ilADT
4{
5 protected $value; // [bool]
6
7
8 // definition
9
10 protected function isValidDefinition(ilADTDefinition $a_def)
11 {
12 return ($a_def instanceof ilADTBooleanDefinition);
13 }
14
15 public function reset()
16 {
17 parent::reset();
18
19 $this->value = null;
20 }
21
22
23 // properties
24
25 public function setStatus($a_value = null)
26 {
27 if($a_value !== null)
28 {
29 $a_value = (bool)$a_value;
30 }
31 $this->value = $a_value;
32 }
33
34 public function getStatus()
35 {
36 return $this->value;
37 }
38
39
40 // comparison
41
42 public function equals(ilADT $a_adt)
43 {
44 if($this->isComparableTo($a_adt))
45 {
46 return ($this->getStatus() === $a_adt->getStatus());
47 }
48 }
49
50 public function isLarger(ilADT $a_adt)
51 {
52 // return null?
53 }
54
55 public function isSmaller(ilADT $a_adt)
56 {
57 // return null?
58 }
59
60
61 // null
62
63 public function isNull()
64 {
65 return ($this->getStatus() === null);
66 }
67
68
69 // validation
70
71 public function isValid()
72 {
73 return true;
74 }
75
76
77 // check
78
79 public function getCheckSum()
80 {
81 if(!$this->isNull())
82 {
83 return (string)$this->getStatus();
84 }
85 }
86}
87
88?>
setStatus($a_value=null)
equals(ilADT $a_adt)
Check if given ADT equals self.
reset()
Init property defaults.
isSmaller(ilADT $a_adt)
Check if given ADT is smaller than self.
isValidDefinition(ilADTDefinition $a_def)
Check if definition is valid for ADT.
isValid()
Is currently valid.
isNull()
Is currently null.
isLarger(ilADT $a_adt)
Check if given ADT is larger than self.
getCheckSum()
Get unique checksum.
ADT definition base class.
ADT base class.
Definition: class.ilADT.php:12