ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  }
settings()
Definition: settings.php:2
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
+ 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['DIC']['ilLog']->write(__METHOD__ . ': Using deprecate call');
64  $GLOBALS['DIC']['ilLog']->logStack();
65 
66  return self::getInstanceByServerId(1);
67  }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 $DIC, $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

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: saml.php:7
$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 132 of file class.ilECSDataMappingSettings.php.

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

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  }

◆ getMappings()

ilECSDataMappingSettings::getMappings (   $a_mapping_type = 0)

get mappings

public

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

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

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

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

private

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

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

Referenced by __construct().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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: