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