ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSExportManager Class Reference

Manage the ECS exported contents. More...

+ Collaboration diagram for ilECSExportManager:

Public Member Functions

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

Static Public Member Functions

static getInstance ()
 Get the singelton instance of this ilECSExportManager. More...
 

Protected Attributes

ilDBInterface $db
 

Private Member Functions

 __construct ()
 

Static Private Attributes

static ilECSExportManager $instance
 

Detailed Description

Manage the ECS exported contents.

This class contains mainly helper functions to work with exported objects.

Author
Per Pascal Seelandpasca.nosp@m.l.se.nosp@m.eland.nosp@m.@tik.nosp@m..uni-.nosp@m.stut.nosp@m.tgart.nosp@m..de

Definition at line 26 of file class.ilECSExportManager.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSExportManager::__construct ( )
private

Definition at line 32 of file class.ilECSExportManager.php.

References $DIC.

33  {
34  global $DIC;
35 
36  $this->db = $DIC->database();
37  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ _deleteEContentIds()

ilECSExportManager::_deleteEContentIds ( int  $a_server_id,
array  $a_ids 
)

Delete econtent ids for server.

Parameters
int$a_server_idid of the server
int[]$a_ids array of econtent ids

Definition at line 163 of file class.ilECSExportManager.php.

References $query.

163  : bool
164  {
165  if (!is_array($a_ids) || !count($a_ids)) {
166  return true;
167  }
168  $query = "DELETE FROM ecs_export WHERE " . $this->db->in('econtent_id', $a_ids, false, 'integer') . ' ' .
169  'AND server_id = ' . $this->db->quote($a_server_id, 'integer');
170  $this->db->manipulate($query);
171  return true;
172  }
$query

◆ _getAllEContentIds()

ilECSExportManager::_getAllEContentIds ( int  $a_server_id)

get all exported econtent ids per server

Definition at line 68 of file class.ilECSExportManager.php.

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

68  : array
69  {
70  $econtent_ids = array();
71  $query = "SELECT econtent_id,obj_id FROM ecs_export " .
72  'WHERE server_id = ' . $this->db->quote($a_server_id, 'integer');
73 
74  $res = $this->db->query($query);
75  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
76  $econtent_ids[$row->econtent_id] = $row->obj_id;
77  }
78  return $econtent_ids;
79  }
$res
Definition: ltiservices.php:69
$query

◆ _getExportedIDsByServer()

ilECSExportManager::_getExportedIDsByServer ( int  $a_server_id)

get exported ids for server

Definition at line 130 of file class.ilECSExportManager.php.

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

130  : array
131  {
132  $query = "SELECT obj_id FROM ecs_export " .
133  'WHERE server_id = ' . $this->db->quote($a_server_id, 'integer');
134  $res = $this->db->query($query);
135  $obj_ids = [];
136  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
137  $obj_ids[] = $row->obj_id;
138  }
139  return $obj_ids;
140  }
$res
Definition: ltiservices.php:69
$query

◆ _isExported()

ilECSExportManager::_isExported ( int  $a_obj_id)

Check if object is exported.

Definition at line 53 of file class.ilECSExportManager.php.

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

53  : bool
54  {
55  $query = 'SELECT * FROM ecs_export ' .
56  'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer');
57  $res = $this->db->query($query);
58  if ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
59  return true;
60  }
61  return false;
62  }
$res
Definition: ltiservices.php:69
$query

◆ _isRemote()

ilECSExportManager::_isRemote ( int  $a_server_id,
int  $a_econtent_id 
)

is remote object

Definition at line 187 of file class.ilECSExportManager.php.

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

187  : bool
188  {
189  $query = "SELECT obj_id FROM ecs_export " .
190  "WHERE econtent_id = " . $this->db->quote($a_econtent_id, 'integer') . " " .
191  'AND server_id = ' . $this->db->quote($a_server_id, 'integer');
192  $res = $this->db->query($query);
193  if ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
194  return false;
195  }
196  return true;
197  }
$res
Definition: ltiservices.php:69
$query

◆ deleteByServer()

ilECSExportManager::deleteByServer ( int  $a_server_id)

Delete by server id.

Definition at line 177 of file class.ilECSExportManager.php.

References $query.

177  : void
178  {
179  $query = 'DELETE FROM ecs_export ' .
180  'WHERE server_id = ' . $this->db->quote($a_server_id, 'integer');
181  $this->db->manipulate($query);
182  }
$query

◆ getExportedIds()

ilECSExportManager::getExportedIds ( )

Get exported ids.

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

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

84  : array
85  {
86  $query = "SELECT obj_id FROM ecs_export ";
87  $res = $this->db->query($query);
88  $obj_ids = array();
89  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
90  $obj_ids[] = (int) $row->obj_id;
91  }
92  return $obj_ids;
93  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ getExportedIdsByType()

ilECSExportManager::getExportedIdsByType ( string  $a_type)

Get exported ids by type.

Definition at line 98 of file class.ilECSExportManager.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

98  : array
99  {
100  $obj_ids = array();
101  $query = "SELECT e.obj_id FROM ecs_export e" .
102  " JOIN object_data o ON (e.obj_id = o.obj_id)" .
103  " WHERE o.type = " . $this->db->quote($a_type, "text");
104  $res = $this->db->query($query);
105  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
106  $obj_ids[] = (int) $row->obj_id;
107  }
108  return $obj_ids;
109  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ getExportServerIds()

ilECSExportManager::getExportServerIds ( int  $a_obj_id)

lookup server ids of exported materials

Definition at line 114 of file class.ilECSExportManager.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

114  : array
115  {
116  $query = 'SELECT * FROM ecs_export ' .
117  'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer');
118  $res = $this->db->query($query);
119 
120  $sids = array();
121  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
122  $sids[] = (int) $row->server_id;
123  }
124  return $sids;
125  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ getInstance()

◆ lookupServerIds()

ilECSExportManager::lookupServerIds ( int  $a_obj_id)

Lookup server ids of exported objects.

Definition at line 145 of file class.ilECSExportManager.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

145  : array
146  {
147  $query = 'SELECT * FROM ecs_export ' .
148  'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer') . ' ';
149  $res = $this->db->query($query);
150  $sids = array();
151  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
152  $sids[] = (int) $row->server_id;
153  }
154  return $sids;
155  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilECSExportManager::$db
protected

Definition at line 28 of file class.ilECSExportManager.php.

◆ $instance

ilECSExportManager ilECSExportManager::$instance
staticprivate

Definition at line 30 of file class.ilECSExportManager.php.


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