86 $this->definition = clone $a_def;
109 return (clone $this->definition);
141 return ($this->
equals($a_adt) ||
161 return ($this->
equals($a_adt) ||
174 return ($this->
isLarger($a_adt_from) &&
187 return ($this->
equals($a_adt_from) ||
188 $this->
equals($a_adt_to) ||
202 abstract public function isNull();
216 $this->validation_errors =
array();
232 $this->validation_errors[] = (
string) $a_error_code;
243 if (is_array($this->validation_errors) &&
244 sizeof($this->validation_errors)) {
245 return array_unique($this->validation_errors);
266 case self::ADT_VALIDATION_ERROR_NULL_NOT_ALLOWED:
267 return $lng->txt(
"msg_input_is_required");
269 case self::ADT_VALIDATION_ERROR_MAX_LENGTH:
270 return $lng->txt(
"adt_error_max_length");
272 case self::ADT_VALIDATION_ERROR_MAX_SIZE:
273 return $lng->txt(
"adt_error_max_size");
275 case self::ADT_VALIDATION_ERROR_MIN:
276 return $lng->txt(
"form_msg_value_too_low");
278 case self::ADT_VALIDATION_ERROR_MAX:
279 return $lng->txt(
"form_msg_value_too_high");
282 case self::ADT_VALIDATION_DATE:
283 return $lng->txt(
"exc_date_not_valid");
286 throw new Exception(
"ADT unknown error code");
getType()
Get type (from class/instance)
equals(ilADT $a_adt)
Check if given ADT equals self.
const ADT_VALIDATION_ERROR_MAX_SIZE
const ADT_VALIDATION_ERROR_INVALID_NODE
isSmaller(ilADT $a_adt)
Check if given ADT is smaller than self.
isValid()
Is currently valid.
const ADT_VALIDATION_ERROR_MIN
isLarger(ilADT $a_adt)
Check if given ADT is larger than self.
addValidationError($a_error_code)
Add validation error code.
isLargerOrEqual(ilADT $a_adt)
Check if given ADT is larger or equal than self.
const ADT_VALIDATION_ERROR_MAX_LENGTH
translateErrorCode($a_code)
Translate error-code to human-readable message.
isInbetweenOrEqual(ilADT $a_adt_from, ilADT $a_adt_to)
Check if self is inbetween given ADTs (inclusive)
isSmallerOrEqual(ilADT $a_adt)
Check if given ADT is smaller or equal than self.
isValidDefinition(ilADTDefinition $a_def)
Check if definition is valid for ADT.
const ADT_VALIDATION_ERROR_MAX
reset()
Init property defaults.
__construct(ilADTDefinition $a_def)
Constructor.
getValidationErrors()
Get all validation error codes.
isInbetween(ilADT $a_adt_from, ilADT $a_adt_to)
Check if self is inbetween given ADTs (exclusive)
isNull()
Is currently null.
Create styles array
The data for the language used.
getCopyOfDefinition()
Get copy of definition.
getCheckSum()
Get unique checksum.
const ADT_VALIDATION_ERROR_NULL_NOT_ALLOWED
setDefinition(ilADTDefinition $a_def)
Set definition.
ADT definition base class.
const ADT_VALIDATION_DATE
getDefinition()
Get definition.