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

Public Member Functions

 reset ()
 Init property defaults.
 setNumber ($a_value=null)
 getNumber ()
 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.
 isValid ()
 Is currently valid.
 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)
 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.
- 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.ilADTInteger.php.

Member Function Documentation

ilADTInteger::equals ( ilADT  $a_adt)

Check if given ADT equals self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

Definition at line 38 of file class.ilADTInteger.php.

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

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

+ Here is the call graph for this function:

ilADTInteger::getCheckSum ( )

Get unique checksum.

Returns
string

Reimplemented from ilADT.

Definition at line 101 of file class.ilADTInteger.php.

References getNumber(), and isNull().

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

+ Here is the call graph for this function:

ilADTInteger::getNumber ( )

Definition at line 30 of file class.ilADTInteger.php.

References $value.

Referenced by equals(), getCheckSum(), isLarger(), isNull(), isSmaller(), and isValid().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilADTInteger::isLarger ( ilADT  $a_adt)

Check if given ADT is larger than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

Definition at line 46 of file class.ilADTInteger.php.

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

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

+ Here is the call graph for this function:

ilADTInteger::isNull ( )

Is currently null.

Returns
bool

Reimplemented from ilADT.

Definition at line 65 of file class.ilADTInteger.php.

References getNumber().

Referenced by getCheckSum().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTInteger::isSmaller ( ilADT  $a_adt)

Check if given ADT is smaller than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

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

{
if($this->getDefinition()->isComparableTo($a_adt))
{
return ($this->getNumber() < $a_adt->getNumber());
}
}

+ Here is the call graph for this function:

ilADTInteger::isValid ( )

Is currently valid.

Returns
boolean

Reimplemented from ilADT.

Definition at line 73 of file class.ilADTInteger.php.

References $valid, ilADT\addValidationError(), ilADT\getDefinition(), and getNumber().

{
$num = $this->getNumber();
if($num !== null)
{
$min = $this->getDefinition()->getMin();
if($min !== null && $num < $min)
{
$this->addValidationError(self::ADT_VALIDATION_ERROR_MIN);
$valid = false;
}
$max = $this->getDefinition()->getMax();
if($max !== null && $num > $max)
{
$this->addValidationError(self::ADT_VALIDATION_ERROR_MAX);
$valid = false;
}
}
return $valid;
}

+ Here is the call graph for this function:

ilADTInteger::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Returns
bool;

Reimplemented from ilADT.

Reimplemented in ilADTFloat.

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

{
return ($a_def instanceof ilADTIntegerDefinition);
}
ilADTInteger::reset ( )

Init property defaults.

Reimplemented from ilADT.

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

{
$this->value = null;
}
ilADTInteger::setNumber (   $a_value = null)

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

References ilADT\getDefinition().

{
$this->value = $this->getDefinition()->handleNumber($a_value);
}

+ Here is the call graph for this function:

Field Documentation

ilADTInteger::$value
protected

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

Referenced by getNumber().


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