PHP Interface phpDataMapper_Query_Interface, phpDataMapper

显示文件 Open project: vlucas/phpDataMapper

Public Methods

Method Description
__construct ( phpDataMapper_Adapter_Interface $adapter ) : string Constructor
__toString ( ) Return Sql code with $this->sql() function
andWhere ( array $conditions = [], $type = "AND" )
from ( string $table = null ) From
getParameters ( ) Get array of parameters/binds to execute in a prepared statement
group ( array $fields = [] ) GROUP BY columns
limit ( $limit = 20, $offset = null ) LIMIT query or result set
orWhere ( array $conditions = [], $type = "AND" )
order ( $fields = [] ) ORDER BY columns
select ( mixed $fields = "*", string $table ) : string Called from mapper's select() function
sql ( ) Get raw SQL code generated from other query builder functions
where ( array $conditions = [], string $type = "AND", string $setType = "AND" ) WHERE conditions

Method Details

__construct() public method

Constructor
public __construct ( phpDataMapper_Adapter_Interface $adapter ) : string
$adapter phpDataMapper_Adapter_Interface
return string

__toString() public method

Return Sql code with $this->sql() function
public __toString ( )

andWhere() public method

public andWhere ( array $conditions = [], $type = "AND" )
$conditions array

from() public method

From
public from ( string $table = null )
$table string Name of the table to perform the SELECT query on

getParameters() public method

Get array of parameters/binds to execute in a prepared statement
public getParameters ( )

group() public method

GROUP BY columns
public group ( array $fields = [] )
$fields array

limit() public method

LIMIT query or result set
public limit ( $limit = 20, $offset = null )

orWhere() public method

public orWhere ( array $conditions = [], $type = "AND" )
$conditions array

order() public method

ORDER BY columns
public order ( $fields = [] )

select() public method

Called from mapper's select() function
public select ( mixed $fields = "*", string $table ) : string
$fields mixed (optional)
$table string Table name
return string

sql() public method

Get raw SQL code generated from other query builder functions
public sql ( )

where() public method

WHERE conditions
public where ( array $conditions = [], string $type = "AND", string $setType = "AND" )
$conditions array Array of conditions for this clause
$type string Keyword that will separate each condition - "AND", "OR"
$setType string Keyword that will separate the whole set of conditions - "AND", "OR"