ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTMultiEnum Class Reference
+ Inheritance diagram for ilADTMultiEnum:
+ Collaboration diagram for ilADTMultiEnum:

Public Member Functions

 getType ()
 
 reset ()
 
 setSelections (array $a_values=null)
 
 getSelections ()
 
 isValidOption ($a_value)
 
 equals (ilADT $a_adt)
 
 isLarger (ilADT $a_adt)
 
 isSmaller (ilADT $a_adt)
 
 isNull ()
 
 getCheckSum ()
 
- Public Member Functions inherited from ilADT
 __construct (ilADTDefinition $a_def)
 Constructor. More...
 
 getType ()
 Get type (from class/instance) 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)
 Check if given ADT is larger or equal than self. More...
 
 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 ()
 Is currently valid. More...
 
 getValidationErrors ()
 Get all validation error codes. More...
 
 translateErrorCode ($a_code)
 Translate error-code to human-readable message. More...
 
 getCheckSum ()
 Get unique checksum. More...
 

Protected Member Functions

 isValidDefinition (ilADTDefinition $a_def)
 
 handleSelectionValue ($a_value)
 
- Protected Member Functions inherited from ilADT
 reset ()
 Init property defaults. More...
 
 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT. More...
 
 setDefinition (ilADTDefinition $a_def)
 Set definition. More...
 
 getDefinition ()
 Get definition. More...
 
 addValidationError ($a_error_code)
 Add validation error code. More...
 

Protected Attributes

 $values
 
- Protected Attributes inherited from ilADT
 $definition
 
 $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 3 of file class.ilADTMultiEnum.php.

Member Function Documentation

◆ equals()

ilADTMultiEnum::equals ( ilADT  $a_adt)

Definition at line 62 of file class.ilADTMultiEnum.php.

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

63  {
64  if ($this->getDefinition()->isComparableTo($a_adt)) {
65  return ($this->getCheckSum() === $a_adt->getCheckSum());
66  }
67  }
getCheckSum()
Get unique checksum.
getDefinition()
Get definition.
Definition: class.ilADT.php:97
+ Here is the call graph for this function:

◆ getCheckSum()

ilADTMultiEnum::getCheckSum ( )

Definition at line 90 of file class.ilADTMultiEnum.php.

References $current, getSelections(), and isNull().

Referenced by equals().

91  {
92  if (!$this->isNull()) {
93  $current = $this->getSelections();
94  sort($current);
95  return md5(implode(",", $current));
96  }
97  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelections()

ilADTMultiEnum::getSelections ( )

Definition at line 48 of file class.ilADTMultiEnum.php.

References $values.

Referenced by getCheckSum(), and isNull().

49  {
50  return $this->values;
51  }
+ Here is the caller graph for this function:

◆ getType()

ilADTMultiEnum::getType ( )

Definition at line 7 of file class.ilADTMultiEnum.php.

8  {
9  return "MultiEnum";
10  }

◆ handleSelectionValue()

ilADTMultiEnum::handleSelectionValue (   $a_value)
abstractprotected

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

+ Here is the caller graph for this function:

◆ isLarger()

ilADTMultiEnum::isLarger ( ilADT  $a_adt)

Definition at line 69 of file class.ilADTMultiEnum.php.

70  {
71  // return null?
72  }

◆ isNull()

ilADTMultiEnum::isNull ( )

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

References getSelections().

Referenced by getCheckSum().

83  {
84  return ($this->getSelections() === null);
85  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSmaller()

ilADTMultiEnum::isSmaller ( ilADT  $a_adt)

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

75  {
76  // return null?
77  }

◆ isValidDefinition()

ilADTMultiEnum::isValidDefinition ( ilADTDefinition  $a_def)
protected

Definition at line 15 of file class.ilADTMultiEnum.php.

16  {
17  return ($a_def instanceof ilADTMultiEnumDefinition);
18  }

◆ isValidOption()

ilADTMultiEnum::isValidOption (   $a_value)

Definition at line 53 of file class.ilADTMultiEnum.php.

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

Referenced by setSelections().

54  {
55  $a_value = $this->handleSelectionValue($a_value);
56  return array_key_exists($a_value, $this->getDefinition()->getOptions());
57  }
handleSelectionValue($a_value)
getDefinition()
Get definition.
Definition: class.ilADT.php:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilADTMultiEnum::reset ( )

Definition at line 20 of file class.ilADTMultiEnum.php.

References handleSelectionValue().

21  {
22  parent::reset();
23 
24  $this->values = null;
25  }
+ Here is the call graph for this function:

◆ setSelections()

ilADTMultiEnum::setSelections ( array  $a_values = null)

Definition at line 32 of file class.ilADTMultiEnum.php.

References handleSelectionValue(), and isValidOption().

33  {
34  if ($a_values !== null) {
35  foreach ($a_values as $idx => $value) {
36  $value = $this->handleSelectionValue($value);
37  if (!$this->isValidOption($value)) {
38  unset($a_values[$idx]);
39  }
40  }
41  if (!sizeof($a_values)) {
42  $a_values = null;
43  }
44  }
45  $this->values = $a_values;
46  }
handleSelectionValue($a_value)
+ Here is the call graph for this function:

Field Documentation

◆ $values

ilADTMultiEnum::$values
protected

Definition at line 5 of file class.ilADTMultiEnum.php.

Referenced by getSelections().


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