PHP 인터페이스 ManaPHP\Mvc\Model\QueryBuilderInterface

파일 보기 프로젝트 열기: manaphp/manaphp 0 사용 예제들

공개 메소드들

메소드 설명
addFrom ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $alias = null ) : static Add a model to take part of the query
andWhere ( string $conditions, integer | float | string | array $bind = [] ) : static Appends a condition to the current conditions using a AND operator
betweenWhere ( string $expr, integer | float $min, integer | float $max ) : static Appends a BETWEEN condition to the current conditions
columns ( string $columns ) : static Sets the columns to be queried
distinct ( boolean $distinct ) : static Sets the columns to be queried
execute ( integer | array $cacheOptions = null ) : array build the query and execute it.
executeEx ( integer | string &$totalRows, integer | array $cacheOptions = null ) : array build the query and execute it.
forUpdate ( boolean $forUpdate = true ) : static Sets a FOR UPDATE clause
from ( string | array $models ) : static Sets the models who makes part of the query
getBind ( ) : array
getSql ( ) : string Returns a SQL statement built based on the builder parameters
groupBy ( string $group ) : static Sets a LIMIT clause
having ( string $having, array $bind = null ) : static Sets a HAVING condition clause
inWhere ( string $expr, array | ManaPHP\Mvc\Model\QueryBuilderInterface $values ) : static Appends an IN condition to the current conditions
innerJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static Adds a INNER join to the query
join ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null, string $type = null ) : static Adds a INNER join to the query
leftJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static Adds a LEFT join to the query
limit ( integer $limit, integer $offset ) : static Sets a LIMIT clause
notBetweenWhere ( string $expr, integer | float $min, integer | float $max ) : static Appends a NOT BETWEEN condition to the current conditions
notInWhere ( string $expr, array | ManaPHP\Mvc\Model\QueryBuilderInterface $values ) : static Appends a NOT IN condition to the current conditions
orderBy ( string $orderBy ) : static Sets a ORDER BY condition clause
page ( integer $size, integer $current = 1 ) : static
paginate ( integer $size, integer $page, integer | array $cacheOptions = null ) : static
rightJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static Adds a RIGHT join to the query
setBind ( array $bind, boolean $merge = true ) : static Set default bind parameters
unionAll ( ManaPHP\Mvc\Model\QueryBuilderInterface[] $builders ) : static
unionDistinct ( ManaPHP\Mvc\Model\QueryBuilderInterface[] $builders ) : static
where ( string $conditions, integer | float | string | array $bind = [] ) : static Sets conditions for the query

메소드 상세

addFrom() 공개 메소드

Add a model to take part of the query
public addFrom ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $alias = null ) : static
$model string | ManaPHP\Mvc\Model\QueryBuilderInterface
$alias string
리턴 static

andWhere() 공개 메소드

Appends a condition to the current conditions using a AND operator
public andWhere ( string $conditions, integer | float | string | array $bind = [] ) : static
$conditions string
$bind integer | float | string | array
리턴 static

betweenWhere() 공개 메소드

Appends a BETWEEN condition to the current conditions
public betweenWhere ( string $expr, integer | float $min, integer | float $max ) : static
$expr string
$min integer | float
$max integer | float
리턴 static

columns() 공개 메소드

Sets the columns to be queried
public columns ( string $columns ) : static
$columns string
리턴 static

distinct() 공개 메소드

Sets the columns to be queried
public distinct ( boolean $distinct ) : static
$distinct boolean
리턴 static

execute() 공개 메소드

build the query and execute it.
public execute ( integer | array $cacheOptions = null ) : array
$cacheOptions integer | array
리턴 array

executeEx() 공개 메소드

build the query and execute it.
public executeEx ( integer | string &$totalRows, integer | array $cacheOptions = null ) : array
$totalRows integer | string
$cacheOptions integer | array
리턴 array

forUpdate() 공개 메소드

$builder->forUpdate(true);
public forUpdate ( boolean $forUpdate = true ) : static
$forUpdate boolean
리턴 static

from() 공개 메소드

Sets the models who makes part of the query
public from ( string | array $models ) : static
$models string | array
리턴 static

getBind() 공개 메소드

public getBind ( ) : array
리턴 array

getSql() 공개 메소드

Returns a SQL statement built based on the builder parameters
public getSql ( ) : string
리턴 string

groupBy() 공개 메소드

Sets a LIMIT clause
public groupBy ( string $group ) : static
$group string
리턴 static

having() 공개 메소드

Sets a HAVING condition clause
public having ( string $having, array $bind = null ) : static
$having string
$bind array
리턴 static

inWhere() 공개 메소드

Appends an IN condition to the current conditions
public inWhere ( string $expr, array | ManaPHP\Mvc\Model\QueryBuilderInterface $values ) : static
$expr string
$values array | ManaPHP\Mvc\Model\QueryBuilderInterface
리턴 static

innerJoin() 공개 메소드

Adds a INNER join to the query
public innerJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static
$model string | ManaPHP\Mvc\Model\QueryBuilderInterface
$conditions string
$alias string
리턴 static

join() 공개 메소드

Adds a INNER join to the query
public join ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null, string $type = null ) : static
$model string | ManaPHP\Mvc\Model\QueryBuilderInterface
$conditions string
$alias string
$type string
리턴 static

leftJoin() 공개 메소드

Adds a LEFT join to the query
public leftJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static
$model string | ManaPHP\Mvc\Model\QueryBuilderInterface
$conditions string
$alias string
리턴 static

limit() 공개 메소드

Sets a LIMIT clause
public limit ( integer $limit, integer $offset ) : static
$limit integer
$offset integer
리턴 static

notBetweenWhere() 공개 메소드

$builder->notBetweenWhere('price', 100.25, 200.50);
public notBetweenWhere ( string $expr, integer | float $min, integer | float $max ) : static
$expr string
$min integer | float
$max integer | float
리턴 static

notInWhere() 공개 메소드

Appends a NOT IN condition to the current conditions
public notInWhere ( string $expr, array | ManaPHP\Mvc\Model\QueryBuilderInterface $values ) : static
$expr string
$values array | ManaPHP\Mvc\Model\QueryBuilderInterface
리턴 static

orderBy() 공개 메소드

Sets a ORDER BY condition clause
public orderBy ( string $orderBy ) : static
$orderBy string
리턴 static

page() 공개 메소드

public page ( integer $size, integer $current = 1 ) : static
$size integer
$current integer
리턴 static

paginate() 공개 메소드

public paginate ( integer $size, integer $page, integer | array $cacheOptions = null ) : static
$size integer
$page integer
$cacheOptions integer | array
리턴 static

rightJoin() 공개 메소드

Adds a RIGHT join to the query
public rightJoin ( string | ManaPHP\Mvc\Model\QueryBuilderInterface $model, string $conditions = null, string $alias = null ) : static
$model string | ManaPHP\Mvc\Model\QueryBuilderInterface
$conditions string
$alias string
리턴 static

setBind() 공개 메소드

Set default bind parameters
public setBind ( array $bind, boolean $merge = true ) : static
$bind array
$merge boolean
리턴 static

unionAll() 공개 메소드

public unionAll ( ManaPHP\Mvc\Model\QueryBuilderInterface[] $builders ) : static
$builders ManaPHP\Mvc\Model\QueryBuilderInterface[]
리턴 static

unionDistinct() 공개 메소드

public unionDistinct ( ManaPHP\Mvc\Model\QueryBuilderInterface[] $builders ) : static
$builders ManaPHP\Mvc\Model\QueryBuilderInterface[]
리턴 static

where() 공개 메소드

Sets conditions for the query
public where ( string $conditions, integer | float | string | array $bind = [] ) : static
$conditions string
$bind integer | float | string | array
리턴 static