ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 27 of file class.ilECSExportManager.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSExportManager::__construct ( )
private

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

34 {
35 global $DIC;
36
37 $this->db = $DIC->database();
38 }
global $DIC
Definition: shib_login.php:26

References $DIC.

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_idsarray of econtent ids

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

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

◆ _getAllEContentIds()

ilECSExportManager::_getAllEContentIds ( int  $a_server_id)

get all exported econtent ids per server

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

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

References $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ _getExportedIDsByServer()

ilECSExportManager::_getExportedIDsByServer ( int  $a_server_id)

get exported ids for server

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

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

References $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ _isExported()

ilECSExportManager::_isExported ( int  $a_obj_id)

Check if object is exported.

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

54 : bool
55 {
56 $query = 'SELECT * FROM ecs_export ' .
57 'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer');
58 $res = $this->db->query($query);
60 return true;
61 }
62 return false;
63 }

References $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ _isRemote()

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

is remote object

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

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

References $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ deleteByServer()

ilECSExportManager::deleteByServer ( int  $a_server_id)

Delete by server id.

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

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

◆ getExportedIds()

ilECSExportManager::getExportedIds ( )

Get exported ids.

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

85 : array
86 {
87 $query = "SELECT obj_id FROM ecs_export ";
88 $res = $this->db->query($query);
89 $obj_ids = array();
90 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
91 $obj_ids[] = (int) $row->obj_id;
92 }
93 return $obj_ids;
94 }

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

+ Here is the call graph for this function:

◆ getExportedIdsByType()

ilECSExportManager::getExportedIdsByType ( string  $a_type)

Get exported ids by type.

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

99 : array
100 {
101 $obj_ids = array();
102 $query = "SELECT e.obj_id FROM ecs_export e" .
103 " JOIN object_data o ON (e.obj_id = o.obj_id)" .
104 " WHERE o.type = " . $this->db->quote($a_type, "text");
105 $res = $this->db->query($query);
106 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
107 $obj_ids[] = (int) $row->obj_id;
108 }
109 return $obj_ids;
110 }

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

+ Here is the call graph for this function:

◆ getExportServerIds()

ilECSExportManager::getExportServerIds ( int  $a_obj_id)

lookup server ids of exported materials

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

115 : array
116 {
117 $query = 'SELECT * FROM ecs_export ' .
118 'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer');
119 $res = $this->db->query($query);
120
121 $sids = array();
122 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
123 $sids[] = (int) $row->server_id;
124 }
125 return $sids;
126 }

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

+ 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 146 of file class.ilECSExportManager.php.

146 : array
147 {
148 $query = 'SELECT * FROM ecs_export ' .
149 'WHERE obj_id = ' . $this->db->quote($a_obj_id, 'integer') . ' ';
150 $res = $this->db->query($query);
151 $sids = array();
152 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
153 $sids[] = (int) $row->server_id;
154 }
155 return $sids;
156 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilECSExportManager::$db
protected

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

◆ $instance

ilECSExportManager ilECSExportManager::$instance
staticprivate

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

Referenced by getInstance().


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