ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAccessibilityDocumentCriterionAssignment.php
Go to the documentation of this file.
1<?php
2
23{
24 public const TABLE_NAME = 'acc_criterion_to_doc';
25
34 protected ?int $id = null;
35
42 protected int $assigned_ts = 0;
43
50 protected int $modification_ts = 0;
51
58 protected int $doc_id = 0;
59
67 protected string $criterion_id = '';
68
75 protected string $criterion_value = '';
76
83 protected int $owner_usr_id = 0;
84
91 protected int $last_modified_usr_id = 0;
92
93 public static function returnDbTableName(): string
94 {
95 return self::TABLE_NAME;
96 }
97
98 public function create(): void
99 {
100 $this->setAssignedTs(time());
101
102 parent::create();
103 }
104
105 public function update(): void
106 {
107 $this->setModificationTs(time());
108
109 parent::update();
110 }
111
113 {
114 $this->criterion_value = $config->toJson();
115 }
116
118 {
119 return new ilAccessibilityCriterionConfig($this->criterion_value);
120 }
121
122 public function getCriterionId(): string
123 {
124 return $this->criterion_id;
125 }
126
127 public function equals($other): bool
128 {
129 if (!($other instanceof static)) {
130 return false;
131 }
132
133 $criterionIdCurrent = $this->getCriterionId();
134 $criterionIdNew = $other->getCriterionId();
135
136 $valueCurrent = $this->getCriterionValue();
137 $valueNew = $other->getCriterionValue();
138
139 $equals = (
140 $criterionIdCurrent == $criterionIdNew &&
141 $valueCurrent == $valueNew
142 );
143
144 return $equals;
145 }
146}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...