TYPO3 CMS
TYPO3_6-2
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
$
(
_
a
c
d
e
f
h
i
l
o
p
r
s
t
u
x
+
Functions
_
a
c
d
e
f
i
l
o
p
r
s
u
x
+
Variables
$
(
_
a
d
e
h
i
p
r
s
t
Examples
▼
TYPO3 CMS
TYPO3 CMS
Test List
Todo List
Deprecated List
►
Namespace Members
►
Classes
▼
Files
►
File List
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
rsfilter.inc.php
Go to the documentation of this file.
1
<?php
15
/*
16
Filter all fields and all rows in a recordset and returns the
17
processed recordset. We scroll to the beginning of the new recordset
18
after processing.
19
20
We pass a recordset and function name to RSFilter($rs,'rowfunc');
21
and the function will be called multiple times, once
22
for each row in the recordset. The function will be passed
23
an array containing one row repeatedly.
24
25
Example:
26
27
// ucwords() every element in the recordset
28
function do_ucwords(&$arr,$rs)
29
{
30
foreach($arr as $k => $v) {
31
$arr[$k] = ucwords($v);
32
}
33
}
34
$rs = RSFilter($rs,'do_ucwords');
35
*/
36
function
RSFilter
(
$rs
,$fn)
37
{
38
if
(
$rs
->databaseType !=
'array'
) {
39
if
(!
$rs
->connection)
return
false
;
40
41
$rs
=
$rs
->connection->_rs2rs(
$rs
);
42
}
43
$rows =
$rs
->RecordCount();
44
for
($i=0; $i < $rows; $i++) {
45
if
(is_array ($fn)) {
46
$obj = $fn[0];
47
$method = $fn[1];
48
$obj->$method (
$rs
->_array[$i],
$rs
);
49
}
else
{
50
$fn(
$rs
->_array[$i],
$rs
);
51
}
52
53
}
54
if
(!
$rs
->EOF) {
55
$rs
->_currentRow = 0;
56
$rs
->fields =
$rs
->_array[0];
57
}
58
59
return
$rs
;
60
}
$rs
if(isset($_REQUEST['nrows'])) else $rs
Definition:
server.php:92
RSFilter
RSFilter($rs, $fn)
Definition:
rsfilter.inc.php:36
typo3
sysext
adodb
adodb
rsfilter.inc.php
Generated on Wed Aug 7 2019 09:52:18 for TYPO3 CMS by
1.8.13