19 declare(strict_types=1);
31 private ilDbInterface
$db;
38 $this->db = $DIC->database();
49 return self::$instances[$a_server_id] ?? (self::$instances[$a_server_id] =
new ilECSDataMappingSettings($a_server_id));
55 public function delete():
void 57 $server_id = $this->
settings->getServerId();
58 unset(self::$instances[$server_id]);
60 $query =
'DELETE from ecs_data_mapping ' .
61 'WHERE sid = ' . $this->db->quote($server_id,
'integer');
62 $this->db->manipulate($query);
80 return $this->mappings[$a_mapping_type];
94 return $this->mappings[$a_mapping_type][$a_key] ?? 0;
105 $this->mappings = array();
107 $query =
'SELECT * FROM ecs_data_mapping ' .
108 'WHERE sid = ' . $this->db->quote($this->
getServer()->getServerId(),
'integer') .
' ';
109 $res = $this->db->query($query);
111 $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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.