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

Public Member Functions

 reset ()
 Init property defaults.
 setText ($a_value=null)
 getText ()
 getLength ()
 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.ilADTText.php.

Member Function Documentation

ilADTText::equals ( ilADT  $a_adt)

Check if given ADT equals self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

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

{
if($this->getDefinition()->isComparableTo($a_adt))
{
return !strcmp($this->getText(), $a_adt->getText());
}
}

+ Here is the call graph for this function:

ilADTText::getCheckSum ( )

Get unique checksum.

Returns
string

Reimplemented from ilADT.

Definition at line 106 of file class.ilADTText.php.

References getText(), and isNull().

{
if(!$this->isNull())
{
return md5($this->getText());
}
}

+ Here is the call graph for this function:

ilADTText::getLength ( )

Definition at line 39 of file class.ilADTText.php.

References getText().

Referenced by isNull(), and isValid().

{
// see ilStr::strLen();
// not using ilStr to reduce dependencies in this low-level code
if(function_exists("mb_strlen"))
{
return mb_strlen($this->getText(), "UTF-8");
}
else
{
return strlen($this->getText());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTText::getText ( )

Definition at line 34 of file class.ilADTText.php.

References $value.

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

{
return $this->value;
}

+ Here is the caller graph for this function:

ilADTText::isLarger ( ilADT  $a_adt)

Check if given ADT is larger than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

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

Is currently null.

Returns
bool

Reimplemented from ilADT.

Definition at line 78 of file class.ilADTText.php.

References getLength().

Referenced by getCheckSum(), and isValid().

{
return !(bool)$this->getLength();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTText::isSmaller ( ilADT  $a_adt)

Check if given ADT is smaller than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

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

{
// return null?
}
ilADTText::isValid ( )

Is currently valid.

Returns
boolean

Reimplemented from ilADT.

Definition at line 86 of file class.ilADTText.php.

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

{
if(!$this->isNull())
{
$max = $this->getDefinition()->getMaxLength();
if($max && $max < $this->getLength())
{
$valid = false;
$this->addValidationError(self::ADT_VALIDATION_ERROR_MAX_LENGTH);
}
}
return $valid;
}

+ Here is the call graph for this function:

ilADTText::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Returns
bool;

Reimplemented from ilADT.

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

{
return ($a_def instanceof ilADTTextDefinition);
}
ilADTText::reset ( )

Init property defaults.

Reimplemented from ilADT.

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

{
$this->value = null;
}
ilADTText::setText (   $a_value = null)

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

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

Field Documentation

ilADTText::$value
protected

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

Referenced by getText().


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