ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 */
39 public $rbac_id;
40
41 /*
42 * obj_id (e.g for structure objects the obj_id of the structure object)
43 */
44 public $obj_id;
45
46 /*
47 * type of the object (e.g st,pg,crs ...)
48 */
49 public $obj_type;
50
51 /*
52 * export mode, if true, first Identifier will be
53 * set to ILIAS/il_<INSTALL_ID>_<TYPE>_<ID>
54 */
55 public $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 public function __construct(
72 $a_rbac_id = 0,
73 $a_obj_id = 0,
74 $a_type = 0
75 ) {
76 global $ilDB;
77
78 if ($a_obj_id == 0) {
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 public function setRBACId($a_id)
92 {
93 $this->rbac_id = $a_id;
94 }
95 public function getRBACId()
96 {
97 return $this->rbac_id;
98 }
99 public function setObjId($a_id)
100 {
101 $this->obj_id = $a_id;
102 }
103 public function getObjId()
104 {
105 return $this->obj_id;
106 }
107 public function setObjType($a_type)
108 {
109 $this->obj_type = $a_type;
110 }
111 public function getObjType()
112 {
113 return $this->obj_type;
114 }
115 public function setMetaId($a_meta_id, $a_read_data = true)
116 {
117 $this->meta_id = $a_meta_id;
118
119 if ($a_read_data) {
120 $this->read();
121 }
122 }
123 public function getMetaId()
124 {
125 return $this->meta_id;
126 }
127 public function setParentType($a_parent_type)
128 {
129 $this->parent_type = $a_parent_type;
130 }
131 public function getParentType()
132 {
133 return $this->parent_type;
134 }
135 public function setParentId($a_id)
136 {
137 $this->parent_id = $a_id;
138 }
139 public function getParentId()
140 {
141 return $this->parent_id;
142 }
143
144 public function setExportMode($a_export_mode = true)
145 {
146 $this->export_mode = $a_export_mode;
147 }
148
149 public function getExportMode()
150 {
151 return $this->export_mode;
152 }
153
154
155 /*
156 * Should be overwritten in all inherited classes
157 *
158 * @access public
159 * @return bool
160 */
161 public function validate()
162 {
163 return false;
164 }
165
166 /*
167 * Should be overwritten in all inherited classes
168 *
169 * @access public
170 * @return bool
171 */
172 public function update()
173 {
174 return false;
175 }
176
177 /*
178 * Should be overwritten in all inherited classes
179 *
180 * @access public
181 * @return bool
182 */
183 public function save()
184 {
185 return false;
186 }
187 /*
188 * Should be overwritten in all inherited classes
189 *
190 * @access public
191 * @return bool
192 */
193 public function delete()
194 {
195 }
196
197 /*
198 * Should be overwritten in all inherited classes
199 * XML Export of all meta data
200 * @param object (xml writer) see class.ilMD2XML.php
201 *
202 */
203 public function toXML(&$writer)
204 {
205 }
206}
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
setObjId($a_id)
setParentId($a_id)
setMetaId($a_meta_id, $a_read_data=true)
__construct( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
toXML(&$writer)
setObjType($a_type)
setRBACId($a_id)
setExportMode($a_export_mode=true)
setParentType($a_parent_type)
global $ilDB
$a_type
Definition: workflow.php:92