ILIAS  release_8 Revision v8.23
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.

References $DIC, and read().

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
+ 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.

References $econtent_id.

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

96  : int
97  {
98  return $this->econtent_id;
99  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSExport::getServerId ( )

Get server id.

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

References $server_id.

Referenced by read(), and save().

49  : int
50  {
51  return $this->server_id;
52  }
+ 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.

References $exported.

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

76  : bool
77  {
78  return $this->exported;
79  }
+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read.

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

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

Referenced by __construct().

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  }
$res
Definition: ltiservices.php:69
getServerId()
Get server id.
$query
+ 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.

References $query, getEContentId(), getServerId(), and isExported().

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

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  }
getServerId()
Get server id.
isExported()
check if an object is exported or not
getEContentId()
get econtent id
$query
+ 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.

Referenced by ilECSObjectSettings\doAdd().

86  : void
87  {
88  $this->econtent_id = $a_id;
89  }
+ 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.

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

68  : void
69  {
70  $this->exported = $a_status;
71  }
+ 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: