Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phalcon\Mvc\Query\Builder's constructor sample code in comment + support... #1205

Merged
merged 1 commit into from
Sep 7, 2013
Merged

Phalcon\Mvc\Query\Builder's constructor sample code in comment + support... #1205

merged 1 commit into from
Sep 7, 2013

Conversation

Cinderella-Man
Copy link
Contributor

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 ...'

'models' key(added by me) could take also alias to be the same as addFrom (string $model, [string $alias])

lack of support for following: join, innejJoin, leftJoin, rightJoin, orWhere, betweenWhere, notBetweenWhere, inWhere, notInWhere.

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

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

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

Thanks,

Kamil

phalcon pushed a commit that referenced this pull request Sep 7, 2013
Phalcon\Mvc\Query\Builder's constructor sample code in comment + support...
@phalcon phalcon merged commit b6729c4 into phalcon:1.3.0 Sep 7, 2013
@phalcon
Copy link
Collaborator

phalcon commented Sep 7, 2013

Thanks!

@phalcon
Copy link
Collaborator

phalcon commented Sep 7, 2013

Regarding your questions:

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

It's faster, call a method is expensive compared to update a property in the same class which it belongs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants