ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTInternalLink Class Reference
+ Inheritance diagram for ilADTInternalLink:
+ Collaboration diagram for ilADTInternalLink:

Public Member Functions

 reset ()
 Reset. More...
 
 setTargetRefId ($a_value)
 Set id of target object. More...
 
 getTargetRefId ()
 
 equals (ilADT $a_adt)
 
 isLarger (ilADT $a_adt)
 Is larger. More...
 
 isSmaller (ilADT $a_adt)
 Is smaller. More...
 
 isNull ()
 is null More...
 
 isValid ()
 is valid More...
 
 getCheckSum ()
 get checksum More...
 
- Public Member Functions inherited from ilADT
 __construct (ilADTDefinition $a_def)
 Constructor. More...
 
 getType ()
 Get type (from class/instance) More...
 
 getCopyOfDefinition ()
 Get copy of definition. More...
 
 equals (ilADT $a_adt)
 Check if given ADT equals self. More...
 
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self. More...
 
 isLargerOrEqual (ilADT $a_adt)
 Check if given ADT is larger or equal than self. More...
 
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self. More...
 
 isSmallerOrEqual (ilADT $a_adt)
 Check if given ADT is smaller or equal than self. More...
 
 isInbetween (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (exclusive) More...
 
 isInbetweenOrEqual (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (inclusive) More...
 
 isNull ()
 Is currently null. More...
 
 isValid ()
 Is currently valid. More...
 
 getValidationErrors ()
 Get all validation error codes. More...
 
 translateErrorCode ($a_code)
 Translate error-code to human-readable message. More...
 
 getCheckSum ()
 Get unique checksum. More...
 

Protected Member Functions

 isValidDefinition (ilADTDefinition $a_def)
 
- Protected Member Functions inherited from ilADT
 reset ()
 Init property defaults. More...
 
 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT. More...
 
 setDefinition (ilADTDefinition $a_def)
 Set definition. More...
 
 getDefinition ()
 Get definition. More...
 
 addValidationError ($a_error_code)
 Add validation error code. More...
 

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"
 
const ADT_VALIDATION_ERROR_INVALID_NODE = 'adt7'
 

Detailed Description

Definition at line 3 of file class.ilADTInternalLink.php.

Member Function Documentation

◆ equals()

ilADTInternalLink::equals ( ilADT  $a_adt)
Parameters
ilADT$a_adt
Returns
type

Definition at line 50 of file class.ilADTInternalLink.php.

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

51  {
52  if ($this->getDefinition()->isComparableTo($a_adt)) {
53  return strcmp($this->getCheckSum(), $a_adt->getCheckSum()) === 0;
54  }
55  }
getCheckSum()
Get unique checksum.
getDefinition()
Get definition.
Definition: class.ilADT.php:97
+ Here is the call graph for this function:

◆ getCheckSum()

ilADTInternalLink::getCheckSum ( )

get checksum

Returns
string

Definition at line 107 of file class.ilADTInternalLink.php.

References getTargetRefId(), and isNull().

Referenced by equals().

108  {
109  if (!$this->isNull()) {
110  return md5($this->getTargetRefId());
111  }
112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetRefId()

ilADTInternalLink::getTargetRefId ( )
Returns
int get target ref_id

Definition at line 40 of file class.ilADTInternalLink.php.

References $value.

Referenced by getCheckSum(), and isNull().

41  {
42  return $this->value;
43  }
+ Here is the caller graph for this function:

◆ isLarger()

ilADTInternalLink::isLarger ( ilADT  $a_adt)

Is larger.

Parameters
ilADT$a_adt

Definition at line 61 of file class.ilADTInternalLink.php.

62  {
63  }

◆ isNull()

ilADTInternalLink::isNull ( )

is null

Returns
bool

Definition at line 77 of file class.ilADTInternalLink.php.

References getTargetRefId().

Referenced by getCheckSum(), and isValid().

78  {
79  return (bool) !$this->getTargetRefId();
80  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSmaller()

ilADTInternalLink::isSmaller ( ilADT  $a_adt)

Is smaller.

Parameters
ilADT$a_adt

Definition at line 69 of file class.ilADTInternalLink.php.

70  {
71  }

◆ isValid()

ilADTInternalLink::isValid ( )

is valid

Returns
boolean

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

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

88  {
89  $valid = parent::isValid();
90  if (!$this->isNull()) {
91  $tree = $GLOBALS['DIC']->repositoryTree();
92  if (
93  !$tree->isInTree($this->getTargetRefId()) ||
94  $tree->isDeleted($this->getTargetRefId())
95  ) {
96  $this->valid = false;
97  $this->addValidationError(self::ADT_VALIDATION_ERROR_INVALID_NODE);
98  }
99  }
100  return $valid;
101  }
$valid
addValidationError($a_error_code)
Add validation error code.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

◆ isValidDefinition()

ilADTInternalLink::isValidDefinition ( ilADTDefinition  $a_def)
protected
Parameters
ilADTDefinition$a_def
Returns
bool

Definition at line 14 of file class.ilADTInternalLink.php.

◆ reset()

ilADTInternalLink::reset ( )

Reset.

Definition at line 22 of file class.ilADTInternalLink.php.

23  {
24  parent::reset();
25  $this->value = null;
26  }

◆ setTargetRefId()

ilADTInternalLink::setTargetRefId (   $a_value)

Set id of target object.

Parameters
type$a_value

Definition at line 32 of file class.ilADTInternalLink.php.

33  {
34  $this->value = $a_value;
35  }

Field Documentation

◆ $value

ilADTInternalLink::$value
protected

Definition at line 8 of file class.ilADTInternalLink.php.

Referenced by getTargetRefId().


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