ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTEnumDefinition Class Reference
+ Inheritance diagram for ilADTEnumDefinition:
+ Collaboration diagram for ilADTEnumDefinition:

Public Member Functions

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

Protected Attributes

 $options
 $numeric
- Protected Attributes inherited from ilADTDefinition
 $allow_null

Detailed Description

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

Member Function Documentation

ilADTEnumDefinition::getADTInstance ( )

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

References isNumeric().

{
if($this->isNumeric())
{
$class = "ilADTEnumNumeric";
}
else
{
$class = "ilADTEnumText";
}
include_once "Services/ADT/classes/Types/Enum/class.ilADTEnum.php";
include_once "Services/ADT/classes/Types/Enum/class.".$class.".php";
return new $class($this);
}

+ Here is the call graph for this function:

ilADTEnumDefinition::getOptions ( )

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

References $options.

{
}
ilADTEnumDefinition::getType ( )

Get type (from class/instance)

Returns
string

Reimplemented from ilADTDefinition.

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

{
return "Enum";
}
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 61 of file class.ilADTEnumDefinition.php.

{
// has to be enum-based
return ($a_adt instanceof ilADTEnum);
}
ilADTEnumDefinition::isNumeric ( )

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

References $numeric.

Referenced by getADTInstance(), and setOptions().

{
}

+ Here is the caller graph for this function:

ilADTEnumDefinition::reset ( )

Init property defaults.

Reimplemented from ilADTDefinition.

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

References setNumeric().

{
$this->options = array();
$this->setNumeric(true);
}

+ Here is the call graph for this function:

ilADTEnumDefinition::setNumeric (   $a_value)

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

Referenced by reset().

{
$this->numeric = $a_value;
}

+ Here is the caller graph for this function:

ilADTEnumDefinition::setOptions ( array  $a_values)

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

References isNumeric().

{
if($this->isNumeric())
{
foreach(array_keys($a_values) as $key)
{
if(!is_numeric($key))
{
throw new Exception("ilADTEnum was expecting numeric option keys");
}
}
}
$this->options = $a_values;
}

+ Here is the call graph for this function:

Field Documentation

ilADTEnumDefinition::$numeric
protected

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

Referenced by isNumeric().

ilADTEnumDefinition::$options
protected

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

Referenced by getOptions().


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