ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 50 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 $ilDB, $query, $res, getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

164  {
165  global $ilDB;
166 
167  $query = 'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) '.
168  'VALUES('.
169  $ilDB->quote($this->getServerId(), 'integer') . ', ' .
170  $ilDB->quote($this->getMappingType(),'integer').', '.
171  $ilDB->quote($this->getECSField(),'text').', '.
172  $ilDB->quote($this->getAdvMDId(),'integer').' ) ';
173  $res = $ilDB->manipulate($query);
174  return true;
175  }
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 202 of file class.ilECSDataMappingSetting.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

203  {
204  global $ilDB;
205 
206  $query = 'DELETE FROM ecs_data_mapping'.
207  ' WHERE sid = '.$ilDB->quote($a_server_id,'integer');
208  $ilDB->manipulate($query);
209  return true;
210  }
global $ilDB
+ Here is the caller graph for this function:

◆ getAdvMDId()

ilECSDataMappingSetting::getAdvMDId ( )
Returns
int

Definition at line 113 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 86 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 103 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 69 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 184 of file class.ilECSDataMappingSetting.php.

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

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

◆ save()

ilECSDataMappingSetting::save ( )

Save mappings.

public

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

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

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

◆ setAdvMDId()

ilECSDataMappingSetting::setAdvMDId (   $a_id)

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

Referenced by read().

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

◆ setECSField()

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

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

References $ecs_field.

Referenced by __construct().

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

◆ setMappingType()

ilECSDataMappingSetting::setMappingType (   $mapping_type)

Set mapping type.

Parameters
int$mapping_type

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

References $mapping_type.

Referenced by __construct().

96  {
97  $this->mapping_type = $mapping_type;
98  }
+ 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 61 of file class.ilECSDataMappingSetting.php.

Referenced by __construct().

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

◆ update()

ilECSDataMappingSetting::update ( )
protected

Update setting ilDB $ilDB.

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

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

Referenced by save().

152  {
153  global $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 $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 42 of file class.ilECSDataMappingSetting.php.

Referenced by getAdvMDId().

◆ $ecs_field

ilECSDataMappingSetting::$ecs_field = 0
private

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

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

◆ $mapping_type

ilECSDataMappingSetting::$mapping_type = 0
private

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

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

◆ $server_id

ilECSDataMappingSetting::$server_id = 0
private

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

Referenced by ilECSSettingsGUI\initMappingsForm().

◆ MAPPING_IMPORT_RCRS


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