I've not found here how we can get builded query by Phalcon\Mvc\Model\Criteria in docs: http://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Model_Criteria.html
Is it possible?
I've not found here how we can get builded query by Phalcon\Mvc\Model\Criteria in docs: http://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Model_Criteria.html
Is it possible?
Phalcon\Mvc\Model\Criteria builds an array of valid parameters for SomeModel::find, or SomeModel::findFirst, this class does not build a real query.
Furthermore, we have Phalcon\Mvc\Query\Builder this class has the ability to build PHQL queries:
<?php
//Get the PHQL to be generated
$phql = $this->modelsManager->createBuilder()
->from('Robots')
->limit(20);
->order('Robots.name')
->getPhql();
//Execute the query
$robots = $this->modelsManager->createBuilder()
->from('Robots')
->limit(20);
->order('Robots.name')
->getQuery()
->execute();
More info: http://docs.phalconphp.com/en/latest/reference/phql.html#creating-queries-using-the-query-builder