ILIAS  release_8 Revision v8.24
ilECSExport Class Reference

Storage of an ECS exported object. More...

+ Collaboration diagram for ilECSExport:

Public Member Functions

 __construct (int $a_server_id, int $a_obj_id)
 
 getServerId ()
 Get server id. More...
 
 setServerId (int $a_server_id)
 Set server id. More...
 
 setExported (bool $a_status)
 Set exported. More...
 
 isExported ()
 check if an object is exported or not More...
 
 setEContentId (int $a_id)
 set econtent id More...
 
 getEContentId ()
 get econtent id More...
 
 save ()
 Save. More...
 

Protected Attributes

ilDBInterface $db
 
int $server_id = 0
 
int $obj_id = 0
 
int $econtent_id = 0
 
bool $exported = false
 

Private Member Functions

 read ()
 Read. More...
 

Detailed Description

Storage of an ECS exported object.

This class stores the econtent 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

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

Constructor & Destructor Documentation

◆ __construct()

ilECSExport::__construct ( int  $a_server_id,
int  $a_obj_id 
)

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

36 {
37 global $DIC;
38
39 $this->server_id = $a_server_id;
40 $this->obj_id = $a_obj_id;
41
42 $this->db = $DIC->database();
43 $this->read();
44 }
global $DIC
Definition: feed.php:28

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ getEContentId()

ilECSExport::getEContentId ( )

get econtent id

Returns
int econtent id

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

96 : int
97 {
98 return $this->econtent_id;
99 }

References $econtent_id.

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

+ Here is the caller graph for this function:

◆ getServerId()

ilECSExport::getServerId ( )

Get server id.

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

49 : int
50 {
51 return $this->server_id;
52 }

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

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

76 : bool
77 {
78 return $this->exported;
79 }

References $exported.

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

+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read.

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

127 : void
128 {
129 $query = "SELECT * FROM ecs_export WHERE " .
130 "obj_id = " . $this->db->quote($this->obj_id, 'integer') . " AND " .
131 'server_id = ' . $this->db->quote($this->getServerId(), 'integer');
132 $res = $this->db->query($query);
133 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
134 $this->econtent_id = (int) $row->econtent_id;
135 $this->exported = true;
136 }
137 }
getServerId()
Get server id.
$res
Definition: ltiservices.php:69
$query

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSExport::save ( )

Save.

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

104 : bool
105 {
106 $query = "DELETE FROM ecs_export " .
107 "WHERE obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
108 'AND server_id = ' . $this->db->quote($this->getServerId());
109 $this->db->manipulate($query);
110
111 if ($this->isExported()) {
112 $query = "INSERT INTO ecs_export (server_id,obj_id,econtent_id) " .
113 "VALUES ( " .
114 $this->db->quote($this->server_id, 'integer') . ', ' .
115 $this->db->quote($this->obj_id, 'integer') . ", " .
116 $this->db->quote($this->getEContentId(), 'integer') . " " .
117 ")";
118 $this->db->manipulate($query);
119 }
120
121 return true;
122 }
getEContentId()
get econtent id
isExported()
check if an object is exported or not

References $query, 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 ( int  $a_id)

set econtent id

Parameters
int$a_idecontent id (received from ECS::addResource)

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

86 : void
87 {
88 $this->econtent_id = $a_id;
89 }

Referenced by ilECSObjectSettings\doAdd().

+ Here is the caller graph for this function:

◆ setExported()

ilECSExport::setExported ( bool  $a_status)

Set exported.

Parameters
bool$a_statusexport status

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

68 : void
69 {
70 $this->exported = $a_status;
71 }

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

+ Here is the caller graph for this function:

◆ setServerId()

ilECSExport::setServerId ( int  $a_server_id)

Set server id.

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

57 : void
58 {
59 $this->server_id = $a_server_id;
60 }

Field Documentation

◆ $db

ilDBInterface ilECSExport::$db
protected

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

◆ $econtent_id

int ilECSExport::$econtent_id = 0
protected

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

Referenced by getEContentId().

◆ $exported

bool ilECSExport::$exported = false
protected

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

Referenced by isExported().

◆ $obj_id

int ilECSExport::$obj_id = 0
protected

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

◆ $server_id

int ilECSExport::$server_id = 0
protected

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

Referenced by getServerId().


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