18 declare(strict_types=1);
30 private ilDbInterface
$db;
37 $this->db = $DIC->database();
48 return self::$instances[$a_server_id] ?? (self::$instances[$a_server_id] =
new ilECSDataMappingSettings($a_server_id));
54 public function delete():
void 56 $server_id = $this->
settings->getServerId();
57 unset(self::$instances[$server_id]);
59 $query =
'DELETE from ecs_data_mapping ' .
60 'WHERE sid = ' . $this->db->quote($server_id,
'integer');
61 $this->db->manipulate(
$query);
79 return $this->mappings[$a_mapping_type];
93 return $this->mappings[$a_mapping_type][$a_key] ?? 0;
104 $this->mappings = array();
106 $query =
'SELECT * FROM ecs_data_mapping ' .
107 'WHERE sid = ' . $this->db->quote($this->
getServer()->getServerId(),
'integer') .
' ';
110 $this->mappings[$row->mapping_type][$row->ecs_field] = (
int) $row->advmd_id;
static getInstanceByServerId(int $a_server_id)
Get singleton instance.
const MAPPING_IMPORT_RCRS
getServer()
Get actice ecs setting.
getMappingByECSName(int $a_mapping_type, string $a_key)
get mapping by key
static getInstanceByServerId(int $a_server_id)
Get singleton instance per server.
getMappings($a_mapping_type=ilECSDataMappingSetting::MAPPING_IMPORT_RCRS)
get mappings
__construct(int $a_server_id)
Singleton Constructor.