ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSExport Class Reference

Storage of ECS exported objects. More...

+ Collaboration diagram for ilECSExport:

Public Member Functions

 __construct ($a_server_id, $a_obj_id)
 Constructor. More...
 
 getServerId ()
 Get server id. More...
 
 setServerId ($a_server_id)
 Set server id. More...
 
 setExported ($a_status)
 Set exported. More...
 
 isExported ()
 check if an object is exported or not More...
 
 setEContentId ($a_id)
 set econtent id More...
 
 getEContentId ()
 get econtent id More...
 
 save ()
 Save. More...
 

Static Public Member Functions

static _isExported ($a_obj_id)
 Check if object is exported. More...
 
static _getAllEContentIds ($a_server_id)
 get all exported econtent ids per server More...
 
static getExportedIds ()
 Get exported ids @global ilDB $ilDB. More...
 
static getExportedIdsByType ($a_type)
 Get exported ids by type @global ilDB $ilDB. More...
 
static getExportServerIds ($a_obj_id)
 lookup server ids of exported materials @global ilDB $ilDB More...
 
static _getExportedIDsByServer ($a_server_id)
 get exported ids for server More...
 
static lookupServerIds ($a_obj_id)
 Lookup server ids of exported objects @global ilDB $ilDB. More...
 
static _deleteEContentIds ($a_server_id, $a_ids)
 Delete econtent ids for server. More...
 
static deleteByServer ($a_server_id)
 Delete by server id @global ilDB $ilDB. More...
 
static _isRemote ($a_server_id, $a_econtent_id)
 is remote object More...
 
static deleteByServerId ($a_server_id)
 

Protected Attributes

 $db = null
 
 $server_id = 0
 
 $obj_id = 0
 
 $econtent_id = 0
 
 $exported = false
 

Private Member Functions

 read ()
 Read @access private. More...
 

Detailed Description

Storage of ECS exported objects.

This class stores the econent id and informations whether an object is exported or not.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 34 of file class.ilECSExport.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSExport::__construct (   $a_server_id,
  $a_obj_id 
)

Constructor.

@access public

Parameters

Definition at line 50 of file class.ilECSExport.php.

51 {
52 global $ilDB;
53
54 $this->server_id = $a_server_id;
55 $this->obj_id = $a_obj_id;
56
57 $this->db = $ilDB;
58 $this->read();
59 }
read()
Read @access private.
global $ilDB

References $ilDB, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _deleteEContentIds()

static ilECSExport::_deleteEContentIds (   $a_server_id,
  $a_ids 
)
static

Delete econtent ids for server.

@access public

Parameters
arrayarray of econtent ids

Definition at line 221 of file class.ilECSExport.php.

222 {
223 global $ilDB;
224
225 if (!is_array($a_ids) or !count($a_ids)) {
226 return true;
227 }
228 #$query = "DELETE FROM ecs_export WHERE econtent_id IN (".implode(',',ilUtil::quoteArray($a_ids)).')';
229 $query = "DELETE FROM ecs_export WHERE " . $ilDB->in('econtent_id', $a_ids, false, 'integer') . ' ' .
230 'AND server_id = ' . $ilDB->quote($a_server_id, 'integer');
231 $res = $ilDB->manipulate($query);
232 return true;
233 }
$query
foreach($_POST as $key=> $value) $res

References $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleExportReset().

+ Here is the caller graph for this function:

◆ _getAllEContentIds()

static ilECSExport::_getAllEContentIds (   $a_server_id)
static

get all exported econtent ids per server

@access public

Definition at line 105 of file class.ilECSExport.php.

106 {
107 global $ilDB;
108
109 $query = "SELECT econtent_id,obj_id FROM ecs_export " .
110 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
111
112 $res = $ilDB->query($query);
113 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
114 $econtent_ids[$row->econtent_id] = $row->obj_id;
115 }
116 return $econtent_ids ? $econtent_ids : array();
117 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSEventQueueReader\handleExportReset().

+ Here is the caller graph for this function:

◆ _getExportedIDsByServer()

static ilECSExport::_getExportedIDsByServer (   $a_server_id)
static

get exported ids for server

@access public

Returns

Definition at line 181 of file class.ilECSExport.php.

182 {
183 global $ilDB;
184 $query = "SELECT obj_id FROM ecs_export " .
185 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
186 $res = $ilDB->query($query);
187 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188 $obj_ids[] = $row->obj_id;
189 }
190 return $obj_ids ? $obj_ids : array();
191 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

◆ _isExported()

static ilECSExport::_isExported (   $a_obj_id)
static

Check if object is exported.

Parameters
int$a_obj_id
Returns
bool

Definition at line 84 of file class.ilECSExport.php.

85 {
86 global $ilDB;
87
88 $query = 'SELECT * FROM ecs_export ' .
89 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
90 $res = $ilDB->query($query);
91 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
92 return true;
93 }
94 return false;
95 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\addSettingsToForm().

+ Here is the caller graph for this function:

◆ _isRemote()

static ilECSExport::_isRemote (   $a_server_id,
  $a_econtent_id 
)
static

is remote object

@access public

Parameters
intecontent_id

Definition at line 257 of file class.ilECSExport.php.

258 {
259 global $ilDB;
260
261 $query = "SELECT obj_id FROM ecs_export " .
262 "WHERE econtent_id = " . $ilDB->quote($a_econtent_id, 'integer') . " " .
263 'AND server_id = ' . $ilDB->quote($a_server_id, 'integer');
264 $res = $ilDB->query($query);
265 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
266 return false;
267 }
268 return true;
269 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjRemoteCategoryListGUI\getCommandFrame(), ilObjRemoteCourseListGUI\getCommandFrame(), ilObjRemoteFileListGUI\getCommandFrame(), ilObjRemoteGlossaryListGUI\getCommandFrame(), ilObjRemoteGroupListGUI\getCommandFrame(), ilObjRemoteLearningModuleListGUI\getCommandFrame(), ilObjRemoteTestListGUI\getCommandFrame(), ilObjRemoteWikiListGUI\getCommandFrame(), and ilRemoteObjectBase\isLocalObject().

+ Here is the caller graph for this function:

◆ deleteByServer()

static ilECSExport::deleteByServer (   $a_server_id)
static

Delete by server id @global ilDB $ilDB.

Parameters
int$a_server_id

Definition at line 240 of file class.ilECSExport.php.

241 {
242 global $ilDB;
243
244 $query = 'DELETE FROM ecs_export ' .
245 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
246 $ilDB->manipulate($query);
247 }

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSExport::deleteByServerId (   $a_server_id)
static

Definition at line 363 of file class.ilECSExport.php.

364 {
365 global $ilDB;
366
367 $query = 'DELETE FROM ecs_export' .
368 ' WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
369 $ilDB->manipulate($query);
370 return true;
371 }

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

+ Here is the caller graph for this function:

◆ getEContentId()

ilECSExport::getEContentId ( )

get econtent id

@access public

Returns
int econtent id

Definition at line 313 of file class.ilECSExport.php.

314 {
315 return $this->econtent_id;
316 }

References $econtent_id.

Referenced by ilECSObjectSettings\doDelete(), ilECSObjectSettings\doUpdate(), and save().

+ Here is the caller graph for this function:

◆ getExportedIds()

static ilECSExport::getExportedIds ( )
static

Get exported ids @global ilDB $ilDB.

Returns
array

Definition at line 124 of file class.ilECSExport.php.

125 {
126 global $ilDB;
127 $query = "SELECT obj_id FROM ecs_export ";
128 $res = $ilDB->query($query);
129 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
130 $obj_ids[] = $row->obj_id;
131 }
132 return $obj_ids ? $obj_ids : array();
133 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\_handleDelete(), and ilECSSettingsGUI\exportReleased().

+ Here is the caller graph for this function:

◆ getExportedIdsByType()

static ilECSExport::getExportedIdsByType (   $a_type)
static

Get exported ids by type @global ilDB $ilDB.

Returns
array

Definition at line 140 of file class.ilECSExport.php.

141 {
142 global $ilDB;
143 $query = "SELECT e.obj_id FROM ecs_export e" .
144 " JOIN object_data o ON (e.obj_id = o.obj_id)" .
145 " WHERE o.type = " . $ilDB->quote($a_type, "text");
146 $res = $ilDB->query($query);
147 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
148 $obj_ids[] = $row->obj_id;
149 }
150 return $obj_ids ? $obj_ids : array();
151 }
$a_type
Definition: workflow.php:92

References $a_type, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSSettingsGUI\released().

+ Here is the caller graph for this function:

◆ getExportServerIds()

static ilECSExport::getExportServerIds (   $a_obj_id)
static

lookup server ids of exported materials @global ilDB $ilDB

Parameters
int$a_obj_id
Returns
array

Definition at line 159 of file class.ilECSExport.php.

160 {
161 global $ilDB;
162
163 $query = 'SELECT * FROM ecs_export ' .
164 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
165 $res = $ilDB->query($query);
166
167 $sids = array();
168 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
169 $sids[] = $row->server_id;
170 }
171 return $sids;
172 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\_handleDelete(), ilECSObjectSettings\addSettingsToForm(), and ilECSObjectSettings\handleContentUpdate().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSExport::getServerId ( )

Get server id.

Returns
int

Definition at line 65 of file class.ilECSExport.php.

66 {
67 return $this->server_id;
68 }

References $server_id.

Referenced by read(), and save().

+ Here is the caller graph for this function:

◆ isExported()

ilECSExport::isExported ( )

check if an object is exported or not

@access public

Definition at line 289 of file class.ilECSExport.php.

290 {
291 return (bool) $this->exported;
292 }

References $exported.

Referenced by ilECSObjectSettings\doDelete(), and save().

+ Here is the caller graph for this function:

◆ lookupServerIds()

static ilECSExport::lookupServerIds (   $a_obj_id)
static

Lookup server ids of exported objects @global ilDB $ilDB.

Parameters
<type>$a_obj_id
Returns
<type>

Definition at line 199 of file class.ilECSExport.php.

200 {
201 global $ilDB;
202
203 $query = 'SELECT * FROM ecs_export ' .
204 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ';
205 $res = $ilDB->query($query);
206 $sids = array();
207 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
208 $sids[] = $row->server_id;
209 }
210 return $sids;
211 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSReleasedContentTableGUI\parse().

+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read @access private.

Definition at line 349 of file class.ilECSExport.php.

350 {
351 global $ilDB;
352
353 $query = "SELECT * FROM ecs_export WHERE " .
354 "obj_id = " . $this->db->quote($this->obj_id, 'integer') . " AND " .
355 'server_id = ' . $ilDB->quote($this->getServerId(), 'integer');
356 $res = $this->db->query($query);
357 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
358 $this->econtent_id = $row->econtent_id;
359 $this->exported = true;
360 }
361 }
getServerId()
Get server id.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSExport::save ( )

Save.

@access public

Definition at line 323 of file class.ilECSExport.php.

324 {
325 global $ilDB;
326
327 $query = "DELETE FROM ecs_export " .
328 "WHERE obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
329 'AND server_id = ' . $ilDB->quote($this->getServerId());
330 $res = $ilDB->manipulate($query);
331
332 if ($this->isExported()) {
333 $query = "INSERT INTO ecs_export (server_id,obj_id,econtent_id) " .
334 "VALUES ( " .
335 $this->db->quote($this->getServerId(), 'integer') . ', ' .
336 $this->db->quote($this->obj_id, 'integer') . ", " .
337 $this->db->quote($this->getEContentId(), 'integer') . " " .
338 ")";
339 $res = $ilDB->manipulate($query);
340 }
341
342 return true;
343 }
getEContentId()
get econtent id
isExported()
check if an object is exported or not

References $ilDB, $query, $res, getEContentId(), getServerId(), and isExported().

Referenced by ilECSObjectSettings\doAdd(), and ilECSObjectSettings\doDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEContentId()

ilECSExport::setEContentId (   $a_id)

set econtent id

@access public

Parameters
intecontent id (received from ECS::addResource)

Definition at line 301 of file class.ilECSExport.php.

302 {
303 $this->econtent_id = $a_id;
304 }

Referenced by ilECSObjectSettings\doAdd().

+ Here is the caller graph for this function:

◆ setExported()

ilECSExport::setExported (   $a_status)

Set exported.

@access public

Parameters
boolexport status

Definition at line 278 of file class.ilECSExport.php.

279 {
280 $this->exported = $a_status;
281 }

Referenced by ilECSObjectSettings\doAdd(), and ilECSObjectSettings\doDelete().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSExport::setServerId (   $a_server_id)

Set server id.

Parameters
int$a_server_id

Definition at line 74 of file class.ilECSExport.php.

75 {
76 $this->server_id = $a_server_id;
77 }

Field Documentation

◆ $db

ilECSExport::$db = null
protected

Definition at line 36 of file class.ilECSExport.php.

◆ $econtent_id

ilECSExport::$econtent_id = 0
protected

Definition at line 40 of file class.ilECSExport.php.

Referenced by getEContentId().

◆ $exported

ilECSExport::$exported = false
protected

Definition at line 41 of file class.ilECSExport.php.

Referenced by isExported().

◆ $obj_id

ilECSExport::$obj_id = 0
protected

Definition at line 39 of file class.ilECSExport.php.

◆ $server_id

ilECSExport::$server_id = 0
protected

Definition at line 38 of file class.ilECSExport.php.

Referenced by getServerId().


The documentation for this class was generated from the following file: