ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 public $rbac_id;
39
40 /*
41 * obj_id (e.g for structure objects the obj_id of the structure object)
42 */
43 public $obj_id;
44
45 /*
46 * type of the object (e.g st,pg,crs ...)
47 */
48 public $obj_type;
49
50
51 public function __construct(
52 $a_rbac_id = 0,
53 $a_obj_id = 0,
54 $a_type = 0
55 ) {
56 global $ilDB,$ilLog;
57
58 $this->db = $ilDB;
59 $this->log = $ilLog;
60
61 $this->rbac_id = $a_rbac_id;
62 $this->obj_id = $a_obj_id;
63 $this->obj_type = $a_type;
64 }
65
66 // SET/GET
67 public function setRBACId($a_id)
68 {
69 $this->rbac_id = $a_id;
70 }
71 public function getRBACId()
72 {
73 return $this->rbac_id;
74 }
75 public function setObjId($a_id)
76 {
77 $this->obj_id = $a_id;
78 }
79 public function getObjId()
80 {
81 return $this->obj_id;
82 }
83 public function setObjType($a_type)
84 {
85 $this->obj_type = $a_type;
86 }
87 public function getObjType()
88 {
89 return $this->obj_type;
90 }
91 public function setMetaId($a_meta_id, $a_read_data = true)
92 {
93 $this->meta_id = $a_meta_id;
94
95 if ($a_read_data) {
96 $this->read();
97 }
98 }
99 public function getMetaId()
100 {
101 return $this->meta_id;
102 }
103 public function setParentType($a_parent_type)
104 {
105 $this->parent_type = $a_parent_type;
106 }
107 public function getParentType()
108 {
109 return $this->parent_type;
110 }
111 public function setParentId($a_id)
112 {
113 $this->parent_id = $a_id;
114 }
115 public 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 public 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 public 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 public 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 public 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 public function toXML(&$writer)
169 {
170 }
171}
An exception for terminatinating execution or to throw for unit testing.
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)
setParentType($a_parent_type)
global $ilDB
$a_type
Definition: workflow.php:92