PHP Интерфейс Spot\QueryInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Mapper $mapper, $entityName ) : string
$mapper Mapper
Результат string

andWhere() публичный Метод

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

from() публичный Метод

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

group() публичный Метод

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

having() публичный Метод

HAVING query or result set
public having ( array $having = [] )
$having array

limit() публичный Метод

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

orWhere() публичный Метод

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

order() публичный Метод

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

select() публичный Метод

Called from mapper's select() function
public select ( mixed $fields = "*", string $table ) : string
$fields mixed (optional)
$table string Table name
Результат string

where() публичный Метод

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"