ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilADTMultiEnumDefinition Class Reference
+ Inheritance diagram for ilADTMultiEnumDefinition:
+ Collaboration diagram for ilADTMultiEnumDefinition:

Public Member Functions

 reset ()
 Init property defaults. More...
 
 getOptions ()
 
 setOptions (array $a_values)
 
 isNumeric ()
 
 setNumeric (bool $a_value)
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 
 getADTInstance ()
 
- Public Member Functions inherited from ilADTDefinition
 __construct ()
 
 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 setAllowNull (bool $a_value)
 Toggle null allowed status. More...
 
 isNullAllowed ()
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 

Protected Attributes

array $options = []
 
bool $numeric = false
 
- Protected Attributes inherited from ilADTDefinition
bool $allow_null
 

Detailed Description

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

Member Function Documentation

◆ getADTInstance()

ilADTMultiEnumDefinition::getADTInstance ( )

Definition at line 70 of file class.ilADTMultiEnumDefinition.php.

70 : ilADT
71 {
72 if ($this->isNumeric()) {
73 $class = "ilADTMultiEnumNumeric";
74 } else {
75 $class = "ilADTMultiEnumText";
76 }
77 return new $class($this);
78 }
ADT base class.
Definition: class.ilADT.php:26

References isNumeric().

+ Here is the call graph for this function:

◆ getOptions()

ilADTMultiEnumDefinition::getOptions ( )

Definition at line 36 of file class.ilADTMultiEnumDefinition.php.

36 : array
37 {
38 return $this->options;
39 }

References $options.

◆ isComparableTo()

ilADTMultiEnumDefinition::isComparableTo ( ilADT  $a_adt)

Check if given ADT is comparable to self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADTDefinition.

Definition at line 63 of file class.ilADTMultiEnumDefinition.php.

63 : bool
64 {
65 return ($a_adt instanceof ilADTMultiEnum);
66 }

◆ isNumeric()

ilADTMultiEnumDefinition::isNumeric ( )

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

53 : bool
54 {
55 return $this->numeric;
56 }

References $numeric.

Referenced by getADTInstance(), and setOptions().

+ Here is the caller graph for this function:

◆ reset()

ilADTMultiEnumDefinition::reset ( )

Init property defaults.

Reimplemented from ilADTDefinition.

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

28 : void
29 {
30 parent::reset();
31
32 $this->options = array();
33 $this->setNumeric(true);
34 }

References setNumeric().

+ Here is the call graph for this function:

◆ setNumeric()

ilADTMultiEnumDefinition::setNumeric ( bool  $a_value)

Definition at line 58 of file class.ilADTMultiEnumDefinition.php.

58 : void
59 {
60 $this->numeric = $a_value;
61 }

Referenced by reset().

+ Here is the caller graph for this function:

◆ setOptions()

ilADTMultiEnumDefinition::setOptions ( array  $a_values)

Definition at line 41 of file class.ilADTMultiEnumDefinition.php.

41 : void
42 {
43 if ($this->isNumeric()) {
44 foreach (array_keys($a_values) as $key) {
45 if (!is_numeric($key)) {
46 throw new InvalidArgumentException("ilADTMultiEnum was expecting numeric option keys");
47 }
48 }
49 }
50 $this->options = $a_values;
51 }

References isNumeric().

+ Here is the call graph for this function:

Field Documentation

◆ $numeric

bool ilADTMultiEnumDefinition::$numeric = false
protected

Definition at line 24 of file class.ilADTMultiEnumDefinition.php.

Referenced by isNumeric().

◆ $options

array ilADTMultiEnumDefinition::$options = []
protected

Definition at line 23 of file class.ilADTMultiEnumDefinition.php.

Referenced by getOptions().


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