SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
SlaxWeb\DatabasePDO\Result Class Reference
Inheritance diagram for SlaxWeb\DatabasePDO\Result:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\DatabasePDO\Result:
Collaboration graph
[legend]

Public Member Functions

 __construct (array $rawData)
 
 __get (string $name)
 
 next ()
 
 prev ()
 
 row (int $row)
 
 rowCount ()
 
 getResults ()
 
 get ()
 

Protected Attributes

 $_rawData = []
 
 $_rows = 0
 
 $_currRow = -1
 

Constructor & Destructor Documentation

SlaxWeb\DatabasePDO\Result::__construct ( array  $rawData)

Class constructor

Save the raw result data into the protected property '$_rawData'.

Parameters
array$rawDataRaw data array

Member Function Documentation

SlaxWeb\DatabasePDO\Result::__get ( string  $name)

Magic Get Method

Retrieves the result row column value and returns it to the caller. If the internal index is not pointing to a valid row, or the requested column is not part of the result set, an exception is thrown.

Parameters
string$nameName of the column
Returns
mixed

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::get ( )

Get Row

Returns the row object to the caller. If the row does not exists, an exception is thrown.

Returns

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::getResults ( )

Get result set

Returns the raw result set array to the caller.

Returns
array

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::next ( )

Next row

Move the internal pointer to the next row of the result array. If there is no row found under the next index, bool(false) is returned, otherwise bool(true) is returned.

Returns
bool

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::prev ( )

Previous row

Move the internal pointer to the previous row of the result array. If there is no row found under the previous index, bool(false) is returned, otherwise bool(true) is returned.

Returns
bool

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::row ( int  $row)

Jump to row

Move the internal pointer to the passed in row of the result array. If there is no row found under the passed in row, bool(false) is returned, otherwise bool(true) is returned.

Parameters
int$rowRow number
Returns
bool

Implements SlaxWeb\Database\Interfaces\Result.

SlaxWeb\DatabasePDO\Result::rowCount ( )

Get row count

Get the row count of the result set.

Returns
int

Implements SlaxWeb\Database\Interfaces\Result.


The documentation for this class was generated from the following file: