ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
[
'DIC'
][
'ilLog'
]->write(__METHOD__ .
': Using deprecate call'
);
64
$GLOBALS
[
'DIC'
][
'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
$DIC
;
90
91
$ilDB
= $DIC[
'ilDB'
];
92
93
$query
=
'DELETE from ecs_data_mapping '
.
94
'WHERE sid = '
.
$ilDB
->quote($a_server_id,
'integer'
);
95
$ilDB
->manipulate(
$query
);
96
}
97
102
public
function
getServer
()
103
{
104
return
$this->settings
;
105
}
106
107
114
public
function
getMappings
($a_mapping_type = 0)
115
{
116
if
(!$a_mapping_type) {
117
$a_mapping_type =
ilECSDataMappingSetting::MAPPING_IMPORT_RCRS
;
118
}
119
return
$this->mappings[$a_mapping_type];
120
}
121
122
132
public
function
getMappingByECSName
($a_mapping_type, $a_key)
133
{
134
if
(!$a_mapping_type) {
135
$a_mapping_type =
ilECSDataMappingSetting::MAPPING_IMPORT_RCRS
;
136
}
137
138
return
array_key_exists($a_key, (array) $this->mappings[$a_mapping_type]) ?
139
$this->mappings[$a_mapping_type][$a_key] :
140
0;
141
}
142
143
144
151
private
function
read
()
152
{
153
global
$DIC
;
154
155
$ilDB
= $DIC[
'ilDB'
];
156
157
$this->mappings = array();
158
159
$query
=
'SELECT * FROM ecs_data_mapping '
.
160
'WHERE sid = '
.
$ilDB
->quote($this->
getServer
()->getServerId(),
'integer'
) .
' '
;
161
$res
=
$ilDB
->query(
$query
);
162
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
163
$this->mappings[
$row
->mapping_type][
$row
->ecs_field] =
$row
->advmd_id;
164
}
165
}
166
}
ilECSDataMappingSettings\getMappings
getMappings($a_mapping_type=0)
get mappings
Definition:
class.ilECSDataMappingSettings.php:114
ilECSDataMappingSettings\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance.
Definition:
class.ilECSDataMappingSettings.php:74
settings
settings()
Definition:
settings.php:2
ilECSSetting\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Definition:
class.ilECSSetting.php:110
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
$DIC
global $DIC
Definition:
saml.php:7
ilECSDataMappingSettings\getServer
getServer()
Get actice ecs setting.
Definition:
class.ilECSDataMappingSettings.php:102
ilECSDataMappingSettings\read
read()
Read settings.
Definition:
class.ilECSDataMappingSettings.php:151
ilECSDataMappingSettings\$mappings
$mappings
Definition:
class.ilECSDataMappingSettings.php:40
ilECSDataMappingSettings\getMappingByECSName
getMappingByECSName($a_mapping_type, $a_key)
get mapping by key
Definition:
class.ilECSDataMappingSettings.php:132
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
$row
$row
Definition:
migrateto20.php:360
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSDataMappingSettings\_getInstance
static _getInstance()
Get Singleton instance.
Definition:
class.ilECSDataMappingSettings.php:61
$GLOBALS
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Definition:
module.tag.xmp.php:702
Services
WebServices
ECS
classes
class.ilECSDataMappingSettings.php
Generated on Thu Feb 27 2025 19:02:08 for ILIAS by
1.8.13 (using
Doxyfile
)