ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 27 of file class.ilECSImport.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, and read().

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

Member Function Documentation

◆ getContentId()

ilECSImport::getContentId ( )

get content id

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

References $content_id.

Referenced by save().

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

◆ getEContentId()

ilECSImport::getEContentId ( )

get econtent id

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

References $econtent_id.

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

◆ getMID()

ilECSImport::getMID ( )

get mid

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

References $mid.

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

◆ getServerId()

ilECSImport::getServerId ( )

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

References $server_id.

Referenced by read(), and save().

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

◆ getSubId()

ilECSImport::getSubId ( )

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

References null.

Referenced by save().

73  : ?string
74  {
75  return (isset($this->sub_id) && $this->sub_id !== '') ? $this->sub_id : null;
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ read()

ilECSImport::read ( )
private

Read.

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

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

Referenced by __construct().

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

◆ save()

ilECSImport::save ( )

Save.

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

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

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

◆ setContentId()

ilECSImport::setContentId (   $a_content_id)

Set content id.

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

Referenced by ilObjRemoteCourse\updateCustomFromECSContent().

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

◆ setEContentId()

ilECSImport::setEContentId (   $a_id)

set econtent id

Parameters
intecontent id

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

Referenced by ilRemoteObjectBase\handleUpdate().

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

◆ setImported()

ilECSImport::setImported ( bool  $a_status)

Set imported.

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

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

◆ setMID()

ilECSImport::setMID (   $a_mid)

set mid

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

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

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

◆ setServerId()

ilECSImport::setServerId (   $a_server_id)

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

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

◆ setSubId()

ilECSImport::setSubId ( string  $a_id)

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

Referenced by ilECSCourseCreationHandler\setImported().

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

Field Documentation

◆ $content_id

string ilECSImport::$content_id = ''
protected

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

Referenced by getContentId().

◆ $db

ilDBInterface ilECSImport::$db
protected

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

◆ $econtent_id

string ilECSImport::$econtent_id = ''
protected

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

Referenced by getEContentId().

◆ $imported

bool ilECSImport::$imported = false
protected

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

◆ $mid

int ilECSImport::$mid = 0
protected

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

Referenced by getMID().

◆ $obj_id

int ilECSImport::$obj_id = 0
protected

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

◆ $server_id

int ilECSImport::$server_id = 0
protected

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

Referenced by getServerId().

◆ $sub_id

string ilECSImport::$sub_id = ''
protected

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


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