Closed bjornpost closed 10 years ago
The only problem I have with this is that it becomes impossible to change the ordering. To match the where
and andWhere
semantics, it would probably make sense to add an andOrderBy
method. Thoughts?
The only problem I have with this is that it becomes impossible to change the ordering.
Not sure if I understand this. What do you mean by change the ordering? Why would you want to change those after defining them? Maybe I'm missing your point here :-)
\Model\Post::all()->orderBy('date DESC')->orderBy('title ASC');
To match the where and andWhere semantics, it would probably make sense to add an andOrderBy method. Thoughts?
Makes sense, I'll fix my pull request.
Not sure if I understand this. What do you mean by change the ordering? Why would you want to change those after defining them? Maybe I'm missing your point here :-)
ping @lox :-), I'd like to get this fixed asap.
ping @lox ?
Hi @lox,
I've added the andOrderBy()
method: https://github.com/bjornpost/pheasant/commit/eb83004fd3b860aa4e888c4779273806ff0a564f
Can you pull this in? :-)
I'm confused @bjornpost, shouldn't the semantics of orderBy() be that it replaces, whereas andOrderBy should append an additional column to the existing orderBy?
Ah, ofcourse. Updated: https://github.com/bjornpost/pheasant/commit/09d76489dfa397a4fb63d898e949aad990c3b93d
Hey @lox, just noticed this pull request wasn't fully pulled for some reason. The changes as per https://github.com/bjornpost/pheasant/commit/09d76489dfa397a4fb63d898e949aad990c3b93d aren't on master right now. Can you pull those in by hand?
If you were to create a pull request, I'd happily merge it.
On Wed, Dec 4, 2013 at 11:26 PM, Bjorn Post notifications@github.comwrote:
Hey @lox https://github.com/lox, just noticed this pull request wasn't fully pulled for some reason. The changes as per bjornpost@09d7648https://github.com/bjornpost/pheasant/commit/09d76489dfa397a4fb63d898e949aad990c3b93daren't on master right now. Can you pull those in by hand?
— Reply to this email directly or view it on GitHubhttps://github.com/lox/pheasant/pull/68#issuecomment-29800630 .
Also added a new testcase which test the chaining of orderBy() calls.