ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
60 protected $log;
61
62 /*
63 * constructor
64 *
65 * @param $a_rbac_id int object id (NOT ref_id!) of rbac object (e.g for page objects
66 * the obj_id of the content object; for media objects this
67 * is set to 0, because their object id are not assigned to ref ids)
68 * @param $a_obj_id int object id (e.g for structure objects the obj_id of the structure object)
69 * @param $a_type string type of the object (e.g st,pg,crs ...)
70 */
71 function __construct($a_rbac_id = 0,
72 $a_obj_id = 0,
73 $a_type = 0)
74 {
75 global $ilDB;
76
77 if ($a_obj_id == 0)
78 {
79 $a_obj_id = $a_rbac_id;
80 }
81
82 $this->db = $ilDB;
83 $this->log = ilLoggerFactory::getLogger("meta");
84
85 $this->rbac_id = $a_rbac_id;
86 $this->obj_id = $a_obj_id;
87 $this->obj_type = $a_type;
88 }
89
90 // SET/GET
91 function setRBACId($a_id)
92 {
93 $this->rbac_id = $a_id;
94 }
95 function getRBACId()
96 {
97 return $this->rbac_id;
98 }
99 function setObjId($a_id)
100 {
101 $this->obj_id = $a_id;
102 }
103 function getObjId()
104 {
105 return $this->obj_id;
106 }
108 {
109 $this->obj_type = $a_type;
110 }
111 function getObjType()
112 {
113 return $this->obj_type;
114 }
115 function setMetaId($a_meta_id,$a_read_data = true)
116 {
117 $this->meta_id = $a_meta_id;
118
119 if($a_read_data)
120 {
121 $this->read();
122 }
123 }
124 function getMetaId()
125 {
126 return $this->meta_id;
127 }
128 function setParentType($a_parent_type)
129 {
130 $this->parent_type = $a_parent_type;
131 }
132 function getParentType()
133 {
134 return $this->parent_type;
135 }
136 function setParentId($a_id)
137 {
138 $this->parent_id = $a_id;
139 }
140 function getParentId()
141 {
142 return $this->parent_id;
143 }
144
145 function setExportMode($a_export_mode = true)
146 {
147 $this->export_mode = $a_export_mode;
148 }
149
150 function getExportMode()
151 {
152 return $this->export_mode;
153 }
154
155
156 /*
157 * Should be overwritten in all inherited classes
158 *
159 * @access public
160 * @return bool
161 */
162 function validate()
163 {
164 return false;
165 }
166
167 /*
168 * Should be overwritten in all inherited classes
169 *
170 * @access public
171 * @return bool
172 */
173 function update()
174 {
175 return false;
176 }
177
178 /*
179 * Should be overwritten in all inherited classes
180 *
181 * @access public
182 * @return bool
183 */
184 function save()
185 {
186 return false;
187 }
188 /*
189 * Should be overwritten in all inherited classes
190 *
191 * @access public
192 * @return bool
193 */
194 function delete()
195 {
196 }
197
198 /*
199 * Should be overwritten in all inherited classes
200 * XML Export of all meta data
201 * @param object (xml writer) see class.ilMD2XML.php
202 *
203 */
204 function toXML(&$writer)
205 {
206 }
207
208}
209?>
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
__construct($a_rbac_id=0, $a_obj_id=0, $a_type=0)
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)
global $ilDB
$a_type
Definition: workflow.php:93