ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilMDEducational.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
32  'active' => 'Active',
33  'expositive' => 'Expositive',
34  'mixed' => 'Mixed'
35  ];
36 
38  'exercise' => 'Exercise',
39  'simulation' => 'Simulation',
40  'questionnaire' => 'Questionnaire',
41  'diagram' => 'Diagram',
42  'figure' => 'Figure',
43  'graph' => 'Graph',
44  'index' => 'Index',
45  'slide' => 'Slide',
46  'table' => 'Table',
47  'narrative text' => 'NarrativeText',
48  'exam' => 'Exam',
49  'experiment' => 'Experiment',
50  'problem statement' => 'ProblemStatement',
51  'self assessment' => 'SelfAssessment',
52  'lecture' => 'Lecture'
53  ];
54 
56  'very low' => 'VeryLow',
57  'low' => 'Low',
58  'medium' => 'Medium',
59  'high' => 'High',
60  'very high' => 'VeryHigh'
61  ];
62 
63  private const SEMANTIC_DENSITY_TRANSLATION = [
64  'very low' => 'VeryLow',
65  'low' => 'Low',
66  'medium' => 'Medium',
67  'high' => 'High',
68  'very high' => 'VeryHigh'
69  ];
70 
72  'teacher' => 'Teacher',
73  'author' => 'Author',
74  'learner' => 'Learner',
75  'manager' => 'Manager'
76  ];
77 
78  private const CONTEXT_TRANSLATION = [
79  'school' => 'School',
80  'higher education' => 'HigherEducation',
81  'training' => 'Training',
82  'other' => 'Other'
83  ];
84 
85  private const DIFFICULTY_TRANSLATION = [
86  'very easy' => 'VeryEasy',
87  'easy' => 'Easy',
88  'medium' => 'Medium',
89  'difficult' => 'Difficult',
90  'very difficult' => 'VeryDifficult'
91  ];
92 
93  private string $interactivity_type = '';
94  private string $learning_resource_type = '';
95  private string $interactivity_level = '';
96  private string $semantic_density = '';
97  private string $intended_end_user_role = '';
98  private string $context = '';
99  private string $difficulty = '';
100  private string $typical_learning_time = '';
101 
102 
106  private int $learning_resource_type_id = 0;
107  private int $intended_end_user_role_id = 0;
108  private int $context_id = 0;
109 
113  public function getTypicalAgeRangeIds(): array
114  {
116  $this->getRBACId(),
117  $this->getObjId(),
118  $this->getMetaId(),
119  'meta_educational'
120  );
121  }
122 
123  public function getTypicalAgeRange(int $a_typical_age_range_id): ?ilMDTypicalAgeRange
124  {
125  if (!$a_typical_age_range_id) {
126  return null;
127  }
128  $typ = new ilMDTypicalAgeRange();
129  $typ->setMetaId($a_typical_age_range_id);
130 
131  return $typ;
132  }
133 
135  {
136  $typ = new ilMDTypicalAgeRange($this->getRBACId(), $this->getObjId(), $this->getObjType());
137  $typ->setParentId($this->getMetaId());
138  $typ->setParentType('meta_educational');
139 
140  return $typ;
141  }
142 
146  public function getDescriptionIds(): array
147  {
148  return ilMDDescription::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_educational');
149  }
150 
151  public function getDescription(int $a_description_id): ?ilMDDescription
152  {
153  if (!$a_description_id) {
154  return null;
155  }
156  $des = new ilMDDescription();
157  $des->setMetaId($a_description_id);
158 
159  return $des;
160  }
161 
162  public function addDescription(): ilMDDescription
163  {
164  $des = new ilMDDescription($this->getRBACId(), $this->getObjId(), $this->getObjType());
165  $des->setParentId($this->getMetaId());
166  $des->setParentType('meta_educational');
167 
168  return $des;
169  }
170 
174  public function getLanguageIds(): array
175  {
176  return ilMDLanguage::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_educational');
177  }
178 
179  public function getLanguage(int $a_language_id): ?ilMDLanguage
180  {
181  if (!$a_language_id) {
182  return null;
183  }
184  $lan = new ilMDLanguage();
185  $lan->setMetaId($a_language_id);
186 
187  return $lan;
188  }
189 
190  public function addLanguage(): ilMDLanguage
191  {
192  $lan = new ilMDLanguage($this->getRBACId(), $this->getObjId(), $this->getObjType());
193  $lan->setParentId($this->getMetaId());
194  $lan->setParentType('meta_educational');
195 
196  return $lan;
197  }
198 
199  // SET/GET
200  public function setInteractivityType(string $a_iat): bool
201  {
202  switch ($a_iat) {
203  case 'Active':
204  case 'Expositive':
205  case 'Mixed':
206  $this->interactivity_type = $a_iat;
207  return true;
208 
209  default:
210  return false;
211  }
212  }
213 
214  public function getInteractivityType(): string
215  {
217  }
218 
219  public function setLearningResourceType(string $a_lrt): bool
220  {
221  switch ($a_lrt) {
222  case 'Exercise':
223  case 'Simulation':
224  case 'Questionnaire':
225  case 'Diagram':
226  case 'Figure':
227  case 'Graph':
228  case 'Index':
229  case 'Slide':
230  case 'Table':
231  case 'NarrativeText':
232  case 'Exam':
233  case 'Experiment':
234  case 'ProblemStatement':
235  case 'SelfAssessment':
236  case 'Lecture':
237  $this->learning_resource_type = $a_lrt;
238  return true;
239 
240  default:
241  return false;
242  }
243  }
244 
245  public function getLearningResourceType(): string
246  {
248  }
249 
250  public function setInteractivityLevel(string $a_iat): bool
251  {
252  switch ($a_iat) {
253  case 'VeryLow':
254  case 'Low':
255  case 'Medium':
256  case 'High':
257  case 'VeryHigh':
258  $this->interactivity_level = $a_iat;
259  return true;
260 
261  default:
262  return false;
263  }
264  }
265 
266  public function getInteractivityLevel(): string
267  {
269  }
270 
271  public function setSemanticDensity(string $a_sd): bool
272  {
273  switch ($a_sd) {
274  case 'VeryLow':
275  case 'Low':
276  case 'Medium':
277  case 'High':
278  case 'VeryHigh':
279  $this->semantic_density = $a_sd;
280  return true;
281 
282  default:
283  return false;
284  }
285  }
286 
287  public function getSemanticDensity(): string
288  {
290  }
291 
292  public function setIntendedEndUserRole(string $a_ieur): bool
293  {
294  switch ($a_ieur) {
295  case 'Teacher':
296  case 'Author':
297  case 'Learner':
298  case 'Manager':
299  $this->intended_end_user_role = $a_ieur;
300  return true;
301 
302  default:
303  return false;
304  }
305  }
306 
307  public function getIntendedEndUserRole(): string
308  {
310  }
311 
312  public function setContext(string $a_context): bool
313  {
314  switch ($a_context) {
315  case 'School':
316  case 'HigherEducation':
317  case 'Training':
318  case 'Other':
319  $this->context = $a_context;
320  return true;
321 
322  default:
323  return false;
324  }
325  }
326 
327  public function getContext(): string
328  {
329  return $this->context;
330  }
331 
332  public function setDifficulty(string $a_difficulty): bool
333  {
334  switch ($a_difficulty) {
335  case 'VeryEasy':
336  case 'Easy':
337  case 'Medium':
338  case 'Difficult':
339  case 'VeryDifficult':
340  $this->difficulty = $a_difficulty;
341  return true;
342 
343  default:
344  return false;
345  }
346  }
347 
348  public function getDifficulty(): string
349  {
350  return $this->difficulty;
351  }
352 
354  int $months,
355  int $days,
356  int $hours,
357  int $minutes,
358  int $seconds
359  ): bool {
360  if (!$months && !$days && !$hours && !$minutes && !$seconds) {
361  $this->setTypicalLearningTime('PT00H00M');
362  return true;
363  }
364  $tlt = 'P';
365  if ($months) {
366  $tlt .= ($months . 'M');
367  }
368  if ($days) {
369  $tlt .= ($days . 'D');
370  }
371  if ($hours || $minutes || $seconds) {
372  $tlt .= 'T';
373  }
374  if ($hours) {
375  $tlt .= ($hours . 'H');
376  }
377  if ($minutes) {
378  $tlt .= ($minutes . 'M');
379  }
380  if ($seconds) {
381  $tlt .= ($seconds . 'S');
382  }
383  $this->setTypicalLearningTime($tlt);
384  return true;
385  }
386 
387  public function setTypicalLearningTime(string $a_tlt): void
388  {
389  $this->typical_learning_time = $a_tlt;
390  }
391 
392  public function getTypicalLearningTime(): string
393  {
395  }
396 
398  {
400  if ($time_arr === []) {
401  return 0;
402  }
403  return 60 * 60 * 24 * 30 * $time_arr[0] + 60 * 60 * 24 * $time_arr[1] + 60 * 60 * $time_arr[2] + 60 * $time_arr[3] + $time_arr[4];
404  }
405 
406  public function save(): int
407  {
408  $fields = $this->__getFields();
409  $fields['meta_educational_id'] = array('integer', $next_id = $this->db->nextId('il_meta_educational'));
410 
411  if ($this->db->insert('il_meta_educational', $fields)) {
412  $this->setMetaId($next_id);
415  $this->createOrUpdateContext();
416  return $this->getMetaId();
417  }
418  return 0;
419  }
420 
421  public function update(): bool
422  {
423  if (!$this->getMetaId()) {
424  return false;
425  }
426 
429  $this->createOrUpdateContext();
430 
431  return (bool) $this->db->update(
432  'il_meta_educational',
433  $this->__getFields(),
434  array("meta_educational_id" => array('integer', $this->getMetaId()))
435  );
436  }
437 
438  public function delete(): bool
439  {
440  if ($this->getMetaId()) {
441  $query = "DELETE FROM il_meta_educational " .
442  "WHERE meta_educational_id = " . $this->db->quote($this->getMetaId(), ilDBConstants::T_INTEGER);
443  $res = $this->db->manipulate($query);
444 
447  $this->deleteAllContexts();
448 
449  foreach ($this->getTypicalAgeRangeIds() as $id) {
450  $typ = $this->getTypicalAgeRange($id);
451  $typ->delete();
452  }
453  foreach ($this->getDescriptionIds() as $id) {
454  $des = $this->getDescription($id);
455  $des->delete();
456  }
457  foreach ($this->getLanguageIds() as $id) {
458  $lan = $this->getLanguage($id);
459  $lan->delete();
460  }
461 
462  return true;
463  }
464  return false;
465  }
466 
470  public function __getFields(): array
471  {
475  $interactivity_type = (string) array_search(
476  $this->getInteractivityType(),
477  self::INTERACTIVITY_TYPE_TRANSLATION
478  );
479  $interactivity_level = (string) array_search(
480  $this->getInteractivityLevel(),
481  self::INTERACTIVITY_LEVEL_TRANSLATION
482  );
483  $semantic_density = (string) array_search(
484  $this->getSemanticDensity(),
485  self::SEMANTIC_DENSITY_TRANSLATION
486  );
487  $difficulty = (string) array_search(
488  $this->getDifficulty(),
489  self::DIFFICULTY_TRANSLATION
490  );
491 
492  return array(
493  'rbac_id' => array('integer', $this->getRBACId()),
494  'obj_id' => array('integer', $this->getObjId()),
495  'obj_type' => array('text', $this->getObjType()),
496  'interactivity_type' => array('text', $interactivity_type),
497  //'learning_resource_type' => array('text', $this->getLearningResourceType()),
498  'interactivity_level' => array('text', $interactivity_level),
499  'semantic_density' => array('text', $semantic_density),
500  //'intended_end_user_role' => array('text', $this->getIntendedEndUserRole()),
501  //'context' => array('text', $this->getContext()),
502  'difficulty' => array('text', $difficulty),
503  'typical_learning_time' => array('text', $this->getTypicalLearningTime())
504  );
505  }
506 
507  public function read(): bool
508  {
509  if ($this->getMetaId()) {
510  $query = "SELECT * FROM il_meta_educational " .
511  "WHERE meta_educational_id = " . $this->db->quote($this->getMetaId(), 'integer');
512 
513  $res = $this->db->query($query);
514  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
518  if (key_exists($row->interactivity_type ?? '', self::INTERACTIVITY_TYPE_TRANSLATION)) {
519  $row->interactivity_type = self::INTERACTIVITY_TYPE_TRANSLATION[$row->interactivity_type ?? ''];
520  }
521  if (key_exists($row->interactivity_level ?? '', self::INTERACTIVITY_LEVEL_TRANSLATION)) {
522  $row->interactivity_level = self::INTERACTIVITY_LEVEL_TRANSLATION[$row->interactivity_level ?? ''];
523  }
524  if (key_exists($row->semantic_density ?? '', self::SEMANTIC_DENSITY_TRANSLATION)) {
525  $row->semantic_density = self::SEMANTIC_DENSITY_TRANSLATION[$row->semantic_density ?? ''];
526  }
527  if (key_exists($row->difficulty ?? '', self::DIFFICULTY_TRANSLATION)) {
528  $row->difficulty = self::DIFFICULTY_TRANSLATION[$row->difficulty ?? ''];
529  }
530 
531  $this->setRBACId((int) $row->rbac_id);
532  $this->setObjId((int) $row->obj_id);
533  $this->setObjType($row->obj_type ?? '');
534  $this->setInteractivityType($row->interactivity_type ?? '');
535  //$this->setLearningResourceType($row->learning_resource_type ?? '');
536  $this->setInteractivityLevel($row->interactivity_level ?? '');
537  $this->setSemanticDensity($row->semantic_density ?? '');
538  //$this->setIntendedEndUserRole($row->intended_end_user_role ?? '');
539  //$this->setContext($row->context ?? '');
540  $this->setDifficulty($row->difficulty ?? '');
541  $this->setTypicalLearningTime($row->typical_learning_time ?? '');
542  }
543 
546  $this->readFirstContext();
547  return true;
548  }
549  return false;
550  }
551 
552  public function toXML(ilXmlWriter $writer): void
553  {
554  $writer->xmlStartTag(
555  'Educational',
556  array(
557  'InteractivityType' => $this->getInteractivityType() ?: 'Active',
558  'LearningResourceType' => $this->getLearningResourceType() ?: 'Exercise',
559  'InteractivityLevel' => $this->getInteractivityLevel() ?: 'Medium',
560  'SemanticDensity' => $this->getSemanticDensity() ?: 'Medium',
561  'IntendedEndUserRole' => $this->getIntendedEndUserRole() ?: 'Learner',
562  'Context' => $this->getContext() ?: 'Other',
563  'Difficulty' => $this->getDifficulty() ?: 'Medium'
564  )
565  );
566 
567  // TypicalAgeRange
568  $typ_ages = $this->getTypicalAgeRangeIds();
569  foreach ($typ_ages as $id) {
570  $key = $this->getTypicalAgeRange($id);
571 
572  // extra test due to bug 5316 (may be due to eLaix import)
573  if (is_object($key)) {
574  $key->toXML($writer);
575  }
576  }
577  if (!count($typ_ages)) {
578  $typ = new ilMDTypicalAgeRange($this->getRBACId(), $this->getObjId());
579  $typ->toXML($writer);
580  }
581 
582  // TypicalLearningTime
583  $writer->xmlElement('TypicalLearningTime', null, $this->getTypicalLearningTime());
584 
585  // Description
586  foreach ($this->getDescriptionIds() as $id) {
587  $key = $this->getDescription($id);
588  $key->toXML($writer);
589  }
590  // Language
591  foreach ($this->getLanguageIds() as $id) {
592  $lang = $this->getLanguage($id);
593  $lang->toXML($writer);
594  }
595  $writer->xmlEndTag('Educational');
596  }
597 
598  // STATIC
599  public static function _getId(int $a_rbac_id, int $a_obj_id): int
600  {
601  global $DIC;
602 
603  $ilDB = $DIC->database();
604 
605  $query = "SELECT meta_educational_id FROM il_meta_educational " .
606  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
607  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
608 
609  $res = $ilDB->query($query);
610  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
611  return (int) $row->meta_educational_id;
612  }
613  return 0;
614  }
615 
616  public static function _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id = 0): int
617  {
618  global $DIC;
619 
620  $ilDB = $DIC->database();
621 
622  $a_obj_id = $a_obj_id ?: $a_rbac_id;
623 
624  $query = "SELECT typical_learning_time FROM il_meta_educational " .
625  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
626  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
627  $res = $ilDB->query($query);
628  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
629  $time_arr = ilMDUtils::_LOMDurationToArray((string) $row->typical_learning_time);
630  if (!count($time_arr)) {
631  return 0;
632  }
633  return 60 * 60 * 24 * 30 * $time_arr[0] +
634  60 * 60 * 24 * $time_arr[1] +
635  60 * 60 * $time_arr[2] +
636  60 * $time_arr[3] +
637  $time_arr[4];
638  }
639  return 0;
640  }
641 
645  protected function createOrUpdateLearningResourceType(): void
646  {
647  $learning_resource_type = (string) array_search(
648  $this->getLearningResourceType(),
649  self::LEARNING_RESOURCE_TYPE_TRANSLATION
650  );
651 
652  $this->learning_resource_type_id = $this->createOrUpdateInNewTable(
653  'il_meta_lr_type',
654  'meta_lr_type_id',
655  $this->getLearningResourceTypeId(),
656  'learning_resource_type',
657  $learning_resource_type
658  );
659  }
660 
664  protected function createOrUpdateIntendedEndUserRole(): void
665  {
666  $intended_end_user_role = (string) array_search(
667  $this->getIntendedEndUserRole(),
668  self::INTENDED_END_USER_ROLE_TRANSLATION
669  );
670 
671  $this->intended_end_user_role_id = $this->createOrUpdateInNewTable(
672  'il_meta_end_usr_role',
673  'meta_end_usr_role_id',
674  $this->getIntendedEndUserRoleId(),
675  'intended_end_user_role',
676  $intended_end_user_role
677  );
678  }
679 
683  protected function createOrUpdateContext(): void
684  {
685  $context = (string) array_search(
686  $this->getContext(),
687  self::CONTEXT_TRANSLATION
688  );
689 
690  $this->context_id = $this->createOrUpdateInNewTable(
691  'il_meta_context',
692  'meta_context_id',
693  $this->getContextId(),
694  'context',
695  $context
696  );
697  }
698 
702  protected function createOrUpdateInNewTable(
703  string $table,
704  string $id_field,
705  int $id,
706  string $data_field,
707  string $data_value
708  ): int {
709  if ($data_value === '') {
710  return 0;
711  }
712 
713  if (!$id) {
714  $this->db->insert(
715  $table,
716  [
717  $id_field => ['integer', $next_id = $this->db->nextId($table)],
718  'rbac_id' => ['integer', $this->getRBACId()],
719  'obj_id' => ['integer', $this->getObjId()],
720  'obj_type' => ['text', $this->getObjType()],
721  'parent_type' => ['text', 'meta_educational'],
722  'parent_id' => ['integer', $this->getMetaId()],
723  $data_field => ['text', $data_value]
724  ]
725  );
726  return $next_id;
727  }
728 
729  $this->db->update(
730  $table,
731  [$data_field => ['text', $data_value]],
732  [$id_field => ['integer', $id]]
733  );
734  return $id;
735  }
736 
740  protected function readFirstLearningResourceType(): void
741  {
742  $query = "SELECT * FROM il_meta_lr_type WHERE meta_lr_type_id = " .
743  $this->db->quote($this->getLearningResourceTypeId(), 'integer');
744 
745  $res = $this->db->query($query);
746  if ($row = $this->db->fetchAssoc($res)) {
747  if (key_exists($row['learning_resource_type'], self::LEARNING_RESOURCE_TYPE_TRANSLATION)) {
748  $row['learning_resource_type'] = self::LEARNING_RESOURCE_TYPE_TRANSLATION[$row['learning_resource_type']];
749  }
750  $this->setLearningResourceType((string) $row['learning_resource_type']);
751  }
752  }
753 
757  protected function readFirstIntendedEndUserRole(): void
758  {
759  $query = "SELECT * FROM il_meta_end_usr_role WHERE meta_end_usr_role_id = " .
760  $this->db->quote($this->getIntendedEndUserRoleId(), 'integer');
761 
762  $res = $this->db->query($query);
763  if ($row = $this->db->fetchAssoc($res)) {
764  if (key_exists($row['intended_end_user_role'], self::INTENDED_END_USER_ROLE_TRANSLATION)) {
765  $row['intended_end_user_role'] = self::INTENDED_END_USER_ROLE_TRANSLATION[$row['intended_end_user_role']];
766  }
767  $this->setIntendedEndUserRole((string) $row['intended_end_user_role']);
768  }
769  }
770 
774  protected function readFirstContext(): void
775  {
776  $query = "SELECT * FROM il_meta_context WHERE meta_context_id = " .
777  $this->db->quote($this->getContextId(), 'integer');
778 
779  $res = $this->db->query($query);
780  if ($row = $this->db->fetchAssoc($res)) {
781  if (key_exists($row['context'], self::CONTEXT_TRANSLATION)) {
782  $row['context'] = self::CONTEXT_TRANSLATION[$row['context']];
783  }
784  $this->setContext((string) $row['context']);
785  }
786  }
787 
791  protected function deleteAllLearningResourceTypes(): void
792  {
793  $query = "DELETE FROM il_meta_lr_type WHERE parent_type = 'meta_educational'
794  AND parent_id = " . $this->db->quote($this->getMetaId(), 'integer');
795  $res = $this->db->manipulate($query);
796  }
797 
801  protected function deleteAllIntendedEndUserRoles(): void
802  {
803  $query = "DELETE FROM il_meta_end_usr_role WHERE parent_type = 'meta_educational'
804  AND parent_id = " . $this->db->quote($this->getMetaId(), 'integer');
805  $res = $this->db->manipulate($query);
806  }
807 
811  protected function deleteAllContexts(): void
812  {
813  $query = "DELETE FROM il_meta_context WHERE parent_type = 'meta_educational'
814  AND parent_id = " . $this->db->quote($this->getMetaId(), 'integer');
815  $res = $this->db->manipulate($query);
816  }
817 
821  protected function getLearningResourceTypeId(): int
822  {
824  }
825 
829  protected function getIntendedEndUserRoleId(): int
830  {
832  }
833 
837  protected function getContextId(): int
838  {
839  return $this->context_id;
840  }
841 
845  protected function readLearningResourceTypeId(int $parent_id): void
846  {
847  $query = "SELECT meta_lr_type_id FROM il_meta_lr_type WHERE parent_type = 'meta_educational'
848  AND parent_id = " . $this->db->quote($parent_id, 'integer') .
849  " ORDER BY meta_lr_type_id";
850 
851  $res = $this->db->query($query);
852  if ($row = $this->db->fetchAssoc($res)) {
853  $this->learning_resource_type_id = (int) $row['meta_lr_type_id'];
854  }
855  }
856 
860  protected function readIntendedEndUserRoleId(int $parent_id): void
861  {
862  $query = "SELECT meta_end_usr_role_id FROM il_meta_end_usr_role WHERE parent_type = 'meta_educational'
863  AND parent_id = " . $this->db->quote($parent_id, 'integer') .
864  " ORDER BY meta_end_usr_role_id";
865 
866  $res = $this->db->query($query);
867  if ($row = $this->db->fetchAssoc($res)) {
868  $this->intended_end_user_role_id = (int) $row['meta_end_usr_role_id'];
869  }
870  }
871 
875  protected function readContextId(int $parent_id): void
876  {
877  $query = "SELECT meta_context_id FROM il_meta_context WHERE parent_type = 'meta_educational'
878  AND parent_id = " . $this->db->quote($parent_id, 'integer') .
879  " ORDER BY meta_context_id";
880 
881  $res = $this->db->query($query);
882  if ($row = $this->db->fetchAssoc($res)) {
883  $this->context_id = (int) $row['meta_context_id'];
884  }
885  }
886 
890  public function setMetaId(int $a_meta_id, bool $a_read_data = true): void
891  {
892  $this->readLearningResourceTypeId($a_meta_id);
893  $this->readIntendedEndUserRoleId($a_meta_id);
894  $this->readContextId($a_meta_id);
895  parent::setMetaId($a_meta_id, $a_read_data);
896  }
897 }
readFirstIntendedEndUserRole()
Compatibility fix for legacy MD classes for new db tables.
$res
Definition: ltiservices.php:69
static _LOMDurationToArray(string $a_string)
LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) T...
const const const const const INTENDED_END_USER_ROLE_TRANSLATION
readContextId(int $parent_id)
Compatibility fix for legacy MD classes for new db tables.
readFirstLearningResourceType()
Compatibility fix for legacy MD classes for new db tables.
setTypicalLearningTime(string $a_tlt)
getTypicalAgeRange(int $a_typical_age_range_id)
setIntendedEndUserRole(string $a_ieur)
createOrUpdateLearningResourceType()
Compatibility fix for legacy MD classes for new db tables.
createOrUpdateIntendedEndUserRole()
Compatibility fix for legacy MD classes for new db tables.
getDescription(int $a_description_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInteractivityLevel(string $a_iat)
setMetaId(int $a_meta_id, bool $a_read_data=true)
Compatibility fix for legacy MD classes for new db tables.
deleteAllLearningResourceTypes()
Compatibility fix for legacy MD classes for new db tables.
getIntendedEndUserRoleId()
Compatibility fix for legacy MD classes for new db tables.
deleteAllContexts()
Compatibility fix for legacy MD classes for new db tables.
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
setRBACId(int $a_id)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
deleteAllIntendedEndUserRoles()
Compatibility fix for legacy MD classes for new db tables.
static _getId(int $a_rbac_id, int $a_obj_id)
int $learning_resource_type_id
Compatibility fix for legacy MD classes for new db tables.
xmlEndTag(string $tag)
Writes an endtag.
const const const INTERACTIVITY_LEVEL_TRANSLATION
global $DIC
Definition: feed.php:28
readFirstContext()
Compatibility fix for legacy MD classes for new db tables.
setObjId(int $a_id)
static _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id=0)
setInteractivityType(string $a_iat)
setContext(string $a_context)
const const const const const const const DIFFICULTY_TRANSLATION
const const const const SEMANTIC_DENSITY_TRANSLATION
setDifficulty(string $a_difficulty)
const const LEARNING_RESOURCE_TYPE_TRANSLATION
string $key
Consumer key/client ID value.
Definition: System.php:193
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
getContextId()
Compatibility fix for legacy MD classes for new db tables.
getLanguage(int $a_language_id)
setLearningResourceType(string $a_lrt)
$lang
Definition: xapiexit.php:26
const const const const const const const string $interactivity_type
readIntendedEndUserRoleId(int $parent_id)
Compatibility fix for legacy MD classes for new db tables.
createOrUpdateInNewTable(string $table, string $id_field, int $id, string $data_field, string $data_value)
Compatibility fix for legacy MD classes for new db tables.
setSemanticDensity(string $a_sd)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
const INTERACTIVITY_TYPE_TRANSLATION
Compatibility fix for legacy MD classes for new db tables.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
createOrUpdateContext()
Compatibility fix for legacy MD classes for new db tables.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
toXML(ilXmlWriter $writer)
getLearningResourceTypeId()
Compatibility fix for legacy MD classes for new db tables.
setObjType(string $a_type)
setPhysicalTypicalLearningTime(int $months, int $days, int $hours, int $minutes, int $seconds)
readLearningResourceTypeId(int $parent_id)
Compatibility fix for legacy MD classes for new db tables.
const const const const const const CONTEXT_TRANSLATION