ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADTEnum Class Reference
+ Inheritance diagram for ilADTEnum:
+ Collaboration diagram for ilADTEnum:

Public Member Functions

 reset ()
 
 setSelection ($a_value=null)
 
 getSelection ()
 
 isValidOption ($a_value)
 
 equals (ilADT $a_adt)
 
 isLarger (ilADT $a_adt)
 
 isSmaller (ilADT $a_adt)
 
 isNull ()
 
 getCheckSum ()
 
 exportStdClass ()
 
 importStdClass (?stdClass $a_std)
 
- Public Member Functions inherited from ilADT
 __construct (ilADTDefinition $a_def)
 
 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 getCopyOfDefinition ()
 Get copy of definition. More...
 
 equals (ilADT $a_adt)
 Check if given ADT equals self. More...
 
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self. More...
 
 isLargerOrEqual (ilADT $a_adt)
 
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self. More...
 
 isSmallerOrEqual (ilADT $a_adt)
 Check if given ADT is smaller or equal than self. More...
 
 isInbetween (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (exclusive) More...
 
 isInbetweenOrEqual (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (inclusive) More...
 
 isNull ()
 Is currently null. More...
 
 isValid ()
 
 getValidationErrors ()
 Get all validation error codes. More...
 
 translateErrorCode (string $a_code)
 Translate error-code to human-readable message. More...
 
 getCheckSum ()
 Get unique checksum. More...
 
 exportStdClass ()
 Export value as stdClass. More...
 
 importStdClass (?stdClass $a_std)
 Import value from stdClass. More...
 

Protected Member Functions

 isValidDefinition (ilADTDefinition $a_def)
 
 handleSelectionValue ($a_value)
 
- Protected Member Functions inherited from ilADT
 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT. More...
 
 setDefinition (ilADTDefinition $a_def)
 Set definition. More...
 
 getDefinition ()
 Get definition. More...
 
 addValidationError (string $a_error_code)
 

Protected Attributes

 $value
 
- Protected Attributes inherited from ilADT
ilADTDefinition $definition
 
ilLanguage $lng
 
array $validation_errors = []
 

Additional Inherited Members

- Data Fields inherited from ilADT
const ADT_VALIDATION_ERROR_NULL_NOT_ALLOWED = "adt1"
 
const ADT_VALIDATION_ERROR_MAX_LENGTH = "adt2"
 
const ADT_VALIDATION_ERROR_MAX_SIZE = "adt3"
 
const ADT_VALIDATION_ERROR_MIN = "adt4"
 
const ADT_VALIDATION_ERROR_MAX = "adt5"
 
const ADT_VALIDATION_DATE = "adt6"
 
const ADT_VALIDATION_ERROR_INVALID_NODE = 'adt7'
 

Detailed Description

Definition at line 21 of file class.ilADTEnum.php.

Member Function Documentation

◆ equals()

ilADTEnum::equals ( ilADT  $a_adt)

Definition at line 74 of file class.ilADTEnum.php.

References ilADT\getDefinition(), getSelection(), and null.

74  : ?bool
75  {
76  if ($this->getDefinition()->isComparableTo($a_adt)) {
77  return ($this->getSelection() === $a_adt->getSelection());
78  }
79  return null;
80  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getDefinition()
Get definition.
+ Here is the call graph for this function:

◆ exportStdClass()

ilADTEnum::exportStdClass ( )

Definition at line 111 of file class.ilADTEnum.php.

References getSelection(), isNull(), and null.

111  : ?stdClass
112  {
113  if (!$this->isNull()) {
114  $obj = new stdClass();
115  $obj->value = $this->getSelection();
116  return $obj;
117  }
118  return null;
119  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getCheckSum()

ilADTEnum::getCheckSum ( )

Definition at line 101 of file class.ilADTEnum.php.

References getSelection(), isNull(), and null.

101  : ?string
102  {
103  if (!$this->isNull()) {
104  return (string) $this->getSelection();
105  }
106  return null;
107  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getSelection()

ilADTEnum::getSelection ( )
Returns
mixed

Definition at line 61 of file class.ilADTEnum.php.

References $value.

Referenced by equals(), exportStdClass(), getCheckSum(), and isNull().

62  {
63  return $this->value;
64  }
+ Here is the caller graph for this function:

◆ handleSelectionValue()

ilADTEnum::handleSelectionValue (   $a_value)
abstractprotected
Parameters
string | int$a_value
Returns
string|int

Referenced by isValidOption(), reset(), and setSelection().

+ Here is the caller graph for this function:

◆ importStdClass()

ilADTEnum::importStdClass ( ?stdClass  $a_std)

Definition at line 121 of file class.ilADTEnum.php.

References setSelection().

121  : void
122  {
123  if (is_object($a_std)) {
124  $this->setSelection($a_std->value);
125  }
126  }
setSelection($a_value=null)
+ Here is the call graph for this function:

◆ isLarger()

ilADTEnum::isLarger ( ilADT  $a_adt)

Definition at line 82 of file class.ilADTEnum.php.

References null.

82  : ?bool
83  {
84  return null;
85  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ isNull()

ilADTEnum::isNull ( )

Definition at line 94 of file class.ilADTEnum.php.

References getSelection(), and null.

Referenced by exportStdClass(), and getCheckSum().

94  : bool
95  {
96  return $this->getSelection() === null;
97  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSmaller()

ilADTEnum::isSmaller ( ilADT  $a_adt)

Definition at line 87 of file class.ilADTEnum.php.

References null.

87  : ?bool
88  {
89  return null;
90  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ isValidDefinition()

ilADTEnum::isValidDefinition ( ilADTDefinition  $a_def)
protected

Definition at line 28 of file class.ilADTEnum.php.

28  : bool
29  {
30  return ($a_def instanceof ilADTEnumDefinition);
31  }

◆ isValidOption()

ilADTEnum::isValidOption (   $a_value)

Definition at line 66 of file class.ilADTEnum.php.

References ilADT\getDefinition(), and handleSelectionValue().

Referenced by setSelection().

66  : bool
67  {
68  $a_value = $this->handleSelectionValue($a_value);
69  return array_key_exists($a_value, $this->getDefinition()->getOptions());
70  }
handleSelectionValue($a_value)
getDefinition()
Get definition.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilADTEnum::reset ( )

Definition at line 33 of file class.ilADTEnum.php.

References handleSelectionValue(), and null.

33  : void
34  {
35  parent::reset();
36  $this->value = null;
37  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ setSelection()

ilADTEnum::setSelection (   $a_value = null)

Definition at line 47 of file class.ilADTEnum.php.

References handleSelectionValue(), isValidOption(), and null.

Referenced by importStdClass().

48  {
49  if ($a_value !== null) {
50  $a_value = $this->handleSelectionValue($a_value);
51  if (!$this->isValidOption($a_value)) {
52  $a_value = null;
53  }
54  }
55  $this->value = $a_value;
56  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
handleSelectionValue($a_value)
isValidOption($a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $value

ilADTEnum::$value
protected

Definition at line 26 of file class.ilADTEnum.php.

Referenced by getSelection().


The documentation for this class was generated from the following file: