implements Phalcon\Mvc\Model\QueryInterface, Phalcon\Di\InjectionAwareInterface
This class takes a PHQL intermediate representation and executes it.
$phql = "SELECT c.price*0.16 AS taxes, c.* FROM Cars AS c JOIN Brands AS b WHERE b.name = :name: ORDER BY c.name"; $result = $manager->executeQuery( $phql, [ "name" => "Lamborghini", ] ); foreach ($result as $row) { echo "Name: ", $row->cars->name, "\n"; echo "Price: ", $row->cars->price, "\n"; echo "Taxes: ", $row->taxes, "\n"; }
Phalcon\Mvc\Model\Query constructor
Sets the dependency injection container
Returns the dependency injection container
Tells to the query if only the first row in the resultset must be returned
Check if the query is programmed to get only the first row in the resultset
Replaces the model’s name to its source name in a qualified-name expression
Resolves an expression in a single call argument
Resolves an expression in a single call argument
Resolves an expression in a single call argument
Resolves an expression from its intermediate code into a string
Resolves a column from its intermediate representation into an array used to determine if the resultset produced is simple or complex
Resolves a table in a SELECT statement checking if the model exists
Resolves a JOIN clause checking if the associated models exist
Resolves a JOIN type
Resolves joins involving has-one/belongs-to/has-many relations
Resolves joins involving many-to-many relations
Processes the JOINs in the query returning an internal representation for the database dialect
Returns a processed order clause for a SELECT statement
Returns a processed group clause for a SELECT statement
Returns a processed limit clause for a SELECT statement
Analyzes a SELECT intermediate code and produces an array to be executed later
Analyzes an INSERT intermediate code and produces an array to be executed later
Analyzes an UPDATE intermediate code and produces an array to be executed later
Analyzes a DELETE intermediate code and produces an array to be executed later
Parses the intermediate code produced by Phalcon\Mvc\Model\Query\Lang generating another intermediate representation that could be executed by Phalcon\Mvc\Model\Query
Returns the current cache backend instance
Executes the SELECT intermediate representation producing a Phalcon\Mvc\Model\Resultset
Executes the INSERT intermediate representation producing a Phalcon\Mvc\Model\Query\Status
Executes the UPDATE intermediate representation producing a Phalcon\Mvc\Model\Query\Status
Executes the DELETE intermediate representation producing a Phalcon\Mvc\Model\Query\Status
Query the records on which the UPDATE/DELETE operation well be done
Executes a parsed PHQL statement
Executes the query returning the first result
Sets the type of PHQL statement to be executed
Gets the type of PHQL statement executed
Set default bind parameters
Returns default bind params
Set default bind parameters
Set SHARED LOCK clause
Returns default bind types
Allows to set the IR to be executed
Returns the intermediate representation of the PHQL statement
Sets the cache parameters of the query
Returns the current cache options
Returns the SQL to be generated by the internal PHQL (only works in SELECT statements)
Destroys the internal PHQL cache
© 2011–2017 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Model_Query.html