ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilMDFormat.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
32
include_once
'class.ilMDBase.php'
;
33
34
class
ilMDFormat
extends
ilMDBase
35
{
36
// SET/GET
37
public
function
setFormat
($a_format)
38
{
39
$this->
format
= $a_format;
40
}
41
public
function
getFormat
()
42
{
43
return
$this->format
;
44
}
45
46
public
function
save
()
47
{
48
global
$ilDB
;
49
50
$fields = $this->
__getFields
();
51
$fields[
'meta_format_id'
] =
array
(
'integer'
,$next_id = $ilDB->nextId(
'il_meta_format'
));
52
53
if
($this->db->insert(
'il_meta_format'
, $fields)) {
54
$this->
setMetaId
($next_id);
55
return
$this->
getMetaId
();
56
}
57
return
false
;
58
}
59
60
public
function
update
()
61
{
62
global
$ilDB
;
63
64
if
($this->
getMetaId
()) {
65
if
($this->db->update(
66
'il_meta_format'
,
67
$this->__getFields(),
68
array
(
"meta_format_id"
=>
array
(
'integer'
,$this->
getMetaId
()))
69
)) {
70
return
true
;
71
}
72
}
73
return
false
;
74
}
75
76
public
function
delete
()
77
{
78
global
$ilDB
;
79
80
if
($this->
getMetaId
()) {
81
$query
=
"DELETE FROM il_meta_format "
.
82
"WHERE meta_format_id = "
. $ilDB->quote($this->
getMetaId
(),
'integer'
);
83
$res
= $ilDB->manipulate(
$query
);
84
85
return
true
;
86
}
87
return
false
;
88
}
89
90
91
public
function
__getFields
()
92
{
93
return
array
(
'rbac_id'
=>
array
(
'integer'
,$this->
getRBACId
()),
94
'obj_id'
=>
array
(
'integer'
,$this->
getObjId
()),
95
'obj_type'
=>
array
(
'text'
,$this->
getObjType
()),
96
'format'
=>
array
(
'text'
,$this->
getFormat
()));
97
}
98
99
public
function
read
()
100
{
101
global
$ilDB
;
102
103
include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php'
;
104
105
if
($this->
getMetaId
()) {
106
$query
=
"SELECT * FROM il_meta_format "
.
107
"WHERE meta_format_id = "
. $ilDB->quote($this->
getMetaId
(),
'integer'
);
108
109
$res
= $this->db->query(
$query
);
110
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
111
$this->
setRBACId
(
$row
->rbac_id);
112
$this->
setObjId
(
$row
->obj_id);
113
$this->
setObjType
(
$row
->obj_type);
114
$this->
setFormat
(
$row
->format);
115
}
116
}
117
return
true
;
118
}
119
120
/*
121
* XML Export of all meta data
122
* @param object (xml writer) see class.ilMD2XML.php
123
*
124
*/
125
public
function
toXML
(&$writer)
126
{
127
if
($this->
getFormat
()) {
128
$writer->xmlElement(
'Format'
, null, $this->
getFormat
());
129
}
130
}
131
132
133
// STATIC
134
public
static
function
_getIds
($a_rbac_id, $a_obj_id)
135
{
136
global
$ilDB
;
137
138
$query
=
"SELECT meta_format_id FROM il_meta_format "
.
139
"WHERE rbac_id = "
. $ilDB->quote($a_rbac_id,
'integer'
) .
" "
.
140
"AND obj_id = "
. $ilDB->quote($a_obj_id,
'integer'
);
141
142
$res
= $ilDB->query(
$query
);
143
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
144
$ids[] =
$row
->meta_format_id;
145
}
146
return
$ids ? $ids :
array
();
147
}
148
}
ilMDFormat\save
save()
Definition:
class.ilMDFormat.php:46
ilMDFormat\toXML
toXML(&$writer)
Definition:
class.ilMDFormat.php:125
ilMDBase\setObjType
setObjType($a_type)
Definition:
class.ilMDBase.php:107
$format
$format
Definition:
metadata.php:141
ilMDFormat\_getIds
static _getIds($a_rbac_id, $a_obj_id)
Definition:
class.ilMDFormat.php:134
ilMDFormat\setFormat
setFormat($a_format)
Definition:
class.ilMDFormat.php:37
ilMDFormat
Definition:
class.ilMDFormat.php:34
ilMDFormat\__getFields
__getFields()
Definition:
class.ilMDFormat.php:91
ilMDBase\getRBACId
getRBACId()
Definition:
class.ilMDBase.php:95
ilMDFormat\update
update()
Definition:
class.ilMDFormat.php:60
ilMDBase\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMDBase.php:115
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMDFormat\getFormat
getFormat()
Definition:
class.ilMDFormat.php:41
ilMDBase\setObjId
setObjId($a_id)
Definition:
class.ilMDBase.php:99
ilMDBase\setRBACId
setRBACId($a_id)
Definition:
class.ilMDBase.php:91
$query
$query
Definition:
proxy_ylocal.php:13
ilMDFormat\read
read()
Definition:
class.ilMDFormat.php:99
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilMDBase\getMetaId
getMetaId()
Definition:
class.ilMDBase.php:123
format
Write to Excel2007 format
Definition:
01pharSimple.php:78
ilMDBase\getObjId
getObjId()
Definition:
class.ilMDBase.php:103
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDBase\getObjType
getObjType()
Definition:
class.ilMDBase.php:111
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilMDBase
Definition:
class.ilMDBase.php:32
Services
MetaData
classes
class.ilMDFormat.php
Generated on Tue Jan 28 2025 19:01:37 for ILIAS by
1.8.13 (using
Doxyfile
)