ILIAS
Release_5_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilADTDBBridge.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
abstract
class
ilADTDBBridge
12
{
13
protected
$adt
;
// [ilADT]
14
protected
$table
;
// [string]
15
protected
$id
;
// [string]
16
protected
$primary
;
// [array]
17
24
public
function
__construct
(
ilADT
$a_adt)
25
{
26
$this->
setADT
($a_adt);
27
}
28
29
//
30
// properties
31
//
32
41
abstract
protected
function
isValidADT
(
ilADT
$a_adt);
42
49
protected
function
setADT
(
ilADT
$a_adt)
50
{
51
if
(!$this->
isValidADT
($a_adt))
52
{
53
throw
new
Exception
(
'ADTDBBridge Type mismatch.'
);
54
}
55
56
$this->adt = $a_adt;
57
}
58
64
public
function
getADT
()
65
{
66
return
$this->adt
;
67
}
68
74
public
function
setTable
($a_table)
75
{
76
$this->table = (string)$a_table;
77
}
78
84
public
function
getTable
()
85
{
86
return
$this->table
;
87
}
88
94
public
function
setElementId
($a_value)
95
{
96
$this->
id
= (string)$a_value;
97
}
98
104
public
function
getElementId
()
105
{
106
return
$this->id
;
107
}
108
114
public
function
setPrimary
(array $a_value)
115
{
116
$this->primary = $a_value;
117
}
118
124
public
function
getPrimary
()
125
{
126
return
$this->primary
;
127
}
128
135
public
function
buildPrimaryWhere
()
136
{
137
global
$ilDB
;
138
139
$sql = array();
140
141
foreach
($this->primary as $field => $def)
142
{
143
$sql[] = $field.
"="
.$ilDB->quote($def[1], $def[0]);
144
}
145
146
return
implode(
" AND "
, $sql);
147
}
148
149
150
//
151
// CRUD
152
//
153
159
abstract
public
function
readRecord
(array $a_row);
160
166
abstract
public
function
prepareInsert
(array &$a_fields);
167
171
public
function
afterInsert
()
172
{
173
174
}
175
182
public
function
prepareUpdate
(array &$a_fields)
183
{
184
$this->
prepareInsert
($a_fields);
185
}
186
190
public
function
afterUpdate
()
191
{
192
193
}
194
198
public
function
afterDelete
()
199
{
200
201
}
202
}
203
204
?>
Services
ADT
classes
Bridges
class.ilADTDBBridge.php
Generated on Wed Apr 27 2016 21:01:27 for ILIAS by
1.8.1.2 (using
Doxyfile
)