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