ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilECSDataMappingSettings.php
Go to the documentation of this file.
1
<?php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php'
;
25
include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php'
;
26
35
class
ilECSDataMappingSettings
36
{
37
private
static
$instances
= null;
38
39
private
$settings
= null;
40
private
$mappings
=
array
();
41
48
private
function
__construct
($a_server_id)
49
{
50
$this->
settings
=
ilECSSetting::getInstanceByServerId
($a_server_id);
51
$this->
read
();
52
}
53
61
public
static
function
_getInstance
()
62
{
63
$GLOBALS
[
'ilLog'
]->write(__METHOD__ .
': Using deprecate call'
);
64
$GLOBALS
[
'ilLog'
]->logStack();
65
66
return
self::getInstanceByServerId(1);
67
}
68
74
public
static
function
getInstanceByServerId
($a_server_id)
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
}
81
87
public
static
function
delete
($a_server_id)
88
{
89
global
$ilDB
;
90
91
$query
=
'DELETE from ecs_data_mapping '
.
92
'WHERE sid = '
. $ilDB->quote($a_server_id,
'integer'
);
93
$ilDB->manipulate(
$query
);
94
}
95
100
public
function
getServer
()
101
{
102
return
$this->settings
;
103
}
104
105
112
public
function
getMappings
($a_mapping_type = 0)
113
{
114
if
(!$a_mapping_type) {
115
$a_mapping_type =
ilECSDataMappingSetting::MAPPING_IMPORT_RCRS
;
116
}
117
return
$this->mappings[$a_mapping_type];
118
}
119
120
130
public
function
getMappingByECSName
($a_mapping_type, $a_key)
131
{
132
if
(!$a_mapping_type) {
133
$a_mapping_type =
ilECSDataMappingSetting::MAPPING_IMPORT_RCRS
;
134
}
135
136
return
array_key_exists($a_key, (
array
) $this->mappings[$a_mapping_type]) ?
137
$this->mappings[$a_mapping_type][$a_key] :
138
0;
139
}
140
141
142
149
private
function
read
()
150
{
151
global
$ilDB
;
152
153
$this->mappings =
array
();
154
155
$query
=
'SELECT * FROM ecs_data_mapping '
.
156
'WHERE sid = '
. $ilDB->quote($this->
getServer
()->getServerId(),
'integer'
) .
' '
;
157
$res
= $ilDB->query(
$query
);
158
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
159
$this->mappings[
$row
->mapping_type][
$row
->ecs_field] =
$row
->advmd_id;
160
}
161
}
162
}
ilECSDataMappingSettings\getMappings
getMappings($a_mapping_type=0)
get mappings
Definition:
class.ilECSDataMappingSettings.php:112
ilECSDataMappingSettings\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance.
Definition:
class.ilECSDataMappingSettings.php:74
ilECSSetting\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Definition:
class.ilECSSetting.php:109
ilECSDataMappingSetting\MAPPING_IMPORT_RCRS
const MAPPING_IMPORT_RCRS
Definition:
class.ilECSDataMappingSetting.php:36
ilECSDataMappingSettings\__construct
__construct($a_server_id)
Singleton Constructor.
Definition:
class.ilECSDataMappingSettings.php:48
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
ilECSDataMappingSettings\getServer
getServer()
Get actice ecs setting.
Definition:
class.ilECSDataMappingSettings.php:100
ilECSDataMappingSettings\read
read()
Read settings.
Definition:
class.ilECSDataMappingSettings.php:149
ilECSDataMappingSettings\$mappings
$mappings
Definition:
class.ilECSDataMappingSettings.php:40
ilECSDataMappingSettings\getMappingByECSName
getMappingByECSName($a_mapping_type, $a_key)
get mapping by key
Definition:
class.ilECSDataMappingSettings.php:130
ilECSDataMappingSettings\$settings
$settings
Definition:
class.ilECSDataMappingSettings.php:39
ilECSDataMappingSettings
Definition:
class.ilECSDataMappingSettings.php:35
ilECSDataMappingSettings\$instances
static $instances
Definition:
class.ilECSDataMappingSettings.php:37
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$query
$query
Definition:
proxy_ylocal.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
settings
settings()
Definition:
settings.php:2
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilECSDataMappingSettings\_getInstance
static _getInstance()
Get Singleton instance.
Definition:
class.ilECSDataMappingSettings.php:61
Services
WebServices
ECS
classes
class.ilECSDataMappingSettings.php
Generated on Sat Jan 18 2025 19:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)