ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjRemoteWiki.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once('Services/WebServices/ECS/classes/class.ilRemoteObjectBase.php');
5
16{
17 const DB_TABLE_NAME = "rwik_settings";
18
21
23
24 public function initType()
25 {
26 $this->type = "rwik";
27 }
28
29 protected function getTableName()
30 {
32 }
33
34 protected function getECSObjectType()
35 {
36 return "/campusconnect/wikis";
37 }
38
45 {
46 $this->availability_type = $a_type;
47 }
48
54 public function getAvailabilityType()
55 {
57 }
58
65 public static function _lookupOnline($a_obj_id)
66 {
67 global $ilDB;
68
69 $query = "SELECT * FROM " . self::DB_TABLE_NAME .
70 " WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
71 $res = $ilDB->query($query);
73 switch ($row->availability_type) {
75 return true;
76
78 return false;
79
80 default:
81 return false;
82 }
83
84 return false;
85 }
86
87 protected function doCreateCustomFields(array &$a_fields)
88 {
89 $a_fields["availability_type"] = array("integer", 0);
90 }
91
92 protected function doUpdateCustomFields(array &$a_fields)
93 {
94 $a_fields["availability_type"] = array("integer", $this->getAvailabilityType());
95 }
96
97 protected function doReadCustomFields($a_row)
98 {
99 $this->setAvailabilityType($a_row->availability_type);
100 }
101
102 protected function updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
103 {
104 $this->setAvailabilityType($a_ecs_content->availability == 'online' ? self::ACTIVATION_ONLINE : self::ACTIVATION_OFFLINE);
105 }
106}
An exception for terminatinating execution or to throw for unit testing.
Remote wiki app class.
getECSObjectType()
Get ECS resource identifier, e.g.
static _lookupOnline($a_obj_id)
Lookup online.
getTableName()
Get db table name.
updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
update remote object settings from ecs content
setAvailabilityType($a_type)
Set Availability type.
doUpdateCustomFields(array &$a_fields)
Add custom fields to db update.
doReadCustomFields($a_row)
Read custom fields from db row.
getAvailabilityType()
get availability type
doCreateCustomFields(array &$a_fields)
Add custom fields to db insert.
Remote object app base class.
$query
foreach($_POST as $key=> $value) $res
global $ilDB
$a_type
Definition: workflow.php:92