PHP Class SelectQuery, fluentpdo

Inheritance: extends QuerySkeleton, implements Named, implements JoinCapableQuery, implements Aliased
显示文件 Open project: fpdo/fluentpdo Class Usage Examples

Public Methods

Method Description
__construct ( FluentPDO $fpdo, $from ) SelectQuery constructor.
count ( ) : integer Countable interface doesn't break current \FluentPDO select query
fetch ( string $column = '' ) : mixed Fetch first row or column
fetchAll ( string $index = '', string $selectOnly = '' ) : array Fetch all row
fetchColumn ( integer $columnNumber ) : string Returns a single column
fetchPairs ( $key, $value, $object = false ) : array Fetch pairs
getFromAlias ( ) Return table alias from FROM clause
getFromTable ( ) Return table name from FROM clause
getIterator ( )

Method Details

__construct() public method

SelectQuery constructor.
public __construct ( FluentPDO $fpdo, $from )
$fpdo FluentPDO
$from

count() public method

Countable interface doesn't break current \FluentPDO select query
public count ( ) : integer
return integer

fetch() public method

Fetch first row or column
public fetch ( string $column = '' ) : mixed
$column string column name or empty string for the whole row
return mixed string, array or false if there is no row

fetchAll() public method

Fetch all row
public fetchAll ( string $index = '', string $selectOnly = '' ) : array
$index string specify index column
$selectOnly string select columns which could be fetched
return array of fetched rows

fetchColumn() public method

Returns a single column
public fetchColumn ( integer $columnNumber ) : string
$columnNumber integer
return string

fetchPairs() public method

Fetch pairs
public fetchPairs ( $key, $value, $object = false ) : array
$key
$value
$object
return array of fetched rows as pairs

getFromAlias() public method

Return table alias from FROM clause
public getFromAlias ( )

getFromTable() public method

Return table name from FROM clause
public getFromTable ( )

getIterator() public method

public getIterator ( )