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

Public Member Functions

 reset ()
 Init property defaults.
 setTextElements (array $a_values=null)
 getTextElements ()
 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

 $values
- 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.ilADTMultiText.php.

Member Function Documentation

ilADTMultiText::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.ilADTMultiText.php.

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

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

+ Here is the call graph for this function:

ilADTMultiText::getCheckSum ( )

Get unique checksum.

Returns
string

Reimplemented from ilADT.

Definition at line 120 of file class.ilADTMultiText.php.

References getTextElements(), and isNull().

Referenced by equals().

{
if(!$this->isNull())
{
$elements = $this->getTextElements();
sort($elements);
return md5(implode("", $elements));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTMultiText::getTextElements ( )

Definition at line 49 of file class.ilADTMultiText.php.

References $values.

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

{
return $this->values;
}

+ Here is the caller graph for this function:

ilADTMultiText::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.ilADTMultiText.php.

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

Is currently null.

Returns
bool

Reimplemented from ilADT.

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

References getTextElements().

Referenced by getCheckSum(), and isValid().

{
$all = $this->getTextElements();
return (!is_array($all) || !sizeof($all));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTMultiText::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.ilADTMultiText.php.

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

Is currently valid.

Returns
boolean

Reimplemented from ilADT.

Definition at line 87 of file class.ilADTMultiText.php.

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

{
if(!$this->isNull())
{
$max_size = $this->getDefinition()->getMaxSize();
if($max_size && $max_size < sizeof($this->getTextElements()))
{
$valid = false;
$this->addValidationError(self::ADT_VALIDATION_ERROR_MAX_SIZE);
}
$max_len = $this->getDefinition()->getMaxLength();
if($max_len)
{
foreach($this->getTextElements() as $element)
{
if($max_len < strlen($element))
{
$valid = false;
$this->addValidationError(self::ADT_VALIDATION_ERROR_MAX_LENGTH);
}
}
}
}
return $valid;
}

+ Here is the call graph for this function:

ilADTMultiText::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Returns
bool;

Reimplemented from ilADT.

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

{
return ($a_def instanceof ilADTMultiTextDefinition);
}
ilADTMultiText::reset ( )

Init property defaults.

Reimplemented from ilADT.

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

{
$this->values = null;
}
ilADTMultiText::setTextElements ( array  $a_values = null)

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

{
if(is_array($a_values))
{
if(sizeof($a_values))
{
foreach($a_values as $idx => $element)
{
$a_values[$idx]= trim($element);
if(!$a_values[$idx])
{
unset($a_values[$idx]);
}
}
$a_values = array_unique($a_values);
}
if(!sizeof($a_values))
{
$a_values = null;
}
}
$this->values = $a_values;
}

Field Documentation

ilADTMultiText::$values
protected

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

Referenced by getTextElements().


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