ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSDataMappingSettings Class Reference
+ Collaboration diagram for ilECSDataMappingSettings:

Public Member Functions

 getServer ()
 Get actice ecs setting. More...
 
 getMappings ($a_mapping_type=0)
 get mappings More...
 
 getMappingByECSName ($a_mapping_type, $a_key)
 get mapping by key More...
 

Static Public Member Functions

static _getInstance ()
 Get Singleton instance. More...
 
static getInstanceByServerId ($a_server_id)
 Get singleton instance. More...
 
static delete ($a_server_id)
 Delete server ilDB $ilDB. More...
 

Private Member Functions

 __construct ($a_server_id)
 Singleton Constructor. More...
 
 read ()
 Read settings. More...
 

Private Attributes

 $settings = null
 
 $mappings = array()
 

Static Private Attributes

static $instances = null
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilECSDataMappingSettings::__construct (   $a_server_id)
private

Singleton Constructor.

private

Definition at line 48 of file class.ilECSDataMappingSettings.php.

References ilECSSetting\getInstanceByServerId(), read(), and settings().

49  {
50  $this->settings = ilECSSetting::getInstanceByServerId($a_server_id);
51  $this->read();
52  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilECSDataMappingSettings::_getInstance ( )
static

Get Singleton instance.

public

Deprecated:

Definition at line 61 of file class.ilECSDataMappingSettings.php.

References $GLOBALS.

Referenced by ilECSSettingsGUI\exportImported(), ilECSSettingsGUI\exportReleased(), ilAdvancedMDSubstitution\initECSMappings(), and ilAdvancedMDRecordGUI\showECSStart().

62  {
63  $GLOBALS['ilLog']->write(__METHOD__ . ': Using deprecate call');
64  $GLOBALS['ilLog']->logStack();
65 
66  return self::getInstanceByServerId(1);
67  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the caller graph for this function:

◆ delete()

static ilECSDataMappingSettings::delete (   $a_server_id)
static

Delete server ilDB $ilDB.

Parameters
int$a_server_id

Definition at line 87 of file class.ilECSDataMappingSettings.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

88  {
89  global $ilDB;
90 
91  $query = 'DELETE from ecs_data_mapping ' .
92  'WHERE sid = ' . $ilDB->quote($a_server_id, 'integer');
93  $ilDB->manipulate($query);
94  }
$query
global $ilDB
+ Here is the caller graph for this function:

◆ getInstanceByServerId()

static ilECSDataMappingSettings::getInstanceByServerId (   $a_server_id)
static

Get singleton instance.

Parameters
int$a_server_id
Returns
ilECSDataMappingSettings

Definition at line 74 of file class.ilECSDataMappingSettings.php.

Referenced by ilECSObjectSettings\addMetadataToJson(), ilECSReleasedContentTableGUI\fillRow(), ilECSImportedContentTableGUI\fillRow(), ilRemoteObjectBase\importMetadataFromJson(), and ilECSSettingsGUI\initMappingsForm().

75  {
76  if (isset(self::$instances[$a_server_id])) {
77  return self::$instances[$a_server_id];
78  }
79  return self::$instances[$a_server_id] = new ilECSDataMappingSettings($a_server_id);
80  }
+ Here is the caller graph for this function:

◆ getMappingByECSName()

ilECSDataMappingSettings::getMappingByECSName (   $a_mapping_type,
  $a_key 
)

get mapping by key

public

Parameters
intmapping type import, export, crs, rcrs
stringECS data field name. E.g. 'lecturer'
Returns
int AdvancedMetaData field id or 0 (no mapping)

Definition at line 130 of file class.ilECSDataMappingSettings.php.

References array, and ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

131  {
132  if (!$a_mapping_type) {
134  }
135 
136  return array_key_exists($a_key, (array) $this->mappings[$a_mapping_type]) ?
137  $this->mappings[$a_mapping_type][$a_key] :
138  0;
139  }
Create styles array
The data for the language used.

◆ getMappings()

ilECSDataMappingSettings::getMappings (   $a_mapping_type = 0)

get mappings

public

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

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

113  {
114  if (!$a_mapping_type) {
116  }
117  return $this->mappings[$a_mapping_type];
118  }

◆ getServer()

ilECSDataMappingSettings::getServer ( )

Get actice ecs setting.

Returns
ilECSSetting

Definition at line 100 of file class.ilECSDataMappingSettings.php.

References $settings.

Referenced by read().

+ Here is the caller graph for this function:

◆ read()

ilECSDataMappingSettings::read ( )
private

Read settings.

private

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

References $ilDB, $query, $res, $row, array, ilDBConstants\FETCHMODE_OBJECT, and getServer().

Referenced by __construct().

150  {
151  global $ilDB;
152 
153  $this->mappings = array();
154 
155  $query = 'SELECT * FROM ecs_data_mapping ' .
156  'WHERE sid = ' . $ilDB->quote($this->getServer()->getServerId(), 'integer') . ' ';
157  $res = $ilDB->query($query);
158  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
159  $this->mappings[$row->mapping_type][$row->ecs_field] = $row->advmd_id;
160  }
161  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $instances

ilECSDataMappingSettings::$instances = null
staticprivate

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

◆ $mappings

ilECSDataMappingSettings::$mappings = array()
private

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

◆ $settings

ilECSDataMappingSettings::$settings = null
private

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

Referenced by getServer().


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