Propel 2 API
Class

Propel\Runtime\DataFetcher\PDODataFetcher

class PDODataFetcher extends AbstractDataFetcher

Class PDODataFetcher

The PDO dataFetcher for PDOStatement.

Methods

__construct(mixed $dataObject)

from AbstractDataFetcher
setDataObject(mixed $dataObject)

Sets the dataObject.

from AbstractDataFetcher
mixed getDataObject()

Returns the current data object that holds or references to actual data.

from AbstractDataFetcher
mixed|null fetchColumn(int $index = null)

Returns the data of the first column of the next row, based on this->fetch();

from AbstractDataFetcher
array|null fetch($style = \PDO::FETCH_NUM)

Returns the data of the next row, based on this->next() && this->current();

void next()

Move forward to next element

mixed current()

Return the current element

mixed key()

Return the key of the current element

boolean valid()

Checks if current position is valid

void rewind()

Not supported in PDODataFetcher.

close()

Frees the resultSet.

int count()

Returns the count of items in the resultSet.

string getIndexType()

Returns the TableMap::TYPE_* depends on your resultSet.

bindColumn(mixed $column, mixed $param, int $type = null, int $maxlen = null, mixed $driverdata = null)

Bind a column to a PHP variable.

Details

in AbstractDataFetcher at line 18
public __construct(mixed $dataObject)

Parameters

mixed $dataObject

in AbstractDataFetcher at line 26
public setDataObject(mixed $dataObject)

Sets the dataObject.

Parameters

mixed $dataObject

in AbstractDataFetcher at line 34
public mixed getDataObject()

Returns the current data object that holds or references to actual data.

Return Value

mixed

in AbstractDataFetcher at line 42
public mixed|null fetchColumn(int $index = null)

Returns the data of the first column of the next row, based on this->fetch();

Parameters

int $index

Return Value

mixed|null

at line 29
public array|null fetch($style = \PDO::FETCH_NUM)

Returns the data of the next row, based on this->next() && this->current();

Parameters

$style

Return Value

array|null

at line 37
public void next()

Move forward to next element

Return Value

void Any returned value is ignored.

at line 50
public mixed current()

Return the current element

Return Value

mixed Can return any type.

at line 58
public mixed key()

Return the key of the current element

Return Value

mixed scalar on success, or null on failure.

at line 66
public boolean valid()

Checks if current position is valid

Return Value

boolean The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

at line 76
public void rewind()

Not supported in PDODataFetcher.

It actually fetches the first row, since a foreach in php triggers that
function as init.

Return Value

void Any returned value is ignored.

at line 84
public close()

Frees the resultSet.

at line 94
public int count()

Returns the count of items in the resultSet.

Return Value

int

at line 102
public string getIndexType()

Returns the TableMap::TYPE_* depends on your resultSet.

We need this information
to be able to populate objects based on your array of fetch().

Return Value

string one of TableMap::TYPE_*

at line 118
public bindColumn(mixed $column, mixed $param, int $type = null, int $maxlen = null, mixed $driverdata = null)

Bind a column to a PHP variable.

Parameters

mixed $column
mixed $param
int $type
int $maxlen
mixed $driverdata

See also

http://www.php.net/manual/en/pdostatement.bindcolumn.php