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

Public Member Functions

 reset ()
 Init property defaults.
 setSelection ($a_value=null)
 getSelection ()
 isValidOption ($a_value)
 equals (ilADT $a_adt)
 Check if given ADT equals self.
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self.
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self.
 isNull ()
 Is currently null.
 getCheckSum ()
 Get unique checksum.
- Public Member Functions inherited from ilADT
 __construct (ilADTDefinition $a_def)
 Constructor.
 getType ()
 Get type (from class/instance)
 getCopyOfDefinition ()
 Get copy of definition.
 isLargerOrEqual (ilADT $a_adt)
 Check if given ADT is larger or equal than self.
 isSmallerOrEqual (ilADT $a_adt)
 Check if given ADT is smaller or equal than self.
 isInbetween (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (exclusive)
 isInbetweenOrEqual (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (inclusive)
 isValid ()
 Is currently valid.
 getValidationErrors ()
 Get all validation error codes.
 translateErrorCode ($a_code)
 Translate error-code to human-readable message.

Protected Member Functions

 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT.
 handleSelectionValue ($a_value)
- Protected Member Functions inherited from ilADT
 setDefinition (ilADTDefinition $a_def)
 Set definition.
 getDefinition ()
 Get definition.
 addValidationError ($a_error_code)
 Add validation error code.

Protected Attributes

 $value
- 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.ilADTEnum.php.

Member Function Documentation

ilADTEnum::equals ( ilADT  $a_adt)

Check if given ADT equals self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

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

{
if($this->getDefinition()->isComparableTo($a_adt))
{
return ($this->getSelection() === $a_adt->getSelection());
}
}

+ Here is the call graph for this function:

ilADTEnum::getCheckSum ( )

Get unique checksum.

Returns
string

Reimplemented from ilADT.

Definition at line 83 of file class.ilADTEnum.php.

References getSelection(), and isNull().

{
if(!$this->isNull())
{
return (string)$this->getSelection();
}
}

+ Here is the call graph for this function:

ilADTEnum::getSelection ( )

Definition at line 40 of file class.ilADTEnum.php.

References $value.

Referenced by equals(), getCheckSum(), and isNull().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilADTEnum::handleSelectionValue (   $a_value)
abstractprotected

Reimplemented in ilADTEnumNumeric, and ilADTEnumText.

Referenced by isValidOption(), and setSelection().

+ Here is the caller graph for this function:

ilADTEnum::isLarger ( ilADT  $a_adt)

Check if given ADT is larger than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

Definition at line 62 of file class.ilADTEnum.php.

{
// return null?
}
ilADTEnum::isNull ( )

Is currently null.

Returns
bool

Reimplemented from ilADT.

Definition at line 75 of file class.ilADTEnum.php.

References getSelection().

Referenced by getCheckSum().

{
return ($this->getSelection() === null);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTEnum::isSmaller ( ilADT  $a_adt)

Check if given ADT is smaller than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

Definition at line 67 of file class.ilADTEnum.php.

{
// return null?
}
ilADTEnum::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Returns
bool;

Reimplemented from ilADT.

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

{
return ($a_def instanceof ilADTEnumDefinition);
}
ilADTEnum::isValidOption (   $a_value)

Definition at line 45 of file class.ilADTEnum.php.

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

Referenced by setSelection().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTEnum::reset ( )

Init property defaults.

Reimplemented from ilADT.

Definition at line 15 of file class.ilADTEnum.php.

{
$this->value = null;
}
ilADTEnum::setSelection (   $a_value = null)

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

References handleSelectionValue(), and isValidOption().

{
if($a_value !== null)
{
$a_value = $this->handleSelectionValue($a_value);
if(!$this->isValidOption($a_value))
{
$a_value = null;
}
}
$this->value = $a_value;
}

+ Here is the call graph for this function:

Field Documentation

ilADTEnum::$value
protected

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

Referenced by getSelection().


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