ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $a_value = (bool) $a_value;
29 }
30 $this->value = $a_value;
31 }
32
33 public function getStatus()
34 {
35 return $this->value;
36 }
37
38
39 // comparison
40
41 public function equals(ilADT $a_adt)
42 {
43 if ($this->isComparableTo($a_adt)) {
44 return ($this->getStatus() === $a_adt->getStatus());
45 }
46 }
47
48 public function isLarger(ilADT $a_adt)
49 {
50 // return null?
51 }
52
53 public function isSmaller(ilADT $a_adt)
54 {
55 // return null?
56 }
57
58
59 // null
60
61 public function isNull()
62 {
63 return ($this->getStatus() === null);
64 }
65
66
67 // validation
68
69 public function isValid()
70 {
71 return true;
72 }
73
74
75 // check
76
77 public function getCheckSum()
78 {
79 if (!$this->isNull()) {
80 return (string) $this->getStatus();
81 }
82 }
83}
An exception for terminatinating execution or to throw for unit testing.
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