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 ilDB $ilDB. More...
 
static getExportedIdsByType ($a_type)
 Get exported ids by type ilDB $ilDB. More...
 
static getExportServerIds ($a_obj_id)
 lookup server ids of exported materials 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 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 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 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.

public

Parameters

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

References $ilDB, and read().

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 private.
global $ilDB
+ 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.

public

Parameters
arrayarray of econtent ids

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

References $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleExportReset().

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  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllEContentIds()

static ilECSExport::_getAllEContentIds (   $a_server_id)
static

get all exported econtent ids per server

public

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

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

Referenced by ilECSEventQueueReader\handleExportReset().

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _getExportedIDsByServer()

static ilECSExport::_getExportedIDsByServer (   $a_server_id)
static

get exported ids for server

public

Returns

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ _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.

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

Referenced by ilECSObjectSettings\addSettingsToForm().

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  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _isRemote()

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

is remote object

public

Parameters
intecontent_id

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

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ deleteByServer()

static ilECSExport::deleteByServer (   $a_server_id)
static

Delete by server id ilDB $ilDB.

Parameters
int$a_server_id

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

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

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  }
$query
global $ilDB
+ 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.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

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  }
$query
global $ilDB
+ Here is the caller graph for this function:

◆ getEContentId()

ilECSExport::getEContentId ( )

get econtent id

public

Returns
int econtent id

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

References $econtent_id.

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

314  {
315  return $this->econtent_id;
316  }
+ Here is the caller graph for this function:

◆ getExportedIds()

static ilECSExport::getExportedIds ( )
static

Get exported ids ilDB $ilDB.

Returns
array

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

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getExportedIdsByType()

static ilECSExport::getExportedIdsByType (   $a_type)
static

Get exported ids by type ilDB $ilDB.

Returns
array

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

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

Referenced by ilECSSettingsGUI\released().

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
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getExportServerIds()

static ilECSExport::getExportServerIds (   $a_obj_id)
static

lookup server ids of exported materials ilDB $ilDB

Parameters
int$a_obj_id
Returns
array

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

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ 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.

References $server_id.

Referenced by read(), and save().

66  {
67  return $this->server_id;
68  }
+ Here is the caller graph for this function:

◆ isExported()

ilECSExport::isExported ( )

check if an object is exported or not

public

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

References $exported.

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

290  {
291  return (bool) $this->exported;
292  }
+ Here is the caller graph for this function:

◆ lookupServerIds()

static ilECSExport::lookupServerIds (   $a_obj_id)
static

Lookup server ids of exported objects ilDB $ilDB.

Parameters
<type>$a_obj_id
Returns
<type>

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

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

Referenced by ilECSReleasedContentTableGUI\parse().

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read private.

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

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

Referenced by __construct().

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.
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSExport::save ( )

Save.

public

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

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

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

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  }
getServerId()
Get server id.
foreach($_POST as $key=> $value) $res
isExported()
check if an object is exported or not
getEContentId()
get econtent id
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEContentId()

ilECSExport::setEContentId (   $a_id)

set econtent id

public

Parameters
intecontent id (received from ECS::addResource)

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

Referenced by ilECSObjectSettings\doAdd().

302  {
303  $this->econtent_id = $a_id;
304  }
+ Here is the caller graph for this function:

◆ setExported()

ilECSExport::setExported (   $a_status)

Set exported.

public

Parameters
boolexport status

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

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

279  {
280  $this->exported = $a_status;
281  }
+ 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: