ILIAS  release_7 Revision v7.30-3-g800a261c036
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 @global 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.

@access private

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilECSDataMappingSettings::_getInstance ( )
static

Get Singleton instance.

@access public

Deprecated:

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

62 {
63 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': Using deprecate call');
64 $GLOBALS['DIC']['ilLog']->logStack();
65
67 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getInstanceByServerId($a_server_id)
Get singleton instance.

References $GLOBALS, and getInstanceByServerId().

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

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

◆ delete()

static ilECSDataMappingSettings::delete (   $a_server_id)
static

Delete server @global ilDB $ilDB.

Parameters
int$a_server_id

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

88 {
89 global $DIC;
90
91 $ilDB = $DIC['ilDB'];
92
93 $query = 'DELETE from ecs_data_mapping ' .
94 'WHERE sid = ' . $ilDB->quote($a_server_id, 'integer');
95 $ilDB->manipulate($query);
96 }
global $DIC
Definition: goto.php:24
$query
global $ilDB

References $DIC, $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

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

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 }

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

+ Here is the caller graph for this function:

◆ getMappingByECSName()

ilECSDataMappingSettings::getMappingByECSName (   $a_mapping_type,
  $a_key 
)

get mapping by key

@access 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 132 of file class.ilECSDataMappingSettings.php.

133 {
134 if (!$a_mapping_type) {
136 }
137
138 return array_key_exists($a_key, (array) $this->mappings[$a_mapping_type]) ?
139 $this->mappings[$a_mapping_type][$a_key] :
140 0;
141 }

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

◆ getMappings()

ilECSDataMappingSettings::getMappings (   $a_mapping_type = 0)

get mappings

@access public

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

115 {
116 if (!$a_mapping_type) {
118 }
119 return $this->mappings[$a_mapping_type];
120 }

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

◆ getServer()

ilECSDataMappingSettings::getServer ( )

Get actice ecs setting.

Returns
ilECSSetting

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

References $settings.

Referenced by read().

+ Here is the caller graph for this function:

◆ read()

ilECSDataMappingSettings::read ( )
private

Read settings.

@access private

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

152 {
153 global $DIC;
154
155 $ilDB = $DIC['ilDB'];
156
157 $this->mappings = array();
158
159 $query = 'SELECT * FROM ecs_data_mapping ' .
160 'WHERE sid = ' . $ilDB->quote($this->getServer()->getServerId(), 'integer') . ' ';
161 $res = $ilDB->query($query);
162 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163 $this->mappings[$row->mapping_type][$row->ecs_field] = $row->advmd_id;
164 }
165 }
foreach($_POST as $key=> $value) $res

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

Referenced by __construct().

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