19declare(strict_types=1);
57 $this->
lng = $DIC->language();
96 $this->definition = clone $a_def;
117 return (clone $this->definition);
144 if ($this->
equals($a_adt) ===
null || $this->
isLarger($a_adt) ===
null) {
167 if ($this->
equals($a_adt) ===
null || $this->
isSmaller($a_adt) ===
null) {
187 if ($this->
isLarger($a_adt_from) ===
null || $this->
isSmaller($a_adt_to) ===
null) {
208 $this->
equals($a_adt_from) ===
null ||
209 $this->
equals($a_adt_to) ===
null ||
210 $this->
isInbetween($a_adt_from, $a_adt_to) ===
null
215 $this->
equals($a_adt_from) ||
216 $this->
equals($a_adt_to) ||
228 $this->validation_errors = [];
239 $this->validation_errors[] = $a_error_code;
250 is_array($this->validation_errors) &&
251 count($this->validation_errors)) {
252 return array_unique($this->validation_errors);
267 return $this->
lng->txt(
"msg_input_is_required");
270 return $this->
lng->txt(
"adt_error_max_length");
273 return $this->
lng->txt(
"adt_error_max_size");
276 return $this->
lng->txt(
"form_msg_value_too_low");
279 return $this->
lng->txt(
"form_msg_value_too_high");
283 return $this->
lng->txt(
"exc_date_not_valid");
285 throw new Exception(
"ADT unknown error code");
ADT definition base class.
ilADTDefinition $definition
const ADT_VALIDATION_ERROR_MAX_SIZE
equals(ilADT $a_adt)
Check if given ADT equals self.
isSmaller(ilADT $a_adt)
Check if given ADT is smaller than self.
isSmallerOrEqual(ilADT $a_adt)
Check if given ADT is smaller or equal than self.
const ADT_VALIDATION_ERROR_MAX_LENGTH
isNull()
Is currently null.
const ADT_VALIDATION_ERROR_MAX
isLargerOrEqual(ilADT $a_adt)
addValidationError(string $a_error_code)
getType()
Get type (from class/instance)
getCopyOfDefinition()
Get copy of definition.
exportStdClass()
Export value as stdClass.
__construct(ilADTDefinition $a_def)
const ADT_VALIDATION_ERROR_INVALID_NODE
reset()
Init property defaults.
translateErrorCode(string $a_code)
Translate error-code to human-readable message.
setDefinition(ilADTDefinition $a_def)
Set definition.
importStdClass(?stdClass $a_std)
Import value from stdClass.
getValidationErrors()
Get all validation error codes.
getCheckSum()
Get unique checksum.
getDefinition()
Get definition.
isValidDefinition(ilADTDefinition $a_def)
Check if definition is valid for ADT.
isInbetween(ilADT $a_adt_from, ilADT $a_adt_to)
Check if self is inbetween given ADTs (exclusive)
const ADT_VALIDATION_ERROR_MIN
const ADT_VALIDATION_ERROR_NULL_NOT_ALLOWED
const ADT_VALIDATION_DATE
isLarger(ilADT $a_adt)
Check if given ADT is larger than self.
isInbetweenOrEqual(ilADT $a_adt_from, ilADT $a_adt_to)
Check if self is inbetween given ADTs (inclusive)
Base class for ILIAS Exception handling.