phalcon/cphalcon — pull request #1205 by Emanuel1989 (2013-09-06 16:24:19+00:00)
Title: Phalcon\Mvc\Query\Builder's constructor sample code in comment + support...

Hi,

I added support for defining 'offset' via constructor but there's many more to updated:

limit key could take array of 2 values (limit, offset) as the limit() method does limit (int $limit, [int $offset])

'conditions' key could take:
array(
array(string $conditions, [array $bindParams], [array $bindTypes])
)
or at least:
array(string $conditions, [array $bindParams], [array $bindTypes])

'having' key could work in the same way as 'conditions' but it could be simplified to single array(string $conditions, [array $bindParams], [array $bindTypes])

adding explicit DESC or ASC to 'order' value like that array('name DESC', 'id ASC') causes following exception thrown:
Uncaught exception 'Phalcon\Mvc\Model\Exception' with message 'Scanning error before 'name DESC], [id ...'

PS. Why all those function aren't simply using methods of that class instead of setting them inside constructor?

I hope that all above makes sense and it' at least a little bit helpful.

PS. On master branch there's still this 'having' typo which makes usage of 'having' key impossible.

Thanks,

Kamil