ILIAS  release_8 Revision v8.24
class.ilObjRemoteLearningModule.php
Go to the documentation of this file.
1<?php
2
18declare(strict_types=1);
19
30{
31 public const DB_TABLE_NAME = "rlm_settings";
32
33 public const ACTIVATION_OFFLINE = 0;
34 public const ACTIVATION_ONLINE = 1;
35
37
38 public function initType(): void
39 {
40 $this->type = "rlm";
41 }
42
43 protected function getTableName(): string
44 {
46 }
47
48 protected function getECSObjectType(): string
49 {
50 return "/campusconnect/learningmodules";
51 }
52
58 public function setAvailabilityType($a_type)
59 {
60 $this->availability_type = $a_type;
61 }
62
68 public function getAvailabilityType()
69 {
71 }
72
79 public static function _lookupOnline($a_obj_id)
80 {
81 global $ilDB;
82
83 $query = "SELECT * FROM " . self::DB_TABLE_NAME .
84 " WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
85 $res = $ilDB->query($query);
86 $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
87 switch ($row->availability_type) {
89 return true;
90
92 return false;
93
94 default:
95 return false;
96 }
97
98 return false;
99 }
100
101 protected function doCreateCustomFields(array &$a_fields): void
102 {
103 $a_fields["availability_type"] = array("integer", 0);
104 }
105
106 protected function doUpdateCustomFields(array &$a_fields): void
107 {
108 $a_fields["availability_type"] = array("integer", $this->getAvailabilityType());
109 }
110
111 protected function doReadCustomFields($a_row): void
112 {
113 $this->setAvailabilityType($a_row->availability_type);
114 }
115
116 protected function updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content): void
117 {
118 $this->setAvailabilityType($a_ecs_content->availability == 'online' ? self::ACTIVATION_ONLINE : self::ACTIVATION_OFFLINE);
119 }
120}
Remote learning module app class.
getECSObjectType()
Get ECS resource identifier, e.g.
updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
update remote object settings from ecs content
doCreateCustomFields(array &$a_fields)
Add custom fields to db insert.
setAvailabilityType($a_type)
Set Availability type.
static _lookupOnline($a_obj_id)
Lookup online.
doUpdateCustomFields(array &$a_fields)
Add custom fields to db update.
Remote object app base class.
$res
Definition: ltiservices.php:69
$query