ILIAS
Release_5_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilADTEnum.php
Go to the documentation of this file.
1
<?php
2
3
abstract
class
ilADTEnum
extends
ilADT
4
{
5
protected
$value
;
// [string]
6
7
8
// definition
9
10
protected
function
isValidDefinition
(
ilADTDefinition
$a_def)
11
{
12
return
($a_def instanceof
ilADTEnumDefinition
);
13
}
14
15
public
function
reset
()
16
{
17
parent::reset
();
18
19
$this->value = null;
20
}
21
22
23
// properties
24
25
abstract
protected
function
handleSelectionValue
($a_value);
26
27
public
function
setSelection
($a_value = null)
28
{
29
if
($a_value !== null)
30
{
31
$a_value = $this->
handleSelectionValue
($a_value);
32
if
(!$this->
isValidOption
($a_value))
33
{
34
$a_value = null;
35
}
36
}
37
$this->value = $a_value;
38
}
39
40
public
function
getSelection
()
41
{
42
return
$this->value
;
43
}
44
45
public
function
isValidOption
($a_value)
46
{
47
$a_value = $this->
handleSelectionValue
($a_value);
48
return
array_key_exists($a_value, $this->
getDefinition
()->getOptions());
49
}
50
51
52
// comparison
53
54
public
function
equals
(
ilADT
$a_adt)
55
{
56
if
($this->
getDefinition
()->isComparableTo($a_adt))
57
{
58
return
($this->
getSelection
() === $a_adt->getSelection());
59
}
60
}
61
62
public
function
isLarger
(
ilADT
$a_adt)
63
{
64
// return null?
65
}
66
67
public
function
isSmaller
(
ilADT
$a_adt)
68
{
69
// return null?
70
}
71
72
73
// null
74
75
public
function
isNull
()
76
{
77
return
($this->
getSelection
() === null);
78
}
79
80
81
// check
82
83
public
function
getCheckSum
()
84
{
85
if
(!$this->
isNull
())
86
{
87
return
(
string
)$this->
getSelection
();
88
}
89
}
90
}
91
92
?>
Services
ADT
classes
Types
Enum
class.ilADTEnum.php
Generated on Wed Apr 27 2016 21:01:27 for ILIAS by
1.8.1.2 (using
Doxyfile
)