QueryTo
in package
No description yet.
Table of Contents
Methods
- csv() : false|string
- Exports a database query result as a CSV file.
- csvFile() : bool
- Exports a database query result as a CSV file.
- json() : false|string
- Exports a database query result as a JSON file
- xml() : false|string
- Exports a database query result as an XML file.
- xmlFile() : bool
- Exports a database query result as an XML file.
Methods
csv()
Exports a database query result as a CSV file.
public
static csv(PDOStatement|iterable<string|int, mixed> $result[, array<string|int, mixed> $modifiers = [] ][, array<string|int, mixed> $headings = [] ]) : false|string
Parameters
- $result : PDOStatement|iterable<string|int, mixed>
-
Result set. N.B. the cursor on this statement WILL BE CLOSED by this function.
- $modifiers : array<string|int, mixed> = []
-
ColModifier objects to apply result set before exporting their values, as column_name => ColModifier instance
- $headings : array<string|int, mixed> = []
-
Headings to use on the first row of the CSV; as column_name => heading. The column name itself will be used if a specific heading isn't requested.
Tags
Return values
false|string —The CSV file or false on error
csvFile()
Exports a database query result as a CSV file.
public
static csvFile(PDOStatement|iterable<string|int, mixed> $result, resource $stream[, array<string|int, mixed> $modifiers = [] ][, array<string|int, mixed> $headings = [] ]) : bool
Parameters
- $result : PDOStatement|iterable<string|int, mixed>
-
Result set. N.B. the cursor on this statement WILL BE CLOSED by this function.
- $stream : resource
-
file handle
- $modifiers : array<string|int, mixed> = []
-
ColModifier objects to apply result set before exporting their values, as column_name => ColModifier instance
- $headings : array<string|int, mixed> = []
-
Headings to use on the first row of the CSV; as column_name => heading. The column name itself will be used if a specific heading isn't requested.
Tags
Return values
bool —Success flag
json()
Exports a database query result as a JSON file
public
static json(PDOStatement|iterable<string|int, mixed> $results[, array<string|int, mixed> $modifiers = [] ]) : false|string
Parameters
- $results : PDOStatement|iterable<string|int, mixed>
- $modifiers : array<string|int, mixed> = []
Tags
Return values
false|stringxml()
Exports a database query result as an XML file.
public
static xml(PDOStatement|iterable<string|int, mixed> $result[, array<string|int, mixed> $modifiers = [] ]) : false|string
Parameters
- $result : PDOStatement|iterable<string|int, mixed>
-
Result set. N.B. the cursor on this statement WILL BE CLOSED by this function.
- $modifiers : array<string|int, mixed> = []
-
ColModifier objects to apply result set before exporting their values, as column_name => ColModifier instance
Tags
Return values
false|string —The XML file or false on error
xmlFile()
Exports a database query result as an XML file.
public
static xmlFile(PDOStatement|iterable<string|int, mixed> $result, resource $stream[, array<string|int, mixed> $modifiers = [] ]) : bool
Parameters
- $result : PDOStatement|iterable<string|int, mixed>
-
Result set. N.B. the cursor on this statement WILL BE CLOSED by this function.
- $stream : resource
-
a file handle
- $modifiers : array<string|int, mixed> = []
-
ColModifier objects to apply result set before exporting their values, as column_name => ColModifier instance
Tags
Return values
bool —false on error