ILIAS  release_8 Revision v8.24
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 5 of file class.ilADTMultiEnumDefinition.php.

Member Function Documentation

◆ getADTInstance()

ilADTMultiEnumDefinition::getADTInstance ( )

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

54 : ilADT
55 {
56 if ($this->isNumeric()) {
57 $class = "ilADTMultiEnumNumeric";
58 } else {
59 $class = "ilADTMultiEnumText";
60 }
61 return new $class($this);
62 }
ADT base class.
Definition: class.ilADT.php:12

References isNumeric().

+ Here is the call graph for this function:

◆ getOptions()

ilADTMultiEnumDefinition::getOptions ( )

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

20 : array
21 {
22 return $this->options;
23 }

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 47 of file class.ilADTMultiEnumDefinition.php.

47 : bool
48 {
49 return ($a_adt instanceof ilADTMultiEnum);
50 }

◆ isNumeric()

ilADTMultiEnumDefinition::isNumeric ( )

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

37 : bool
38 {
39 return $this->numeric;
40 }

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 12 of file class.ilADTMultiEnumDefinition.php.

12 : void
13 {
14 parent::reset();
15
16 $this->options = array();
17 $this->setNumeric(true);
18 }

References setNumeric().

+ Here is the call graph for this function:

◆ setNumeric()

ilADTMultiEnumDefinition::setNumeric ( bool  $a_value)

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

42 : void
43 {
44 $this->numeric = $a_value;
45 }

Referenced by reset().

+ Here is the caller graph for this function:

◆ setOptions()

ilADTMultiEnumDefinition::setOptions ( array  $a_values)

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

25 : void
26 {
27 if ($this->isNumeric()) {
28 foreach (array_keys($a_values) as $key) {
29 if (!is_numeric($key)) {
30 throw new InvalidArgumentException("ilADTMultiEnum was expecting numeric option keys");
31 }
32 }
33 }
34 $this->options = $a_values;
35 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, and isNumeric().

+ Here is the call graph for this function:

Field Documentation

◆ $numeric

bool ilADTMultiEnumDefinition::$numeric = false
protected

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

Referenced by isNumeric().

◆ $options

array ilADTMultiEnumDefinition::$options = []
protected

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

Referenced by getOptions().


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