Phalcon Query Language (PHQL)
It allows user to implement query language similar to SQL query language. PHQL is implemented as a parser which connects to RDBMS. Phalcon parser uses same technology as SQLite.
PHQL consist of features which are listed below:
PHQL Life Cycle
PHQL allows developers the ability to personalize and customize accordingly. The following is the lifecycle of PHQL statement which is executed:
First we create a front-end which takes the input.
We have 2 models Mobile and Brands:
Creating PHQL Query
It is created under directory Phalcon\Mvc\Model\Query.
Executing PHQL Query
It is executed from controller or view under directory Phalcon\Mvc\Model\Manager.
Result type is of two types Simple and Complex depending upon the type of column we query.
If we retrieve single object then the object return is Simple Result (Phalcon\Mvc\Model\Resultset\Simple).
If we access both complete objects and scalars at once then return Complex Result (Phalcon\Mvc\Model\Resultset\Complex).