ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSDataMappingSettings Class Reference
+ Collaboration diagram for ilECSDataMappingSettings:

Public Member Functions

 getMappings ()
 get mappings
 setMappings ($a_mappings)
 set mappings
 getMappingByECSName ($a_key)
 get mapping by key
 save ()
 Save mappings.

Static Public Member Functions

static _getInstance ()
 Get Singleton instance.

Private Member Functions

 __construct ()
 Singleton Constructor.
 initStorage ()
 init data storage
 read ()
 Read settings.

Private Attributes

 $mappings = array()

Static Private Attributes

static $instance = null

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
$Id$

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

Constructor & Destructor Documentation

ilECSDataMappingSettings::__construct ( )
private

Singleton Constructor.

private

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

References initStorage(), and read().

{
$this->initStorage();
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSDataMappingSettings::getMappingByECSName (   $a_key)

get mapping by key

public

Parameters
stringECS data field name. E.g. 'lecturer'
Returns
int AdvancedMetaData field id or 0 (no mapping)

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

{
return isset($this->mappings[$a_key]) ? $this->mappings[$a_key] : 0;
}
ilECSDataMappingSettings::getMappings ( )

get mappings

public

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

{
return $this->mappings ? $this->mappings : array();
}
ilECSDataMappingSettings::initStorage ( )
private

init data storage

private

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

Referenced by __construct().

{
include_once('./Services/Administration/classes/class.ilSetting.php');
$this->storage = new ilSetting('ecs_mappings');
}

+ Here is the caller graph for this function:

ilECSDataMappingSettings::read ( )
private

Read settings.

private

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

References $mappings.

Referenced by __construct().

{
$mappings = $this->storage->get('mappings');
{
$this->mappings = unserialize(stripslashes($mappings));
}
}

+ Here is the caller graph for this function:

ilECSDataMappingSettings::save ( )

Save mappings.

public

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

{
$this->storage->set('mappings',addslashes(serialize($this->mappings)));
}
ilECSDataMappingSettings::setMappings (   $a_mappings)

set mappings

public

Parameters
arraye.g array('lecturer' => 0,'room' => 17). Which means 'lecturer' is ignored, 'room' is mapped against AdvancedFieldDefinition 17.

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

{
if(!is_array($a_mappings))
{
return false;
}
$this->mappings = array();
foreach($a_mappings as $key => $field_id)
{
$this->mappings[$key] = (int) $field_id;
}
return true;
}

Field Documentation

ilECSDataMappingSettings::$instance = null
staticprivate

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

Referenced by _getInstance().

ilECSDataMappingSettings::$mappings = array()
private

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

Referenced by read().


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