-
Notifications
You must be signed in to change notification settings - Fork 132
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
Simple way to make working with Paris more beautiful? #62
Conversation
Makes working with models more beautiful (in my opinion). :-) Examples: User::find_many(); User::where('name', 'lapayo')->find_one();
Thank you for the pull request. One reason I can see for this not already existing is that it does not work in PHP 5.2 due to the use of the |
Hmm you are right, haven´t thought of that, because I always use the newest versions. I think even the PHP devs dropped support for 5.2 (http://php.net/releases/5_2_16.php) |
Would it be acceptable to code this as some extra goodness for PHP 5.3+ users? Make it so it fails gracefully in 5.2 |
@Lapayo That is correct they have dropped official support for 5.2 (and quite some time ago at that), but please see my comments here for the arguments: j4mie/idiorm#77 (comment) |
@michaelward82 how would you propose it working without breaking PHP 5.2 support? I haven't given it any thought so any suggestions welcome. |
@treffynnon Simply using self instead of static should not break 5.2 support as long as they wont call the magic function. |
@michaelward82 Although I somehow don´t see your response here on github: Yes, your solution would be the better one, because it would not break 5.2, even when calling the magic method. |
Yeah that would be great. Also please include some tests and some documentation. |
Keep compatibility with php 5.2
Not sure what happened to my comment lol. (I suggested feature detection whilst avoiding the use of static) |
At first: Sorry for all the commits :D Didn´t knew they all get posted here. I mentioned it in the documentation, the readme, created a simple test, and fixed it for 5.2 users. :-) I hope this is enough, otherwise I will extend it this evening ;-) |
I am very busy with some client work at the moment, but I think this is at a point where it can be merged and prepared for the next release. I am currently expecting to make the next release beginning to mid June. |
Merged in commit 433c2f5 |
When I started working with Paris, I wondered, why there is no function like that and I added my own. Is there a reason why this functionality wasnt already in Paris? :D
Commit Text:
Makes working with models more beautiful (in my opinion). :-)
Examples:
User::find_many();
User::where('name', 'lapayo')->find_one();