ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 228 of file class.ilECSExport.php.

References $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleExportReset().

229  {
230  global $ilDB;
231 
232  if(!is_array($a_ids) or !count($a_ids))
233  {
234  return true;
235  }
236  #$query = "DELETE FROM ecs_export WHERE econtent_id IN (".implode(',',ilUtil::quoteArray($a_ids)).')';
237  $query = "DELETE FROM ecs_export WHERE ".$ilDB->in('econtent_id',$a_ids,false,'integer').' '.
238  'AND server_id = '.$ilDB->quote($a_server_id,'integer');
239  $res = $ilDB->manipulate($query);
240  return true;
241  }
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 106 of file class.ilECSExport.php.

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

Referenced by ilECSEventQueueReader\handleExportReset().

107  {
108  global $ilDB;
109 
110  $query = "SELECT econtent_id,obj_id FROM ecs_export ".
111  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
112 
113  $res = $ilDB->query($query);
114  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
115  {
116  $econtent_ids[$row->econtent_id] = $row->obj_id;
117  }
118  return $econtent_ids ? $econtent_ids : array();
119  }
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 186 of file class.ilECSExport.php.

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

187  {
188  global $ilDB;
189  $query = "SELECT obj_id FROM ecs_export ".
190  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
191  $res = $ilDB->query($query);
192  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
193  {
194  $obj_ids[] = $row->obj_id;
195  }
196  return $obj_ids ? $obj_ids : array();
197  }
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  {
93  return true;
94  }
95  return false;
96  }
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 265 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().

266  {
267  global $ilDB;
268 
269  $query = "SELECT obj_id FROM ecs_export ".
270  "WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'integer')." ".
271  'AND server_id = '.$ilDB->quote($a_server_id,'integer');
272  $res = $ilDB->query($query);
273  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
274  {
275  return false;
276  }
277  return true;
278  }
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 248 of file class.ilECSExport.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

249  {
250  global $ilDB;
251 
252  $query = 'DELETE FROM ecs_export '.
253  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
254  $ilDB->manipulate($query);
255  }
global $ilDB
+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSExport::deleteByServerId (   $a_server_id)
static

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

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

375  {
376  global $ilDB;
377 
378  $query = 'DELETE FROM ecs_export'.
379  ' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
380  $ilDB->manipulate($query);
381  return true;
382  }
global $ilDB
+ Here is the caller graph for this function:

◆ getEContentId()

ilECSExport::getEContentId ( )

get econtent id

public

Returns
int econtent id

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

References $econtent_id.

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

323  {
324  return $this->econtent_id;
325  }
+ Here is the caller graph for this function:

◆ getExportedIds()

static ilECSExport::getExportedIds ( )
static

Get exported ids ilDB $ilDB.

Returns
array

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

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

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

127  {
128  global $ilDB;
129  $query = "SELECT obj_id FROM ecs_export ";
130  $res = $ilDB->query($query);
131  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
132  {
133  $obj_ids[] = $row->obj_id;
134  }
135  return $obj_ids ? $obj_ids : array();
136  }
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 143 of file class.ilECSExport.php.

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

Referenced by ilECSSettingsGUI\released().

144  {
145  global $ilDB;
146  $query = "SELECT e.obj_id FROM ecs_export e".
147  " JOIN object_data o ON (e.obj_id = o.obj_id)".
148  " WHERE o.type = ".$ilDB->quote($a_type, "text");
149  $res = $ilDB->query($query);
150  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
151  {
152  $obj_ids[] = $row->obj_id;
153  }
154  return $obj_ids ? $obj_ids : array();
155  }
$a_type
Definition: workflow.php:93
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 163 of file class.ilECSExport.php.

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

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

164  {
165  global $ilDB;
166 
167  $query = 'SELECT * FROM ecs_export '.
168  'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
169  $res = $ilDB->query($query);
170 
171  $sids = array();
172  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
173  {
174  $sids[] = $row->server_id;
175  }
176  return $sids;
177  }
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 298 of file class.ilECSExport.php.

References $exported.

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

299  {
300  return (bool) $this->exported;
301  }
+ 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 205 of file class.ilECSExport.php.

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

Referenced by ilECSReleasedContentTableGUI\parse().

206  {
207  global $ilDB;
208 
209  $query = 'SELECT * FROM ecs_export '.
210  'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer').' ';
211  $res = $ilDB->query($query);
212  $sids = array();
213  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
214  {
215  $sids[] = $row->server_id;
216  }
217  return $sids;
218  }
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 359 of file class.ilECSExport.php.

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

Referenced by __construct().

360  {
361  global $ilDB;
362 
363  $query = "SELECT * FROM ecs_export WHERE ".
364  "obj_id = ".$this->db->quote($this->obj_id,'integer')." AND ".
365  'server_id = '.$ilDB->quote($this->getServerId(),'integer');
366  $res = $this->db->query($query);
367  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
368  {
369  $this->econtent_id = $row->econtent_id;
370  $this->exported = true;
371  }
372  }
getServerId()
Get server id.
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 332 of file class.ilECSExport.php.

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

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

333  {
334  global $ilDB;
335 
336  $query = "DELETE FROM ecs_export ".
337  "WHERE obj_id = ".$this->db->quote($this->obj_id,'integer')." ".
338  'AND server_id = '.$ilDB->quote($this->getServerId());
339  $res = $ilDB->manipulate($query);
340 
341  if($this->isExported())
342  {
343  $query = "INSERT INTO ecs_export (server_id,obj_id,econtent_id) ".
344  "VALUES ( ".
345  $this->db->quote($this->getServerId(),'integer').', '.
346  $this->db->quote($this->obj_id,'integer').", ".
347  $this->db->quote($this->getEContentId(),'integer')." ".
348  ")";
349  $res = $ilDB->manipulate($query);
350  }
351 
352  return true;
353  }
getServerId()
Get server id.
isExported()
check if an object is exported or not
getEContentId()
get econtent id
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 310 of file class.ilECSExport.php.

Referenced by ilECSObjectSettings\doAdd().

311  {
312  $this->econtent_id = $a_id;
313  }
+ Here is the caller graph for this function:

◆ setExported()

ilECSExport::setExported (   $a_status)

Set exported.

public

Parameters
boolexport status

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

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

288  {
289  $this->exported = $a_status;
290  }
+ 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: