ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilADTInternalLink.php
Go to the documentation of this file.
1 <?php
2 
3 class ilADTInternalLink extends ilADT
4 {
8  protected $value;
9 
14  protected function isValidDefinition(ilADTDefinition $a_def)
15  {
16  return $a_def instanceof ilADTInternalLinkDefinition;
17  }
18 
22  public function reset()
23  {
24  parent::reset();
25  $this->value = null;
26  }
27 
32  public function setTargetRefId($a_value)
33  {
34  $this->value = $a_value;
35  }
36 
40  public function getTargetRefId()
41  {
42  return $this->value;
43  }
44 
50  public function equals(ilADT $a_adt)
51  {
52  if ($this->getDefinition()->isComparableTo($a_adt)) {
53  return strcmp($this->getCheckSum(), $a_adt->getCheckSum()) === 0;
54  }
55  }
56 
61  public function isLarger(ilADT $a_adt)
62  {
63  }
64 
69  public function isSmaller(ilADT $a_adt)
70  {
71  }
72 
77  public function isNull()
78  {
79  return (bool) !$this->getTargetRefId();
80  }
81 
82 
87  public function isValid()
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  }
102 
107  public function getCheckSum()
108  {
109  if (!$this->isNull()) {
110  return md5($this->getTargetRefId());
111  }
112  }
113 }
$valid
addValidationError($a_error_code)
Add validation error code.
ADT base class.
Definition: class.ilADT.php:11
getCheckSum()
Get unique checksum.
ADT definition base class.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
getDefinition()
Get definition.
Definition: class.ilADT.php:97