ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 228 of file class.ilECSExport.php.

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 }

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 106 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
115 {
116 $econtent_ids[$row->econtent_id] = $row->obj_id;
117 }
118 return $econtent_ids ? $econtent_ids : array();
119 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $ilDB, $query, $res, $row, and DB_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 186 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
193 {
194 $obj_ids[] = $row->obj_id;
195 }
196 return $obj_ids ? $obj_ids : array();
197 }

References $ilDB, $query, $res, $row, and DB_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(DB_FETCHMODE_OBJECT))
92 {
93 return true;
94 }
95 return false;
96 }

References $ilDB, $query, $res, $row, and DB_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 265 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
274 {
275 return false;
276 }
277 return true;
278 }

References $ilDB, $query, $res, $row, and DB_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 248 of file class.ilECSExport.php.

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 }

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 374 of file class.ilECSExport.php.

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 }

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 322 of file class.ilECSExport.php.

323 {
324 return $this->econtent_id;
325 }

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 126 of file class.ilECSExport.php.

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

References $ilDB, $query, $res, $row, and DB_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 143 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
151 {
152 $obj_ids[] = $row->obj_id;
153 }
154 return $obj_ids ? $obj_ids : array();
155 }

References $ilDB, $query, $res, $row, and DB_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 163 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
173 {
174 $sids[] = $row->server_id;
175 }
176 return $sids;
177 }

References $ilDB, $query, $res, $row, and DB_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 298 of file class.ilECSExport.php.

299 {
300 return (bool) $this->exported;
301 }

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 205 of file class.ilECSExport.php.

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(DB_FETCHMODE_OBJECT))
214 {
215 $sids[] = $row->server_id;
216 }
217 return $sids;
218 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSReleasedContentTableGUI\parse().

+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read @access private.

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

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(DB_FETCHMODE_OBJECT))
368 {
369 $this->econtent_id = $row->econtent_id;
370 $this->exported = true;
371 }
372 }
getServerId()
Get server id.

References $ilDB, $query, $res, $row, DB_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 332 of file class.ilECSExport.php.

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 }
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 310 of file class.ilECSExport.php.

311 {
312 $this->econtent_id = $a_id;
313 }

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 287 of file class.ilECSExport.php.

288 {
289 $this->exported = $a_status;
290 }

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: