PHP Interface Spot\QueryInterface

显示文件 Open project: vlucas/spot Interface Usage Examples

Public Methods

Method Description
__construct ( Mapper $mapper, $entityName ) : string Constructor
andWhere ( array $conditions = [], $type = "AND" )
from ( string $table = null ) From
group ( array $fields = [] ) GROUP BY columns
having ( array $having = [] ) HAVING query or result set
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
where ( array $conditions = [], string $type = "AND", string $setType = "AND" ) WHERE conditions

Method Details

__construct() public method

Constructor
public __construct ( Mapper $mapper, $entityName ) : string
$mapper Mapper
return string

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

group() public method

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

having() public method

HAVING query or result set
public having ( array $having = [] )
$having 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

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"