W3cubDocs

/Phalcon 2

Interface Phalcon\Mvc\Model\Query\BuilderInterface

Phalcon\Mvc\Model\Query\BuilderInterface initializer

Methods

abstract public distinct (unknown $distinct)

...

abstract public getDistinct ()

...

abstract public Phalcon\Mvc\Model\Query\BuilderInterface columns (string|array $columns)

Sets the columns to be queried

abstract public string|array getColumns ()

Return the columns to be queried

abstract public Phalcon\Mvc\Model\Query\BuilderInterface from (string|array $models)

Sets the models who makes part of the query

abstract public Phalcon\Mvc\Model\Query\BuilderInterface addFrom (string $model, [string $alias])

Add a model to take part of the query

abstract public string|array getFrom ()

Return the models who makes part of the query

abstract public Phalcon\Mvc\Model\Query\BuilderInterface join (string $model, [string $conditions], [string $alias])

Adds a INNER join to the query

abstract public Phalcon\Mvc\Model\Query\Builder innerJoin (string $model, [string $conditions], [string $alias])

Adds a INNER join to the query

abstract public Phalcon\Mvc\Model\Query\Builder leftJoin (string $model, [string $conditions], [string $alias])

Adds a LEFT join to the query

abstract public Phalcon\Mvc\Model\Query\Builder rightJoin (string $model, [string $conditions], [string $alias])

Adds a RIGHT join to the query

abstract public Phalcon\Mvc\Model\Query\BuilderInterface where (string $conditions, [array $bindParams], [array $bindTypes])

Sets conditions for the query

abstract public Phalcon\Mvc\Model\Query\Builder andWhere (string $conditions, [array $bindParams], [array $bindTypes])

Appends a condition to the current conditions using a AND operator

abstract public Phalcon\Mvc\Model\Query\Builder orWhere (string $conditions, [array $bindParams], [array $bindTypes])

Appends a condition to the current conditions using a OR operator

abstract public Phalcon\Mvc\Model\Query\Builder betweenWhere (string $expr, mixed $minimum, mixed $maximum)

Appends a BETWEEN condition to the current conditions

abstract public Phalcon\Mvc\Model\Query\Builder notBetweenWhere (string $expr, mixed $minimum, mixed $maximum)

Appends a NOT BETWEEN condition to the current conditions

$builder->notBetweenWhere('price', 100.25, 200.50);

abstract public Phalcon\Mvc\Model\Query\Builder inWhere (string $expr, array $values)

Appends an IN condition to the current conditions

abstract public Phalcon\Mvc\Model\Query\Builder notInWhere (string $expr, array $values)

Appends a NOT IN condition to the current conditions

abstract public string|array getWhere ()

Return the conditions for the query

abstract public Phalcon\Mvc\Model\Query\BuilderInterface orderBy (string $orderBy)

Sets a ORDER BY condition clause

abstract public string|array getOrderBy ()

Return the set ORDER BY clause

abstract public Phalcon\Mvc\Model\Query\BuilderInterface having (string $having)

Sets a HAVING condition clause

abstract public string|array getHaving ()

Returns the HAVING condition clause

abstract public Phalcon\Mvc\Model\Query\BuilderInterface limit (int $limit, [int $offset])

Sets a LIMIT clause

abstract public string|array getLimit ()

Returns the current LIMIT clause

abstract public Phalcon\Mvc\Model\Query\BuilderInterface groupBy (string $group)

Sets a LIMIT clause

abstract public string getGroupBy ()

Returns the GROUP BY clause

abstract public string getPhql ()

Returns a PHQL statement built based on the builder parameters

abstract public Phalcon\Mvc\Model\QueryInterface getQuery ()

Returns the query built

© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_Mvc_Model_Query_BuilderInterface.html