ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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(), and read().

49  {
50  $this->settings = ilECSSetting::getInstanceByServerId($a_server_id);
51  $this->read();
52  }
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['ilLog']->write(__METHOD__.': Using deprecate call');
64  $GLOBALS['ilLog']->logStack();
65 
66  return self::getInstanceByServerId(1);
67  }
$GLOBALS['ct_recipient']
+ 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 88 of file class.ilECSDataMappingSettings.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

89  {
90  global $ilDB;
91 
92  $query = 'DELETE from ecs_data_mapping '.
93  'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
94  $ilDB->manipulate($query);
95  }
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  {
78  return self::$instances[$a_server_id];
79  }
80  return self::$instances[$a_server_id] = new ilECSDataMappingSettings($a_server_id);
81  }
+ 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)
135  {
137  }
138 
139  return array_key_exists($a_key, (array) $this->mappings[$a_mapping_type]) ?
140  $this->mappings[$a_mapping_type][$a_key] :
141  0;
142  }

◆ getMappings()

ilECSDataMappingSettings::getMappings (   $a_mapping_type = 0)

get mappings

public

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

References ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

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

◆ getServer()

ilECSDataMappingSettings::getServer ( )

Get actice ecs setting.

Returns
ilECSSetting

Definition at line 101 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 152 of file class.ilECSDataMappingSettings.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getServer().

Referenced by __construct().

153  {
154  global $ilDB;
155 
156  $this->mappings = array();
157 
158  $query = 'SELECT * FROM ecs_data_mapping '.
159  'WHERE sid = '.$ilDB->quote($this->getServer()->getServerId(),'integer').' ';
160  $res = $ilDB->query($query);
161  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
162  {
163  $this->mappings[$row->mapping_type][$row->ecs_field] = $row->advmd_id;
164  }
165  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
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: