ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAccessibilityDocumentCriterionAssignment.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 {
9  const TABLE_NAME = 'acc_criterion_to_doc';
10 
19  protected $id;
20 
27  protected $assigned_ts = 0;
28 
35  protected $modification_ts = 0;
36 
43  protected $doc_id = 0;
44 
52  protected $criterion_id = '';
53 
60  protected $criterion_value = '';
61 
68  protected $owner_usr_id = 0;
69 
76  protected $last_modified_usr_id = 0;
77 
81  public static function returnDbTableName()
82  {
83  return self::TABLE_NAME;
84  }
85 
89  public function create()
90  {
91  $this->setAssignedTs(time());
92 
93  parent::create();
94  }
95 
99  public function update()
100  {
101  $this->setModificationTs(time());
102 
103  parent::update();
104  }
105 
110  {
111  $this->criterion_value = $config->toJson();
112  }
113 
118  {
119  return new ilAccessibilityCriterionConfig($this->criterion_value);
120  }
121 
125  public function getCriterionId() : string
126  {
127  return $this->criterion_id;
128  }
129 
133  public function equals($other) : bool
134  {
135  if (!($other instanceof static)) {
136  return false;
137  }
138 
139  $criterionIdCurrent = $this->getCriterionId();
140  $criterionIdNew = $other->getCriterionId();
141 
142  $valueCurrent = $this->getCriterionValue();
143  $valueNew = $other->getCriterionValue();
144 
145  $equals = (
146  $criterionIdCurrent == $criterionIdNew &&
147  $valueCurrent == $valueNew
148  );
149 
150  return $equals;
151  }
152 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class ilAccessibilityCriterionConfig.
Interface ilAccessibilityEvaluableCriterion.
Interface ilAccessibilityEquatable.