ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSImport Class Reference

Storage of ECS imported objects. More...

+ Collaboration diagram for ilECSImport:

Public Member Functions

 __construct (int $a_server_id, int $a_obj_id)
 
 setServerId ($a_server_id)
 
 getServerId ()
 
 setImported (bool $a_status)
 Set imported. More...
 
 setSubId (string $a_id)
 
 getSubId ()
 
 setContentId ($a_content_id)
 Set content id. More...
 
 getContentId ()
 get content id More...
 
 setMID ($a_mid)
 set mid More...
 
 getMID ()
 get mid More...
 
 setEContentId ($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
 
string $econtent_id = ''
 
string $content_id = ''
 
string $sub_id = ''
 
int $mid = 0
 
bool $imported = false
 

Private Member Functions

 read ()
 Read. More...
 

Detailed Description

Storage of ECS imported objects.

This class stores the econtent id and informations whether an object is imported or not.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 38 of file class.ilECSImport.php.

References $DIC, and read().

39  {
40  global $DIC;
41  $this->db = $DIC->database();
42 
43  $this->server_id = $a_server_id;
44  $this->obj_id = $a_obj_id;
45 
46  $this->read();
47  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getContentId()

ilECSImport::getContentId ( )

get content id

Definition at line 88 of file class.ilECSImport.php.

References $content_id.

Referenced by save().

88  : string
89  {
90  return $this->content_id;
91  }
+ Here is the caller graph for this function:

◆ getEContentId()

ilECSImport::getEContentId ( )

get econtent id

Definition at line 123 of file class.ilECSImport.php.

References $econtent_id.

123  : string
124  {
125  return $this->econtent_id;
126  }

◆ getMID()

ilECSImport::getMID ( )

get mid

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

References $mid.

104  : int
105  {
106  return $this->mid;
107  }

◆ getServerId()

ilECSImport::getServerId ( )

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

References $server_id.

Referenced by read(), and save().

54  : int
55  {
56  return $this->server_id;
57  }
+ Here is the caller graph for this function:

◆ getSubId()

ilECSImport::getSubId ( )

Definition at line 72 of file class.ilECSImport.php.

Referenced by save().

72  : ?string
73  {
74  return (isset($this->sub_id) && $this->sub_id !== '') ? $this->sub_id : null;
75  }
+ Here is the caller graph for this function:

◆ read()

ilECSImport::read ( )
private

Read.

Definition at line 156 of file class.ilECSImport.php.

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

Referenced by __construct().

156  : void
157  {
158  $query = "SELECT * FROM ecs_import WHERE " .
159  "obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
160  'AND server_id = ' . $this->db->quote($this->getServerId(), 'integer');
161  $res = $this->db->query($query);
162  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163  $this->econtent_id = $row->econtent_id;
164  $this->mid = (int) $row->mid;
165  $this->sub_id = $row->sub_id;
166  $this->content_id = $row->content_id;
167  }
168  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSImport::save ( )

Save.

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

References $query, getContentId(), getServerId(), and getSubId().

131  : bool
132  {
133  $query = "DELETE FROM ecs_import " .
134  "WHERE obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
135  'AND server_id = ' . $this->db->quote($this->getServerId(), 'integer');
136  $this->db->manipulate($query);
137 
138  $query = "INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) " .
139  "VALUES ( " .
140  $this->db->quote($this->obj_id, 'integer') . ", " .
141  $this->db->quote($this->mid, 'integer') . ", " .
142  $this->db->quote($this->econtent_id, 'text') . ", " .
143  $this->db->quote($this->getSubId(), 'text') . ', ' .
144  $this->db->quote($this->getServerId(), 'integer') . ', ' .
145  $this->db->quote($this->getContentId(), 'text') . ' ' .
146  ")";
147 
148  $this->db->manipulate($query);
149 
150  return true;
151  }
$query
getContentId()
get content id
+ Here is the call graph for this function:

◆ setContentId()

ilECSImport::setContentId (   $a_content_id)

Set content id.

Definition at line 80 of file class.ilECSImport.php.

Referenced by ilObjRemoteCourse\updateCustomFromECSContent().

80  : void
81  {
82  $this->content_id = $a_content_id;
83  }
+ Here is the caller graph for this function:

◆ setEContentId()

ilECSImport::setEContentId (   $a_id)

set econtent id

Parameters
intecontent id

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

Referenced by ilRemoteObjectBase\handleUpdate().

115  : void
116  {
117  $this->econtent_id = $a_id;
118  }
+ Here is the caller graph for this function:

◆ setImported()

ilECSImport::setImported ( bool  $a_status)

Set imported.

Definition at line 62 of file class.ilECSImport.php.

62  : void
63  {
64  $this->imported = $a_status;
65  }

◆ setMID()

ilECSImport::setMID (   $a_mid)

set mid

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

Referenced by ilECSCmsTreeSynchronizer\syncCategory(), and ilECSCourseCreationHandler\syncCategory().

96  : void
97  {
98  $this->mid = $a_mid;
99  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSImport::setServerId (   $a_server_id)

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

49  : void
50  {
51  $this->server_id = $a_server_id;
52  }

◆ setSubId()

ilECSImport::setSubId ( string  $a_id)

Definition at line 67 of file class.ilECSImport.php.

Referenced by ilECSCourseCreationHandler\setImported().

67  : void
68  {
69  $this->sub_id = $a_id;
70  }
+ Here is the caller graph for this function:

Field Documentation

◆ $content_id

string ilECSImport::$content_id = ''
protected

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

Referenced by getContentId().

◆ $db

ilDBInterface ilECSImport::$db
protected

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

◆ $econtent_id

string ilECSImport::$econtent_id = ''
protected

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

Referenced by getEContentId().

◆ $imported

bool ilECSImport::$imported = false
protected

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

◆ $mid

int ilECSImport::$mid = 0
protected

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

Referenced by getMID().

◆ $obj_id

int ilECSImport::$obj_id = 0
protected

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

◆ $server_id

int ilECSImport::$server_id = 0
protected

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

Referenced by getServerId().

◆ $sub_id

string ilECSImport::$sub_id = ''
protected

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


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