ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSDataMappingSetting Class Reference
+ Collaboration diagram for ilECSDataMappingSetting:

Public Member Functions

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

Static Public Member Functions

static deleteByServerId ($a_server_id)
 

Data Fields

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

Protected Member Functions

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

Private Member Functions

 read ()
 Read settings. More...
 

Private Attributes

 $server_id = 0
 
 $mapping_type = 0
 
 $ecs_field = 0
 
 $advmd_id = 0
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

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

constructor public

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

References $ecs_field, $mapping_type, setECSField(), setMappingType(), and setServerId().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSDataMappingSetting::create ( )
protected

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

References $DIC, $ilDB, $query, $res, getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

164  {
165  global $DIC;
166 
167  $ilDB = $DIC['ilDB'];
168 
169  $query = 'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) ' .
170  'VALUES(' .
171  $ilDB->quote($this->getServerId(), 'integer') . ', ' .
172  $ilDB->quote($this->getMappingType(), 'integer') . ', ' .
173  $ilDB->quote($this->getECSField(), 'text') . ', ' .
174  $ilDB->quote($this->getAdvMDId(), 'integer') . ' ) ';
175  $res = $ilDB->manipulate($query);
176  return true;
177  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSDataMappingSetting::deleteByServerId (   $a_server_id)
static

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

References $DIC, $ilDB, and $query.

Referenced by ilECSSetting\delete().

205  {
206  global $DIC;
207 
208  $ilDB = $DIC['ilDB'];
209 
210  $query = 'DELETE FROM ecs_data_mapping' .
211  ' WHERE sid = ' . $ilDB->quote($a_server_id, 'integer');
212  $ilDB->manipulate($query);
213  return true;
214  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ getAdvMDId()

ilECSDataMappingSetting::getAdvMDId ( )
Returns
int

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

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 85 of file class.ilECSDataMappingSetting.php.

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 102 of file class.ilECSDataMappingSetting.php.

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 68 of file class.ilECSDataMappingSetting.php.

References $server_id.

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

+ Here is the caller graph for this function:

◆ read()

ilECSDataMappingSetting::read ( )
private

Read settings.

private

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

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getECSField(), getMappingType(), getServerId(), and setAdvMDId().

187  {
188  global $DIC;
189 
190  $ilDB = $DIC['ilDB'];
191 
192  if ($this->getServerId() and $this->getMappingType() and $this->getECSField()) {
193  $query = 'SELECT * FROM ecs_data_mapping ' .
194  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
195  'AND mapping_type = ' . $ilDB->quote($this->getMappingType(), 'integer') . ' ' .
196  'AND ecs_field = ' . $ilDB->quote($this->getECSField(), 'text');
197  $res = $ilDB->query($query);
198  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
199  $this->setAdvMDId($row->advmd_id);
200  }
201  }
202  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the call graph for this function:

◆ save()

ilECSDataMappingSetting::save ( )

Save mappings.

public

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

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

128  {
129  global $DIC;
130 
131  $ilDB = $DIC['ilDB'];
132 
133  $query = 'SELECT * FROM ecs_data_mapping ' .
134  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
135  'AND mapping_type = ' . $ilDB->quote($this->getMappingType(), 'integer') . ' ' .
136  'AND ecs_field = ' . $ilDB->quote($this->getECSField(), 'text');
137  $res = $ilDB->query($query);
138  if ($res->numRows()) {
139  $this->update();
140  } else {
141  $this->create();
142  }
143  }
update()
Update setting ilDB $ilDB.
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ setAdvMDId()

ilECSDataMappingSetting::setAdvMDId (   $a_id)

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

Referenced by read().

118  {
119  $this->advmd_id = $a_id;
120  }
+ Here is the caller graph for this function:

◆ setECSField()

ilECSDataMappingSetting::setECSField (   $ecs_field)
Parameters
string$ecs_field

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

References $ecs_field.

Referenced by __construct().

78  {
79  $this->ecs_field = $ecs_field;
80  }
+ Here is the caller graph for this function:

◆ setMappingType()

ilECSDataMappingSetting::setMappingType (   $mapping_type)

Set mapping type.

Parameters
int$mapping_type

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

References $mapping_type.

Referenced by __construct().

95  {
96  $this->mapping_type = $mapping_type;
97  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSDataMappingSetting::setServerId (   $a_server_id)

set server id

Parameters
int$a_server_id

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

Referenced by __construct().

61  {
62  $this->server_id = $a_server_id;
63  }
+ Here is the caller graph for this function:

◆ update()

ilECSDataMappingSetting::update ( )
protected

Update setting ilDB $ilDB.

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

References $DIC, $ilDB, $query, getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

150  {
151  global $DIC;
152 
153  $ilDB = $DIC['ilDB'];
154 
155  $query = 'UPDATE ecs_data_mapping ' .
156  'SET advmd_id = ' . $ilDB->quote($this->getAdvMDId(), 'integer') . ' ' .
157  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
158  'AND mapping_type = ' . $ilDB->quote($this->getMappingType(), 'integer') . ' ' .
159  'AND ecs_field = ' . $ilDB->quote($this->getECSField(), 'text');
160  $ilDB->manipulate($query);
161  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $advmd_id

ilECSDataMappingSetting::$advmd_id = 0
private

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

Referenced by getAdvMDId().

◆ $ecs_field

ilECSDataMappingSetting::$ecs_field = 0
private

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

Referenced by __construct(), getECSField(), and setECSField().

◆ $mapping_type

ilECSDataMappingSetting::$mapping_type = 0
private

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

Referenced by __construct(), getMappingType(), and setMappingType().

◆ $server_id

ilECSDataMappingSetting::$server_id = 0
private

Definition at line 38 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 35 of file class.ilECSDataMappingSetting.php.

Referenced by ilECSSettingsGUI\initMappingsForm().

◆ MAPPING_IMPORT_RCRS


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