ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilMDIdentifier.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 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
31
include_once
'class.ilMDBase.php'
;
32
33
class
ilMDIdentifier
extends
ilMDBase
34
{
35
// SET/GET
36
public
function
setCatalog
($a_catalog)
37
{
38
$this->catalog = $a_catalog;
39
}
40
public
function
getCatalog
()
41
{
42
return
$this->catalog;
43
}
44
public
function
setEntry
($a_entry)
45
{
46
$this->entry = $a_entry;
47
}
48
public
function
getEntry
()
49
{
50
return
$this->entry;
51
}
52
53
54
public
function
save
()
55
{
56
if
($this->db->autoExecute(
57
'il_meta_identifier'
,
58
$this->__getFields(),
59
ilDBConstants::AUTOQUERY_INSERT
60
)) {
61
$this->
setMetaId
($this->db->getLastInsertId());
62
63
return
$this->
getMetaId
();
64
}
65
return
false
;
66
}
67
68
public
function
update
()
69
{
70
global
$ilDB
;
71
72
if
($this->
getMetaId
()) {
73
if
($this->db->autoExecute(
74
'il_meta_identifier'
,
75
$this->__getFields(),
76
ilDBConstants::AUTOQUERY_UPDATE
,
77
"meta_identifier_id = "
. $ilDB->quote($this->
getMetaId
())
78
)) {
79
return
true
;
80
}
81
}
82
return
false
;
83
}
84
85
public
function
delete
()
86
{
87
global
$ilDB
;
88
89
if
($this->
getMetaId
()) {
90
$query
=
"DELETE FROM il_meta_identifier "
.
91
"WHERE meta_identifier_id = "
. $ilDB->quote($this->
getMetaId
());
92
93
$this->db->query(
$query
);
94
95
return
true
;
96
}
97
return
false
;
98
}
99
100
101
public
function
__getFields
()
102
{
103
return
array(
'rbac_id'
=> $this->
getRBACId
(),
104
'obj_id'
=> $this->
getObjId
(),
105
'obj_type'
=>
ilUtil::prepareDBString
($this->
getObjType
()),
106
'parent_type'
=> $this->
getParentType
(),
107
'parent_id'
=> $this->
getParentId
(),
108
'catalog'
=>
ilUtil::prepareDBString
($this->
getCatalog
()),
109
'entry'
=>
ilUtil::prepareDBString
($this->
getEntry
()));
110
}
111
112
public
function
read
()
113
{
114
global
$ilDB
;
115
116
if
($this->
getMetaId
()) {
117
$query
=
"SELECT * FROM il_meta_identifier "
.
118
"WHERE meta_identifier_id = "
. $ilDB->quote($this->
getMetaId
());
119
120
$res
= $this->db->query(
$query
);
121
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
122
$this->
setRBACId
(
$row
->rbac_id);
123
$this->
setObjId
(
$row
->obj_id);
124
$this->
setObjType
(
$row
->obj_type);
125
$this->
setParentId
(
$row
->parent_id);
126
$this->
setParentType
(
$row
->parent_type);
127
$this->
setCatalog
(
ilUtil::stripSlashes
(
$row
->catalog));
128
$this->
setEntry
(
ilUtil::stripSlashes
(
$row
->entry));
129
}
130
}
131
return
true
;
132
}
133
134
/*
135
* XML Export of all meta data
136
* @param object (xml writer) see class.ilMD2XML.php
137
*
138
*/
139
public
function
toXML
(&$writer)
140
{
141
$writer->xmlElement(
'Identifier'
, array(
'Catalog'
=> $this->
getCatalog
(),
142
'Entry'
=> $this->
getEntry
()));
143
}
144
145
146
// STATIC
147
public
function
_getIds
($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
148
{
149
global
$ilDB
;
150
151
$query
=
"SELECT meta_identifier_id FROM il_meta_identifier "
.
152
"WHERE rbac_id = "
. $ilDB->quote($a_rbac_id) .
" "
.
153
"AND obj_id = "
. $ilDB->quote($a_obj_id) .
" "
.
154
"AND parent_id = "
. $ilDB->quote($a_parent_id) .
" "
.
155
"AND parent_type = "
. $ilDB->quote($a_parent_type);
156
157
158
$res
= $ilDB->query(
$query
);
159
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
160
$ids[] =
$row
->meta_identifier_id;
161
}
162
return
$ids ? $ids : array();
163
}
164
}
ilMDIdentifier\__getFields
__getFields()
Definition:
class.ilMDIdentifier.php:101
ilMDIdentifier\save
save()
Definition:
class.ilMDIdentifier.php:54
ilMDBase\setObjType
setObjType($a_type)
Definition:
class.ilMDBase.php:109
ilMDIdentifier\_getIds
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMDIdentifier.php:147
ilMDIdentifier\getEntry
getEntry()
Definition:
class.ilMDIdentifier.php:48
ilMDIdentifier\toXML
toXML(&$writer)
Definition:
class.ilMDIdentifier.php:139
ilDBConstants\AUTOQUERY_INSERT
const AUTOQUERY_INSERT
Definition:
class.ilDBConstants.php:57
ilMDIdentifier
Definition:
class.ilMDIdentifier.php:32
ilMDIdentifier\setCatalog
setCatalog($a_catalog)
Definition:
class.ilMDIdentifier.php:36
ilMDBase\getRBACId
getRBACId()
Definition:
class.ilMDBase.php:97
ilMDBase\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMDBase.php:117
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMDIdentifier\update
update()
Definition:
class.ilMDIdentifier.php:68
ilMDBase\setObjId
setObjId($a_id)
Definition:
class.ilMDBase.php:101
ilMDIdentifier\read
read()
Definition:
class.ilMDIdentifier.php:112
ilMDBase\setRBACId
setRBACId($a_id)
Definition:
class.ilMDBase.php:93
$query
$query
Definition:
proxy_ylocal.php:13
ilUtil\stripSlashes
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Definition:
class.ilUtil.php:2406
ilMDBase\setParentId
setParentId($a_id)
Definition:
class.ilMDBase.php:137
$row
$row
Definition:
migrateto20.php:360
ilMDBase\getMetaId
getMetaId()
Definition:
class.ilMDBase.php:125
ilMDBase\getParentType
getParentType()
Definition:
class.ilMDBase.php:133
ilMDBase\getObjId
getObjId()
Definition:
class.ilMDBase.php:105
ilUtil\prepareDBString
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
Definition:
class.ilUtil.php:2871
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDBase\setParentType
setParentType($a_parent_type)
Definition:
class.ilMDBase.php:129
ilMDIdentifier\setEntry
setEntry($a_entry)
Definition:
class.ilMDIdentifier.php:44
php
ilMDBase\getObjType
getObjType()
Definition:
class.ilMDBase.php:113
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilMDBase
Definition:
class.ilMDBase.php:32
ilMDIdentifier\getCatalog
getCatalog()
Definition:
class.ilMDIdentifier.php:40
ilDBConstants\AUTOQUERY_UPDATE
const AUTOQUERY_UPDATE
Definition:
class.ilDBConstants.php:58
ilMDBase\getParentId
getParentId()
Definition:
class.ilMDBase.php:141
Services
Migration
DBUpdate_426
classes
class.ilMDIdentifier.php
Generated on Thu Jan 16 2025 19:02:26 for ILIAS by
1.8.13 (using
Doxyfile
)