ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSDataMappingSetting.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
32
class
ilECSDataMappingSetting
33
{
34
const
MAPPING_EXPORT
= 1;
35
const
MAPPING_IMPORT_CRS
= 2;
36
const
MAPPING_IMPORT_RCRS
= 3;
37
38
private
$server_id
= 0;
39
private
$mapping_type
= 0;
40
private
$ecs_field
= 0;
41
private
$advmd_id
= 0;
42
43
49
public
function
__construct
($a_server_id = 0,
$mapping_type
= 0,
$ecs_field
=
''
)
50
{
51
$this->
setServerId
($a_server_id);
52
$this->
setMappingType
(
$mapping_type
);
53
$this->
setECSField
(
$ecs_field
);
54
}
55
60
public
function
setServerId
($a_server_id)
61
{
62
$this->server_id = $a_server_id;
63
}
64
68
public
function
getServerId
()
69
{
70
return
$this->server_id
;
71
}
72
77
public
function
setECSField
(
$ecs_field
)
78
{
79
$this->ecs_field =
$ecs_field
;
80
}
81
85
public
function
getECSField
()
86
{
87
return
$this->ecs_field
;
88
}
89
94
public
function
setMappingType
(
$mapping_type
)
95
{
96
$this->mapping_type =
$mapping_type
;
97
}
98
102
public
function
getMappingType
()
103
{
104
return
$this->mapping_type
;
105
}
106
107
112
public
function
getAdvMDId
()
113
{
114
return
$this->advmd_id
;
115
}
116
117
public
function
setAdvMDId
($a_id)
118
{
119
$this->advmd_id = $a_id;
120
}
121
127
public
function
save
()
128
{
129
global
$DIC
;
130
131
$ilDB
= $DIC[
'ilDB'
];
132
133
$query
=
'SELECT * FROM ecs_data_mapping '
.
134
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
135
'AND mapping_type = '
.
$ilDB
->quote($this->
getMappingType
(),
'integer'
) .
' '
.
136
'AND ecs_field = '
.
$ilDB
->quote($this->
getECSField
(),
'text'
);
137
$res
=
$ilDB
->query(
$query
);
138
if
(
$res
->numRows()) {
139
$this->
update
();
140
}
else
{
141
$this->
create
();
142
}
143
}
144
149
protected
function
update
()
150
{
151
global
$DIC
;
152
153
$ilDB
= $DIC[
'ilDB'
];
154
155
$query
=
'UPDATE ecs_data_mapping '
.
156
'SET advmd_id = '
.
$ilDB
->quote($this->
getAdvMDId
(),
'integer'
) .
' '
.
157
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
158
'AND mapping_type = '
.
$ilDB
->quote($this->
getMappingType
(),
'integer'
) .
' '
.
159
'AND ecs_field = '
.
$ilDB
->quote($this->
getECSField
(),
'text'
);
160
$ilDB
->manipulate(
$query
);
161
}
162
163
protected
function
create
()
164
{
165
global
$DIC
;
166
167
$ilDB
= $DIC[
'ilDB'
];
168
169
$query
=
'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) '
.
170
'VALUES('
.
171
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
', '
.
172
$ilDB
->quote($this->
getMappingType
(),
'integer'
) .
', '
.
173
$ilDB
->quote($this->
getECSField
(),
'text'
) .
', '
.
174
$ilDB
->quote($this->
getAdvMDId
(),
'integer'
) .
' ) '
;
175
$res
=
$ilDB
->manipulate(
$query
);
176
return
true
;
177
}
178
179
186
private
function
read
()
187
{
188
global
$DIC
;
189
190
$ilDB
= $DIC[
'ilDB'
];
191
192
if
($this->
getServerId
()
and
$this->
getMappingType
()
and
$this->
getECSField
()) {
193
$query
=
'SELECT * FROM ecs_data_mapping '
.
194
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
195
'AND mapping_type = '
.
$ilDB
->quote($this->
getMappingType
(),
'integer'
) .
' '
.
196
'AND ecs_field = '
.
$ilDB
->quote($this->
getECSField
(),
'text'
);
197
$res
=
$ilDB
->query(
$query
);
198
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
199
$this->
setAdvMDId
(
$row
->advmd_id);
200
}
201
}
202
}
203
204
public
static
function
deleteByServerId
($a_server_id)
205
{
206
global
$DIC
;
207
208
$ilDB
= $DIC[
'ilDB'
];
209
210
$query
=
'DELETE FROM ecs_data_mapping'
.
211
' WHERE sid = '
.
$ilDB
->quote($a_server_id,
'integer'
);
212
$ilDB
->manipulate(
$query
);
213
return
true
;
214
}
215
}
ilECSDataMappingSetting\MAPPING_IMPORT_RCRS
const MAPPING_IMPORT_RCRS
Definition:
class.ilECSDataMappingSetting.php:36
ilECSDataMappingSetting\update
update()
Update setting ilDB $ilDB.
Definition:
class.ilECSDataMappingSetting.php:149
ilECSDataMappingSetting\save
save()
Save mappings.
Definition:
class.ilECSDataMappingSetting.php:127
ilECSDataMappingSetting\MAPPING_EXPORT
const MAPPING_EXPORT
Definition:
class.ilECSDataMappingSetting.php:34
$DIC
global $DIC
Definition:
saml.php:7
ilECSDataMappingSetting\getAdvMDId
getAdvMDId()
Definition:
class.ilECSDataMappingSetting.php:112
ilECSDataMappingSetting\getMappingType
getMappingType()
Get mapping type.
Definition:
class.ilECSDataMappingSetting.php:102
ilECSDataMappingSetting\read
read()
Read settings.
Definition:
class.ilECSDataMappingSetting.php:186
ilECSDataMappingSetting\setAdvMDId
setAdvMDId($a_id)
Definition:
class.ilECSDataMappingSetting.php:117
ilECSDataMappingSetting\setMappingType
setMappingType($mapping_type)
Set mapping type.
Definition:
class.ilECSDataMappingSetting.php:94
ilECSDataMappingSetting\$ecs_field
$ecs_field
Definition:
class.ilECSDataMappingSetting.php:40
ilECSDataMappingSetting\getServerId
getServerId()
Get server id.
Definition:
class.ilECSDataMappingSetting.php:68
ilECSDataMappingSetting
Definition:
class.ilECSDataMappingSetting.php:32
ilECSDataMappingSetting\setServerId
setServerId($a_server_id)
set server id
Definition:
class.ilECSDataMappingSetting.php:60
ilECSDataMappingSetting\$mapping_type
$mapping_type
Definition:
class.ilECSDataMappingSetting.php:39
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSDataMappingSetting\create
create()
Definition:
class.ilECSDataMappingSetting.php:163
ilECSDataMappingSetting\MAPPING_IMPORT_CRS
const MAPPING_IMPORT_CRS
Definition:
class.ilECSDataMappingSetting.php:35
$query
$query
Definition:
proxy_ylocal.php:13
$row
$row
Definition:
migrateto20.php:360
ilECSDataMappingSetting\getECSField
getECSField()
Get ecs field.
Definition:
class.ilECSDataMappingSetting.php:85
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSDataMappingSetting\deleteByServerId
static deleteByServerId($a_server_id)
Definition:
class.ilECSDataMappingSetting.php:204
php
and
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSDataMappingSetting\$advmd_id
$advmd_id
Definition:
class.ilECSDataMappingSetting.php:41
ilECSDataMappingSetting\setECSField
setECSField($ecs_field)
Definition:
class.ilECSDataMappingSetting.php:77
ilECSDataMappingSetting\__construct
__construct($a_server_id=0, $mapping_type=0, $ecs_field='')
constructor public
Definition:
class.ilECSDataMappingSetting.php:49
ilECSDataMappingSetting\$server_id
$server_id
Definition:
class.ilECSDataMappingSetting.php:38
Services
WebServices
ECS
classes
class.ilECSDataMappingSetting.php
Generated on Thu Mar 13 2025 19:02:09 for ILIAS by
1.8.13 (using
Doxyfile
)