ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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:26

References $DIC, and read().

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

89 : string
90 {
91 return $this->content_id;
92 }

References $content_id.

Referenced by save().

+ Here is the caller graph for this function:

◆ getEContentId()

ilECSImport::getEContentId ( )

get econtent id

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

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

References $econtent_id.

◆ getMID()

ilECSImport::getMID ( )

get mid

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

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

References $mid.

◆ getServerId()

ilECSImport::getServerId ( )

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

55 : int
56 {
57 return $this->server_id;
58 }

References $server_id.

Referenced by read(), and save().

+ Here is the caller graph for this function:

◆ getSubId()

ilECSImport::getSubId ( )

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

73 : ?string
74 {
75 return (isset($this->sub_id) && $this->sub_id !== '') ? $this->sub_id : null;
76 }

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilECSImport::read ( )
private

Read.

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

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: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()

ilECSImport::save ( )

Save.

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

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

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

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

81 : void
82 {
83 $this->content_id = $a_content_id;
84 }

◆ setEContentId()

ilECSImport::setEContentId (   $a_id)

set econtent id

Parameters
intecontent id

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

116 : void
117 {
118 $this->econtent_id = $a_id;
119 }

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

97 : void
98 {
99 $this->mid = $a_mid;
100 }

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

68 : void
69 {
70 $this->sub_id = $a_id;
71 }

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: