ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
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"
 

Detailed Description

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

Member Function Documentation

◆ equals()

ilADTMultiEnum::equals ( ilADT  $a_adt)

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

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

67  {
68  if($this->getDefinition()->isComparableTo($a_adt))
69  {
70  return ($this->getCheckSum() === $a_adt->getCheckSum());
71  }
72  }
getCheckSum()
Get unique checksum.
getDefinition()
Get definition.
Definition: class.ilADT.php:99
+ Here is the call graph for this function:

◆ getCheckSum()

ilADTMultiEnum::getCheckSum ( )

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

References getSelections(), and isNull().

Referenced by equals().

96  {
97  if(!$this->isNull())
98  {
99  $current = $this->getSelections();
100  sort($current);
101  return md5(implode(",", $current));
102  }
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelections()

ilADTMultiEnum::getSelections ( )

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

References $values.

Referenced by getCheckSum(), and isNull().

53  {
54  return $this->values;
55  }
+ 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 74 of file class.ilADTMultiEnum.php.

75  {
76  // return null?
77  }

◆ isNull()

ilADTMultiEnum::isNull ( )

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

References getSelections().

Referenced by getCheckSum().

88  {
89  return ($this->getSelections() === null);
90  }
+ 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 79 of file class.ilADTMultiEnum.php.

80  {
81  // return null?
82  }

◆ 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 57 of file class.ilADTMultiEnum.php.

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

Referenced by setSelections().

58  {
59  $a_value = $this->handleSelectionValue($a_value);
60  return array_key_exists($a_value, $this->getDefinition()->getOptions());
61  }
handleSelectionValue($a_value)
getDefinition()
Get definition.
Definition: class.ilADT.php:99
+ 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  {
36  foreach($a_values as $idx => $value)
37  {
38  $value = $this->handleSelectionValue($value);
39  if(!$this->isValidOption($value))
40  {
41  unset($a_values[$idx]);
42  }
43  }
44  if(!sizeof($a_values))
45  {
46  $a_values = null;
47  }
48  }
49  $this->values = $a_values;
50  }
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: