Bluz\Db\Query\Select
Builder of SELECT queries
Synopsis
- // members
- protected mixed $fetchType = PDO::FETCH_ASSOC;
- // Inherited members from AbstractBuilder
- protected array $aliases;
- protected $sql;
- protected array $sqlParts;
- protected array $params;
- protected array $types;
- // methods
- public integer|string|array execute()
- public Select setFetchType()
- public string getSql()
- public Select select()
- public Select addSelect()
- public Select join()
- public Select innerJoin()
- public Select leftJoin()
- public Select rightJoin()
- public Select groupBy()
- public Select addGroupBy()
- public Select having()
- public Select andHaving()
- public Select orHaving()
- public Select setPage()
- protected string getSQLForJoins()
- // Inherited methods from AbstractBuilder
- public integer|string|array execute()
- public abstract string getSql()
- public string getQuery()
- public $this setParameter()
- public $this setParameters()
- public mixed getParameter()
- public array getParameters()
- protected $this addQueryPart()
- public mixed getQueryPart()
- protected $this resetQueryPart()
- protected $this setFromQueryPart()
- protected string prepareCondition()
- public string __toString()
- // Inherited methods from From
- public $this from()
- // Inherited methods from Order
- public $this orderBy()
- public $this addOrderBy()
- // Inherited methods from Limit
- public $this limit()
- public $this setLimit()
- public $this setOffset()
Hierarchy
Extends
Uses
Members
protected
- $aliases — array
- $fetchType — mixed
- $limit — integer
- $offset — integer
- $params — array
- $sql — string
- $sqlParts — array
- $types — array
Methods
protected
- getSQLForJoins() — Generate SQL string for JOINs
public
- addGroupBy() — Adds a grouping expression to the query.
- addSelect() — Adds an item that is to be returned in the query result.
- andHaving() — Adds a restriction over the groups of the query, forming a logical conjunction with any existing having restrictions
- execute() — {@inheritdoc}
- getSql() — {@inheritdoc}
- groupBy() — Specifies a grouping over the results of the query.
- having() — Specifies a restriction over the groups of the query.
- innerJoin() — Creates and adds a join to the query
- join() — Creates and adds a join to the query
- leftJoin() — Creates and adds a left join to the query.
- orHaving() — Adds a restriction over the groups of the query, forming a logical disjunction with any existing having restrictions
- rightJoin() — Creates and adds a right join to the query.
- select() — Specifies an item that is to be returned in the query result Replaces any previously specified selections, if any
- setFetchType() — Setup fetch type, any of PDO, or any Class
- setPage() — Setup offset like a page number, start from 1
Inherited from Bluz\Db\Query\AbstractBuilder
protected
- addQueryPart() — Either appends to or replaces a single, generic query part
- prepareCondition() — Prepare condition
- resetQueryPart() — Reset single SQL part
- setFromQueryPart() — setFromQueryPart
public
- __toString() — Gets a string representation of this QueryBuilder which corresponds to the final SQL query being constructed.
- execute() — Execute this query using the bound parameters and their types
- getParameter() — Gets a (previously set) query parameter of the query being constructed
- getParameters() — Gets all defined query parameters for the query being constructed
- getQuery() — Return the complete SQL string formed for use
- getQueryPart() — Get a query part by its name
- getSql() — Return the complete SQL string formed by the current specifications
- setParameter() — Sets a query parameter for the query being constructed
- setParameters() — Sets a collection of query parameters for the query being constructed
Inherited from Bluz\Db\Query\Traits\From
public
- from() — Set FROM
Inherited from Bluz\Db\Query\Traits\Where
public
- andWhere() — Add WHERE .. AND .. condition
- orWhere() — Add WHERE .. OR .. condition
- where() — Set WHERE condition
Inherited from Bluz\Db\Query\Traits\Order
public
- addOrderBy() — Adds an ordering to the query results
- orderBy() — Specifies an ordering for the query results Replaces any previously specified orderings, if any
Inherited from Bluz\Db\Query\Traits\Limit
public
- limit() — Sets the maximum number of results to retrieve/update/delete
- setLimit() — Setup limit for the query
- setOffset() — Setup offset for the query
History
-
2017-08-22T15:09:27+00:00 (commit #38fd8e8)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added fields filter for `Crud` and `Mapper\Link`
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-21T15:28:30+00:00 (commit #f0410e7)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `join` with `implode`
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`
-
2017-01-30T12:38:53+00:00 (commit #0ab8691)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `AttachmentResponse` Added `attachment($file)` helper for `Controller`