ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilADTMultiEnum Class Reference
+ Inheritance diagram for ilADTMultiEnum:
+ Collaboration diagram for ilADTMultiEnum:

Public Member Functions

 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 setSelections (array $a_values=null)
 
 getSelections ()
 
 isValidOption ($a_value)
 
 equals (ilADT $a_adt)
 Check if given ADT equals self. More...
 
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self. More...
 
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self. More...
 
 isNull ()
 Is currently null. More...
 
 getCheckSum ()
 Get unique checksum. More...
 
- 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)
 Check if definition is valid for ADT. More...
 
 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)

Check if given ADT equals self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

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

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

+ Here is the call graph for this function:

◆ getCheckSum()

ilADTMultiEnum::getCheckSum ( )

Get unique checksum.

Returns
string

Reimplemented from ilADT.

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

96 {
97 if(!$this->isNull())
98 {
99 $current = $this->getSelections();
100 sort($current);
101 return md5(implode(",", $current));
102 }
103 }
isNull()
Is currently null.

References getSelections(), and isNull().

Referenced by equals().

+ 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.

53 {
54 return $this->values;
55 }

References $values.

Referenced by getCheckSum(), ilADTEnumSearchBridgeMulti\isInCondition(), and isNull().

+ Here is the caller graph for this function:

◆ getType()

ilADTMultiEnum::getType ( )

Get type (from class/instance)

Returns
string

Reimplemented from ilADT.

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

8 {
9 return "MultiEnum";
10 }

◆ handleSelectionValue()

ilADTMultiEnum::handleSelectionValue (   $a_value)
abstractprotected

Reimplemented in ilADTMultiEnumNumeric, and ilADTMultiEnumText.

Referenced by isValidOption(), and setSelections().

+ Here is the caller graph for this function:

◆ isLarger()

ilADTMultiEnum::isLarger ( ilADT  $a_adt)

Check if given ADT is larger than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

75 {
76 // return null?
77 }

◆ isNull()

ilADTMultiEnum::isNull ( )

Is currently null.

Returns
bool

Reimplemented from ilADT.

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

88 {
89 return ($this->getSelections() === null);
90 }

References getSelections().

Referenced by getCheckSum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSmaller()

ilADTMultiEnum::isSmaller ( ilADT  $a_adt)

Check if given ADT is smaller than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

80 {
81 // return null?
82 }

◆ isValidDefinition()

ilADTMultiEnum::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Returns
bool;

Reimplemented from ilADT.

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.

58 {
59 $a_value = $this->handleSelectionValue($a_value);
60 return array_key_exists($a_value, $this->getDefinition()->getOptions());
61 }
handleSelectionValue($a_value)

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

Referenced by setSelections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilADTMultiEnum::reset ( )

Init property defaults.

Reimplemented from ilADT.

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

21 {
22 parent::reset();
23
24 $this->values = null;
25 }

◆ setSelections()

ilADTMultiEnum::setSelections ( array  $a_values = null)

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

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 }

References handleSelectionValue(), and isValidOption().

+ 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: