ILIAS  release_8 Revision v8.24
ilADTEnumDefinition Class Reference
+ Inheritance diagram for ilADTEnumDefinition:
+ Collaboration diagram for ilADTEnumDefinition:

Public Member Functions

 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 isNumeric ()
 
 setNumeric (bool $a_value)
 
 getOptions ()
 
 setOptions (array $a_values)
 
 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
 
- Protected Attributes inherited from ilADTDefinition
bool $allow_null
 

Detailed Description

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

Member Function Documentation

◆ getADTInstance()

ilADTEnumDefinition::getADTInstance ( )

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

63 : ilADTEnum
64 {
65 if ($this->isNumeric()) {
66 $class = "ilADTEnumNumeric";
67 } else {
68 $class = "ilADTEnumText";
69 }
70 return new $class($this);
71 }

References isNumeric().

+ Here is the call graph for this function:

◆ getOptions()

ilADTEnumDefinition::getOptions ( )

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

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

References $options.

◆ getType()

ilADTEnumDefinition::getType ( )

Get type (from class/instance)

Returns
string

Reimplemented from ilADTDefinition.

Definition at line 10 of file class.ilADTEnumDefinition.php.

10 : string
11 {
12 return "Enum";
13 }

◆ isComparableTo()

ilADTEnumDefinition::isComparableTo ( ilADT  $a_adt)

Check if given ADT is comparable to self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADTDefinition.

Definition at line 57 of file class.ilADTEnumDefinition.php.

57 : bool
58 {
59 // has to be enum-based
60 return ($a_adt instanceof ilADTEnum);
61 }

◆ isNumeric()

ilADTEnumDefinition::isNumeric ( )

Definition at line 27 of file class.ilADTEnumDefinition.php.

27 : bool
28 {
29 return $this->numeric;
30 }

References $numeric.

Referenced by getADTInstance(), and setOptions().

+ Here is the caller graph for this function:

◆ reset()

ilADTEnumDefinition::reset ( )

Init property defaults.

Reimplemented from ilADTDefinition.

Definition at line 17 of file class.ilADTEnumDefinition.php.

17 : void
18 {
19 parent::reset();
20
21 $this->options = array();
22 $this->setNumeric(true);
23 }

References setNumeric().

+ Here is the call graph for this function:

◆ setNumeric()

ilADTEnumDefinition::setNumeric ( bool  $a_value)

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

32 : void
33 {
34 $this->numeric = $a_value;
35 }

Referenced by reset().

+ Here is the caller graph for this function:

◆ setOptions()

ilADTEnumDefinition::setOptions ( array  $a_values)

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

43 {
44 if ($this->isNumeric()) {
45 foreach (array_keys($a_values) as $key) {
46 if (!is_numeric($key)) {
47 throw new Exception("ilADTEnum was expecting numeric option keys");
48 }
49 }
50 }
51
52 $this->options = $a_values;
53 }
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 ilADTEnumDefinition::$numeric
protected

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

Referenced by isNumeric().

◆ $options

array ilADTEnumDefinition::$options = []
protected

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

Referenced by getOptions().


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