Skip to content
New issue

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

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

Already on GitHub? # to your account

Port DumbledORM ResultSet #14

Closed
wants to merge 1 commit into from

Conversation

sandermarechal
Copy link

I came across a comment from you that you were interested in porting the ResultSet class from DubmledORM to Paris. I really liked DombledORM's approach so I started using it in my project as well. This change adds the ResultSet to Paris, allowing for some fancy jQuery-like syntax. Example:

Model::factory('Widgets')->filter('expired')->find_many()->delete();

I ported it to Paris, which seemed like the most logical choice to me at the time. If you prefer, I could also try to implement it on Idiorm itself, which would fix your j4mie/idiorm#22

This is a port of the ResultSet class from [DumbledORM][1]. The
`find_many` method will return a ResultSet object instead of an array.
All method calls on the result set will be passed onto all the models in
the set. This allows for fancy jQuery-like syntax.

 [1]: https://github.com/jasonmoo/DumbledORM
@jrivero
Copy link

jrivero commented Mar 4, 2011

I like this solution

@jasonmoo
Copy link

Awesome. Just now seeing this. :)

@treffynnon
Copy link
Collaborator

Thank you for the pull request. It cannot be merged into Paris though as it belongs on a layer below in Idiorm itself.

In the latest commit on the develop branch of Idiorm (j4mie/idiorm@5a6d20c) ResultSet functionality has been added.

To enable find_many() to return result sets by default set the following configuration option:

ORM::configure('return_result_sets', true);

Then you can run any Paris methods against the results as @sandermarechal has mentioned above.

@treffynnon treffynnon closed this Jan 15, 2013
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants