GraphDatabaseTiein: ezcGraphDatabaseDataSet
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphDatabaseDataSet
|
Class to transform PDO results into ezcGraphDataSets [
source]
Parents
ezcGraphDataSet
|
--ezcGraphDatabaseDataSet
Method Summary
|
public ezcGraphDatabase |
__construct(
$statement, [$definition = null] )
Constructor |
|
public int |
count(
)
Returns the number of elements in this dataset |
|
protected void |
createFromPdo(
$statement, [$definition = null] )
Create dataset from PDO statement |
Methods
__construct
ezcGraphDatabase __construct(
$statement, [
$definition = null] )
Constructor
Creates a ezcGraphDatabase from a PDOStatement and uses the columns defined in the definition array as keys and values for the data set.
If the definition array is empty a single column will be used as values, with two columns the first column will be used for the keys and the second for the data set values.
You may define the name of the rows used for keys and values by using an array like: array ( ezcGraph::KEY => 'row name', ezcGraph::VALUE => 'row name', );
Parameters
| Name |
Type |
Description |
$statement |
PDOStatement |
|
$definition |
array |
|
count
int count(
)
Returns the number of elements in this dataset
createFromPdo
void createFromPdo(
$statement, [
$definition = null] )
Create dataset from PDO statement
This methods uses the values from a PDOStatement to fill up the data sets data.
If the definition array is empty a single column will be used as values, with two columns the first column will be used for the keys and the second for the data set values.
You may define the name of the rows used for keys and values by using an array like: array ( ezcGraph::KEY => 'row name', ezcGraph::VALUE => 'row name', );
Parameters
| Name |
Type |
Description |
$statement |
PDOStatement |
|
$definition |
array |
|
Last updated: Mon, 17 Dec 2007