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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

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

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

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

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

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

References $exported.

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

+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read.

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

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

References $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 105 of file class.ilECSExport.php.

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

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

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

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

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

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

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

Field Documentation

◆ $db

ilDBInterface ilECSExport::$db
protected

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

◆ $econtent_id

int ilECSExport::$econtent_id = 0
protected

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

Referenced by getEContentId().

◆ $exported

bool ilECSExport::$exported = false
protected

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

Referenced by isExported().

◆ $obj_id

int ilECSExport::$obj_id = 0
protected

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

◆ $server_id

int ilECSExport::$server_id = 0
protected

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

Referenced by getServerId().


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