ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMDBase.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
33{
34 /*
35 * object id (NOT ref_id!) of rbac object (e.g for page objects the obj_id
36 * of the content object; for media objects this is set to 0, because their
37 * object id are not assigned to ref ids)
38 */
40
41 /*
42 * obj_id (e.g for structure objects the obj_id of the structure object)
43 */
45
46 /*
47 * type of the object (e.g st,pg,crs ...)
48 */
50
51 /*
52 * export mode, if true, first Identifier will be
53 * set to ILIAS/il_<INSTALL_ID>_<TYPE>_<ID>
54 */
55 var $export_mode = false;
56
57
58 function ilMDBase($a_rbac_id = 0,
59 $a_obj_id = 0,
60 $a_type = 0)
61 {
62 global $ilDB,$ilLog;
63
64 if ($a_obj_id == 0)
65 {
66 $a_obj_id = $a_rbac_id;
67 }
68
69 $this->db =& $ilDB;
70 $this->log =& $ilLog;
71
72 $this->rbac_id = $a_rbac_id;
73 $this->obj_id = $a_obj_id;
74 $this->obj_type = $a_type;
75 }
76
77 // SET/GET
78 function setRBACId($a_id)
79 {
80 $this->rbac_id = $a_id;
81 }
82 function getRBACId()
83 {
84 return $this->rbac_id;
85 }
86 function setObjId($a_id)
87 {
88 $this->obj_id = $a_id;
89 }
90 function getObjId()
91 {
92 return $this->obj_id;
93 }
94 function setObjType($a_type)
95 {
96 $this->obj_type = $a_type;
97 }
98 function getObjType()
99 {
100 return $this->obj_type;
101 }
102 function setMetaId($a_meta_id,$a_read_data = true)
103 {
104 $this->meta_id = $a_meta_id;
105
106 if($a_read_data)
107 {
108 $this->read();
109 }
110 }
111 function getMetaId()
112 {
113 return $this->meta_id;
114 }
115 function setParentType($a_parent_type)
116 {
117 $this->parent_type = $a_parent_type;
118 }
119 function getParentType()
120 {
121 return $this->parent_type;
122 }
123 function setParentId($a_id)
124 {
125 $this->parent_id = $a_id;
126 }
127 function getParentId()
128 {
129 return $this->parent_id;
130 }
131
132 function setExportMode($a_export_mode = true)
133 {
134 $this->export_mode = $a_export_mode;
135 }
136
137 function getExportMode()
138 {
139 return $this->export_mode;
140 }
141
142
143 /*
144 * Should be overwritten in all inherited classes
145 *
146 * @access public
147 * @return bool
148 */
149 function validate()
150 {
151 return false;
152 }
153
154 /*
155 * Should be overwritten in all inherited classes
156 *
157 * @access public
158 * @return bool
159 */
160 function update()
161 {
162 return false;
163 }
164
165 /*
166 * Should be overwritten in all inherited classes
167 *
168 * @access public
169 * @return bool
170 */
171 function save()
172 {
173 return false;
174 }
175 /*
176 * Should be overwritten in all inherited classes
177 *
178 * @access public
179 * @return bool
180 */
181 function delete()
182 {
183 }
184
185 /*
186 * Should be overwritten in all inherited classes
187 * XML Export of all meta data
188 * @param object (xml writer) see class.ilMD2XML.php
189 *
190 */
191 function toXML(&$writer)
192 {
193 }
194
195}
196?>
setObjId($a_id)
setParentId($a_id)
setMetaId($a_meta_id, $a_read_data=true)
toXML(&$writer)
setObjType($a_type)
setRBACId($a_id)
setExportMode($a_export_mode=true)
setParentType($a_parent_type)
ilMDBase($a_rbac_id=0, $a_obj_id=0, $a_type=0)
global $ilDB