ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilECSDataMappingSetting Class Reference
+ Collaboration diagram for ilECSDataMappingSetting:

Public Member Functions

 __construct (int $a_server_id=0, int $mapping_type=0, string $ecs_field='')
 
 setServerId (int $a_server_id)
 set server id More...
 
 getServerId ()
 Get server id. More...
 
 setECSField (string $ecs_field)
 
 getECSField ()
 Get ecs field. More...
 
 setMappingType (int $mapping_type)
 Set mapping type. More...
 
 getMappingType ()
 Get mapping type. More...
 
 getAdvMDId ()
 
 setAdvMDId (int $a_id)
 
 save ()
 Save mappings. More...
 

Data Fields

const MAPPING_EXPORT = 1
 
const MAPPING_IMPORT_CRS = 2
 
const MAPPING_IMPORT_RCRS = 3
 

Protected Member Functions

 update ()
 Update setting. More...
 
 create ()
 

Private Member Functions

 read ()
 Read settings. More...
 

Private Attributes

ilDBInterface $db
 
int $server_id = 0
 
int $mapping_type = 0
 
string $ecs_field = ''
 
int $advmd_id = 0
 

Detailed Description

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

Definition at line 24 of file class.ilECSDataMappingSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSDataMappingSetting::__construct ( int  $a_server_id = 0,
int  $mapping_type = 0,
string  $ecs_field = '' 
)

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

38 {
39 global $DIC;
40
41 $this->db = $DIC->database();
42
43 $this->setServerId($a_server_id);
45 $this->setECSField($ecs_field);
46 }
setMappingType(int $mapping_type)
Set mapping type.
setServerId(int $a_server_id)
set server id
global $DIC
Definition: shib_login.php:26

References $DIC, setECSField(), setMappingType(), and setServerId().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSDataMappingSetting::create ( )
protected

Definition at line 133 of file class.ilECSDataMappingSetting.php.

133 : bool
134 {
135 $query = 'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) ' .
136 'VALUES(' .
137 $this->db->quote($this->getServerId(), 'integer') . ', ' .
138 $this->db->quote($this->getMappingType(), 'integer') . ', ' .
139 $this->db->quote($this->getECSField(), 'text') . ', ' .
140 $this->db->quote($this->getAdvMDId(), 'integer') . ' ) ';
141 $this->db->manipulate($query);
142 return true;
143 }

References getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdvMDId()

ilECSDataMappingSetting::getAdvMDId ( )

Definition at line 93 of file class.ilECSDataMappingSetting.php.

93 : int
94 {
95 return $this->advmd_id;
96 }

References $advmd_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getECSField()

ilECSDataMappingSetting::getECSField ( )

Get ecs field.

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

72 : string
73 {
74 return $this->ecs_field;
75 }

References $ecs_field.

Referenced by create(), read(), save(), and update().

+ Here is the caller graph for this function:

◆ getMappingType()

ilECSDataMappingSetting::getMappingType ( )

Get mapping type.

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

88 : int
89 {
91 }

References $mapping_type.

Referenced by create(), read(), save(), and update().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSDataMappingSetting::getServerId ( )

Get server id.

Definition at line 59 of file class.ilECSDataMappingSetting.php.

59 : int
60 {
61 return $this->server_id;
62 }

References $server_id.

Referenced by create(), read(), save(), and update().

+ Here is the caller graph for this function:

◆ read()

ilECSDataMappingSetting::read ( )
private

Read settings.

Definition at line 149 of file class.ilECSDataMappingSetting.php.

149 : void
150 {
151 if ($this->getServerId() || $this->getMappingType() || $this->getECSField()) {
152 $query = 'SELECT * FROM ecs_data_mapping ' .
153 'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
154 'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
155 'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
156 $res = $this->db->query($query);
157 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
158 $this->setAdvMDId($row->advmd_id);
159 }
160 }
161 }
$res
Definition: ltiservices.php:69

References $res, ilDBConstants\FETCHMODE_OBJECT, getECSField(), getMappingType(), getServerId(), and setAdvMDId().

+ Here is the call graph for this function:

◆ save()

ilECSDataMappingSetting::save ( )

Save mappings.

Definition at line 106 of file class.ilECSDataMappingSetting.php.

106 : void
107 {
108 $query = 'SELECT * FROM ecs_data_mapping ' .
109 'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
110 'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
111 'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
112 $res = $this->db->query($query);
113 if ($res->numRows()) {
114 $this->update();
115 } else {
116 $this->create();
117 }
118 }

References $res, create(), getECSField(), getMappingType(), getServerId(), and update().

+ Here is the call graph for this function:

◆ setAdvMDId()

ilECSDataMappingSetting::setAdvMDId ( int  $a_id)

Definition at line 98 of file class.ilECSDataMappingSetting.php.

98 : void
99 {
100 $this->advmd_id = $a_id;
101 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setECSField()

ilECSDataMappingSetting::setECSField ( string  $ecs_field)

Definition at line 64 of file class.ilECSDataMappingSetting.php.

64 : void
65 {
66 $this->ecs_field = $ecs_field;
67 }

References $ecs_field.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setMappingType()

ilECSDataMappingSetting::setMappingType ( int  $mapping_type)

Set mapping type.

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

80 : void
81 {
82 $this->mapping_type = $mapping_type;
83 }

References $mapping_type.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSDataMappingSetting::setServerId ( int  $a_server_id)

set server id

Definition at line 51 of file class.ilECSDataMappingSetting.php.

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ update()

ilECSDataMappingSetting::update ( )
protected

Update setting.

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

123 : void
124 {
125 $query = 'UPDATE ecs_data_mapping ' .
126 'SET advmd_id = ' . $this->db->quote($this->getAdvMDId(), 'integer') . ' ' .
127 'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
128 'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
129 'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
130 $this->db->manipulate($query);
131 }

References getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $advmd_id

int ilECSDataMappingSetting::$advmd_id = 0
private

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

Referenced by getAdvMDId().

◆ $db

ilDBInterface ilECSDataMappingSetting::$db
private

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

◆ $ecs_field

string ilECSDataMappingSetting::$ecs_field = ''
private

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

Referenced by getECSField(), and setECSField().

◆ $mapping_type

int ilECSDataMappingSetting::$mapping_type = 0
private

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

Referenced by getMappingType(), and setMappingType().

◆ $server_id

int ilECSDataMappingSetting::$server_id = 0
private

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

Referenced by getServerId().

◆ MAPPING_EXPORT

const ilECSDataMappingSetting::MAPPING_EXPORT = 1

◆ MAPPING_IMPORT_CRS

const ilECSDataMappingSetting::MAPPING_IMPORT_CRS = 2

Definition at line 27 of file class.ilECSDataMappingSetting.php.

Referenced by ilECSSettingsGUI\initMappingsForm().

◆ MAPPING_IMPORT_RCRS


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