PHP 클래스 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); }
저자: Kris Jordan ([email protected])
상속: implements Iterator, implements Countable, implements ArrayAccess, implements ISqlSelectOptions, implements ISqlConditions
파일 보기 프로젝트 열기: KrisJordan/recess 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$rowClass The Class which PDO will fetch rows into.

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
realize ( ) Once results are needed this method executes the accumulated query on the data source.
reset ( )

메소드 상세

__clone() 공개 메소드

public __clone ( )

__construct() 공개 메소드

public __construct ( PdoDataSource $source )
$source PdoDataSource

assign() 공개 메소드

또한 보기: SqlBuilder::assign
public assign ( $column, $value ) : PdoDataSet
리턴 PdoDataSet

between() 공개 메소드

또한 보기: SqlBuilder::between
public between ( $column, $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

count() 공개 메소드

public count ( )

current() 공개 메소드

public current ( )

distinct() 공개 메소드

또한 보기: SqlBuilder::distinct
public distinct ( ) : PdoDataSet
리턴 PdoDataSet

equal() 공개 메소드

또한 보기: SqlBuilder::equal
public equal ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

exists() 공개 메소드

public exists ( )

first() 공개 메소드

Return the first item in the PdoDataSet or Null if none exist
public first ( ) : object
리턴 object or false

from() 공개 메소드

또한 보기: SqlBuilder::from
public from ( $table ) : PdoDataSet
리턴 PdoDataSet

greaterThan() 공개 메소드

또한 보기: SqlBuilder::greaterThan
public greaterThan ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

greaterThanOrEqualTo() 공개 메소드

또한 보기: SqlBuilder::greaterThanOrEqualTo
public greaterThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

groupBy() 공개 메소드

또한 보기: SqlBuilder::groupBy
public groupBy ( $clause ) : PdoDataSet
리턴 PdoDataSet

in() 공개 메소드

또한 보기: SqlBuilder::in
public in ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

innerJoin() 공개 메소드

또한 보기: SqlBuilder::innerJoin
public innerJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
리턴 PdoDataSet

isEmpty() 공개 메소드

public isEmpty ( )

isNotNull() 공개 메소드

또한 보기: SqlBuilder::like
public isNotNull ( $lhs ) : PdoDataSet
리턴 PdoDataSet

isNull() 공개 메소드

또한 보기: SqlBuilder::isNull
public isNull ( $lhs ) : PdoDataSet
리턴 PdoDataSet

key() 공개 메소드

public key ( )

leftOuterJoin() 공개 메소드

또한 보기: SqlBuilder::leftOuterJoin
public leftOuterJoin ( $table, $tablePrimaryKey, $fromTableForeignKey ) : PdoDataSet
리턴 PdoDataSet

lessThan() 공개 메소드

또한 보기: SqlBuilder::lessThan
public lessThan ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

lessThanOrEqualTo() 공개 메소드

또한 보기: SqlBuilder::lessThanOrEqualTo
public lessThanOrEqualTo ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

like() 공개 메소드

또한 보기: SqlBuilder::like
public like ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

limit() 공개 메소드

또한 보기: SqlBuilder::limit
public limit ( $size ) : PdoDataSet
리턴 PdoDataSet

next() 공개 메소드

public next ( )

notEqual() 공개 메소드

또한 보기: SqlBuilder::notEqual
public notEqual ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

notLike() 공개 메소드

또한 보기: SqlBuilder::like
public notLike ( $lhs, $rhs ) : PdoDataSet
리턴 PdoDataSet

offset() 공개 메소드

또한 보기: SqlBuilder::offset
public offset ( $offset ) : PdoDataSet
리턴 PdoDataSet

offsetExists() 공개 메소드

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

offsetGet() 공개 메소드

public offsetGet ( $index )

offsetSet() 공개 메소드

public offsetSet ( $index, $value )

offsetUnset() 공개 메소드

public offsetUnset ( $index )

orderBy() 공개 메소드

또한 보기: SqlBuilder::orderBy
public orderBy ( $clause ) : PdoDataSet
리턴 PdoDataSet

range() 공개 메소드

또한 보기: SqlBuilder::range
public range ( $start, $finish ) : PdoDataSet
리턴 PdoDataSet

realize() 보호된 메소드

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

reset() 보호된 메소드

protected reset ( )

rewind() 공개 메소드

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

selectAs() 공개 메소드

또한 보기: SqlBuilder::selectAs
public selectAs ( $select, $as ) : PdoDataSet
리턴 PdoDataSet

toArray() 공개 메소드

Return the results as an array.
public toArray ( ) : array
리턴 array of type $this->rowClass

toSql() 공개 메소드

Return the SQL representation of this PdoDataSet
public toSql ( ) : string
리턴 string

useAssignmentsAsConditions() 공개 메소드

또한 보기: SqlBuilder::useAssignmentsAsConditions
public useAssignmentsAsConditions ( $bool ) : PdoDataSet
리턴 PdoDataSet

valid() 공개 메소드

public valid ( )

where() 공개 메소드

또한 보기: SqlBuilder::where
public where ( $lhs, $rhs, $operator ) : PdoDataSet
리턴 PdoDataSet

프로퍼티 상세

$hasResults 보호되어 있는 프로퍼티

Whether this instance has fetched results or not.
protected bool $hasResults
리턴 boolean

$index 보호되어 있는 프로퍼티

Index counter for our location in the result set.
protected int $index
리턴 integer

$results 보호되어 있는 프로퍼티

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

$rowClass 공개적으로 프로퍼티

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

$source 보호되어 있는 프로퍼티

The PdoDataSource which this PdoDataSet is extracted from.
protected PdoDataSource $source
리턴 PdoDataSource

$sqlBuilder 보호되어 있는 프로퍼티

The SqlBuilder instance we use to build up the query string.
protected SqlBuilder $sqlBuilder
리턴 SqlBuilder