PHP Class PdoDataSet, recess

Example usage: $results = new PdoDataSet(Databases::getDefault()); $results->from('tableName')->equal('someColumn', 'Hi')->limit(10)->offset(50); foreach($results as $result) { // This is when the query is run! print_r($result); }
Author: Kris Jordan ([email protected])
Inheritance: implements Iterator, implements Countable, implements ArrayAccess, implements ISqlSelectOptions, implements ISqlConditions
Afficher le fichier Open project: KrisJordan/recess Class Usage Examples

Méthodes publiques

Свойство Type Description
$rowClass The Class which PDO will fetch rows into.

Protected Properties

Свойство Type Description
$hasResults boolean Whether this instance has fetched results or not.
$index integer Index counter for our location in the result set.
$results Array of results that is filled once a query is realized.
$source PdoDataSource The PdoDataSource which this PdoDataSet is extracted from.
$sqlBuilder SqlBuilder The SqlBuilder instance we use to build up the query string.

Méthodes publiques

Méthode Description
__clone ( )
__construct ( PdoDataSource $source )
assign ( $column, $value ) : PdoDataSet
between ( $column, $lhs, $rhs ) : PdoDataSet
count ( )
current ( )
distinct ( ) : PdoDataSet
equal ( $lhs, $rhs ) : PdoDataSet
exists ( )
first ( ) : object Return the first item in the PdoDataSet or Null if none exist
from ( $table ) : PdoDataSet
greaterThan ( $lhs, $rhs ) : PdoDataSet
greaterThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
groupBy ( $clause ) : PdoDataSet
in ( $lhs, $rhs ) : PdoDataSet
innerJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
isEmpty ( )
isNotNull ( $lhs ) : PdoDataSet
isNull ( $lhs ) : PdoDataSet
key ( )
leftOuterJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
lessThan ( $lhs, $rhs ) : PdoDataSet
lessThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
like ( $lhs, $rhs ) : PdoDataSet
limit ( $size ) : PdoDataSet
next ( )
notEqual ( $lhs, $rhs ) : PdoDataSet
notLike ( $lhs, $rhs ) : PdoDataSet
offset ( $offset ) : PdoDataSet
offsetExists ( $index ) * The following methods are in accordance with the ArrayAccess interface
offsetGet ( $index )
offsetSet ( $index, $value )
offsetUnset ( $index )
orderBy ( $clause ) : PdoDataSet
range ( $start, $finish ) : PdoDataSet
rewind ( ) * The following methods are in accordance with the Iterator interface
selectAs ( $select, $as ) : PdoDataSet
toArray ( ) : array Return the results as an array.
toSql ( ) : string Return the SQL representation of this PdoDataSet
useAssignmentsAsConditions ( $bool ) : PdoDataSet
valid ( )
where ( $lhs, $rhs, $operator ) : PdoDataSet

Méthodes protégées

Méthode Description
realize ( ) Once results are needed this method executes the accumulated query on the data source.
reset ( )

Method Details

__clone() public méthode

public __clone ( )

__construct() public méthode

public __construct ( PdoDataSource $source )
$source PdoDataSource

assign() public méthode

See also: SqlBuilder::assign
public assign ( $column, $value ) : PdoDataSet
Résultat PdoDataSet

between() public méthode

See also: SqlBuilder::between
public between ( $column, $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

count() public méthode

public count ( )

current() public méthode

public current ( )

distinct() public méthode

See also: SqlBuilder::distinct
public distinct ( ) : PdoDataSet
Résultat PdoDataSet

equal() public méthode

See also: SqlBuilder::equal
public equal ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

exists() public méthode

public exists ( )

first() public méthode

Return the first item in the PdoDataSet or Null if none exist
public first ( ) : object
Résultat object or false

from() public méthode

See also: SqlBuilder::from
public from ( $table ) : PdoDataSet
Résultat PdoDataSet

greaterThan() public méthode

See also: SqlBuilder::greaterThan
public greaterThan ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

greaterThanOrEqualTo() public méthode

See also: SqlBuilder::greaterThanOrEqualTo
public greaterThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

groupBy() public méthode

See also: SqlBuilder::groupBy
public groupBy ( $clause ) : PdoDataSet
Résultat PdoDataSet

in() public méthode

See also: SqlBuilder::in
public in ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

innerJoin() public méthode

See also: SqlBuilder::innerJoin
public innerJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
Résultat PdoDataSet

isEmpty() public méthode

public isEmpty ( )

isNotNull() public méthode

See also: SqlBuilder::like
public isNotNull ( $lhs ) : PdoDataSet
Résultat PdoDataSet

isNull() public méthode

See also: SqlBuilder::isNull
public isNull ( $lhs ) : PdoDataSet
Résultat PdoDataSet

key() public méthode

public key ( )

leftOuterJoin() public méthode

See also: SqlBuilder::leftOuterJoin
public leftOuterJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
Résultat PdoDataSet

lessThan() public méthode

See also: SqlBuilder::lessThan
public lessThan ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

lessThanOrEqualTo() public méthode

See also: SqlBuilder::lessThanOrEqualTo
public lessThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

like() public méthode

See also: SqlBuilder::like
public like ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

limit() public méthode

See also: SqlBuilder::limit
public limit ( $size ) : PdoDataSet
Résultat PdoDataSet

next() public méthode

public next ( )

notEqual() public méthode

See also: SqlBuilder::notEqual
public notEqual ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

notLike() public méthode

See also: SqlBuilder::like
public notLike ( $lhs, $rhs ) : PdoDataSet
Résultat PdoDataSet

offset() public méthode

See also: SqlBuilder::offset
public offset ( $offset ) : PdoDataSet
Résultat PdoDataSet

offsetExists() public méthode

* The following methods are in accordance with the ArrayAccess interface
public offsetExists ( $index )

offsetGet() public méthode

public offsetGet ( $index )

offsetSet() public méthode

public offsetSet ( $index, $value )

offsetUnset() public méthode

public offsetUnset ( $index )

orderBy() public méthode

See also: SqlBuilder::orderBy
public orderBy ( $clause ) : PdoDataSet
Résultat PdoDataSet

range() public méthode

See also: SqlBuilder::range
public range ( $start, $finish ) : PdoDataSet
Résultat PdoDataSet

realize() protected méthode

Once results are needed this method executes the accumulated query on the data source.
protected realize ( )

reset() protected méthode

protected reset ( )

rewind() public méthode

* The following methods are in accordance with the Iterator interface
public rewind ( )

selectAs() public méthode

See also: SqlBuilder::selectAs
public selectAs ( $select, $as ) : PdoDataSet
Résultat PdoDataSet

toArray() public méthode

Return the results as an array.
public toArray ( ) : array
Résultat array of type $this->rowClass

toSql() public méthode

Return the SQL representation of this PdoDataSet
public toSql ( ) : string
Résultat string

useAssignmentsAsConditions() public méthode

See also: SqlBuilder::useAssignmentsAsConditions
public useAssignmentsAsConditions ( $bool ) : PdoDataSet
Résultat PdoDataSet

valid() public méthode

public valid ( )

where() public méthode

See also: SqlBuilder::where
public where ( $lhs, $rhs, $operator ) : PdoDataSet
Résultat PdoDataSet

Property Details

$hasResults protected_oe property

Whether this instance has fetched results or not.
protected bool $hasResults
Résultat boolean

$index protected_oe property

Index counter for our location in the result set.
protected int $index
Résultat integer

$results protected_oe property

Array of results that is filled once a query is realized.
protected $results

$rowClass public_oe property

The Class which PDO will fetch rows into.
public $rowClass

$source protected_oe property

The PdoDataSource which this PdoDataSet is extracted from.
protected PdoDataSource $source
Résultat PdoDataSource

$sqlBuilder protected_oe property

The SqlBuilder instance we use to build up the query string.
protected SqlBuilder $sqlBuilder
Résultat SqlBuilder