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
24
33class ilMDBase
34{
35 /*
36 * rbac_id ref_id of rbac object (e.g for page objects the obj_id of the content object)
37 */
38 var $rbac_id;
39
40 /*
41 * obj_id (e.g for structure objects the obj_id of the structure object)
42 */
43 var $obj_id;
44
45 /*
46 * type of the object (e.g st,pg,crs ...)
47 */
48 var $obj_type;
49
50
51 function ilMDBase($a_rbac_id = 0,
52 $a_obj_id = 0,
53 $a_type = 0)
54 {
55 global $ilDB,$ilLog;
56
57 $this->db =& $ilDB;
58 $this->log =& $ilLog;
59
60 $this->rbac_id = $a_rbac_id;
61 $this->obj_id = $a_obj_id;
62 $this->obj_type = $a_type;
63 }
64
65 // SET/GET
66 function setRBACId($a_id)
67 {
68 $this->rbac_id = $a_id;
69 }
70 function getRBACId()
71 {
72 return $this->rbac_id;
73 }
74 function setObjId($a_id)
75 {
76 $this->obj_id = $a_id;
77 }
78 function getObjId()
79 {
80 return $this->obj_id;
81 }
82 function setObjType($a_type)
83 {
84 $this->obj_type = $a_type;
85 }
86 function getObjType()
87 {
88 return $this->obj_type;
89 }
90 function setMetaId($a_meta_id,$a_read_data = true)
91 {
92 $this->meta_id = $a_meta_id;
93
94 if($a_read_data)
95 {
96 $this->read();
97 }
98 }
99 function getMetaId()
100 {
101 return $this->meta_id;
102 }
103 function setParentType($a_parent_type)
104 {
105 $this->parent_type = $a_parent_type;
106 }
107 function getParentType()
108 {
109 return $this->parent_type;
110 }
111 function setParentId($a_id)
112 {
113 $this->parent_id = $a_id;
114 }
115 function getParentId()
116 {
117 return $this->parent_id;
118 }
119
120 /*
121 * Should be overwritten in all inherited classes
122 *
123 * @access public
124 * @return bool
125 */
126 function validate()
127 {
128 return false;
129 }
130
131 /*
132 * Should be overwritten in all inherited classes
133 *
134 * @access public
135 * @return bool
136 */
137 function update()
138 {
139 return false;
140 }
141
142 /*
143 * Should be overwritten in all inherited classes
144 *
145 * @access public
146 * @return bool
147 */
148 function save()
149 {
150 return false;
151 }
152 /*
153 * Should be overwritten in all inherited classes
154 *
155 * @access public
156 * @return bool
157 */
158 function delete()
159 {
160 }
161
162 /*
163 * Should be overwritten in all inherited classes
164 * XML Export of all meta data
165 * @param object (xml writer) see class.ilMD2XML.php
166 *
167 */
168 function toXML(&$writer)
169 {
170 }
171
172}
173?>
setObjId($a_id)
setParentId($a_id)
setMetaId($a_meta_id, $a_read_data=true)
toXML(&$writer)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)
ilMDBase($a_rbac_id=0, $a_obj_id=0, $a_type=0)
global $ilDB