-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added sorting to the getResourceUpdates action #64
base: master
Are you sure you want to change the base?
Conversation
Thank you! I will try and test this out soon. |
Sorry for my absence, I will try to get to this soon. |
bb1ff70
to
0b5d94d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed up some syntax issues and a problem with PDO. Working as expected. LGTM
Looked over the code. However only one thing of note and that is the sort function. I am not sure what is being sorted or if the intention is to actually sort. strcasecmp() doesn't return anything except integers. -1 if the first string should come after the second, 0 if they are the same, and 1 if the first should come after the second. If what is intended is to actually return something sorted then what should be used is natcasesort(). Second, strcasecmp() only compares using ASCII, that is it is not locale aware. Otherwise everything else looks fine. |
Thanks for the review. The |
Ah got it. Well looks good then lol 👍 |
@md_5 ready for merge? any comments? when you get time. thanks |
oops i meant @md-5 |
I noticed a little error where there was an empty return statement so I snuck that commit in. |
LGTM |
👀 |
Hey @MartenM, haven't forgotten about this. Progress is a bit halted right now until api keys are done (very close) then we will take a look again at the PRs that are open including this one and get them in |
So this is just going by intuition and by looking at the existing code.
This PR is one of the suggestions made in issue #62
Added: RequestUtils:sorting()
Adds the sorting parameter. Returns NULL by default such that controllers can choose their default if required.
Changed Database->getResourceUpdates() parameters
Added the parameter
$sorting = null
. Defaults toasc
which is the default right now I believe.SQL got changed in order to add support for the sorting param.
Friendly note
These changes are UNTESTED since I don't have a database to test this on :)