IgnitedRecord 1.0 pre-release |
[eluser]amrnt[/eluser]
sorry, but from where i can get it??! i can only see 0.1.1 and 0.2.0!!
[eluser]Sander Versluys[/eluser]
From the IgnitedRecord homepage. It's is not released yet. But you can get it with svn. If you don't know how that works, you can stick with 0.2 untill it gets released.
[eluser]Sander Versluys[/eluser]
How can I access the methods in the model from an IR_record Object? Example: Code: class User_model extends IgnitedRecord { So when I fetch a user from the database, i can call the is_in_role() method of that object... Or can this only be accomplished with behaviors? And are the models that are extending the IgnitedRecord class in this way only wrappers for configuration? Thanks!
[eluser]dcunited08[/eluser]
Can someone do an alpha release of 1.0? I.e. just put it here or on that site in a zip labeled alpha. I am behind a proxy that doesn't really work too well with svn.
[eluser]m4rw3r[/eluser]
@Sander Versluys: IgnitedRecord uses the DataMapper pattern (not to be confused with stensi's DataMapper ORM), and the model and data objects are separate classes. So to add a method to the model, just add it to the model class. But if you would like to add a method to a record, you have to create a descendant class of IR_record, assign your methods to that class, then set $child_class in the model to the class name: Code: class User_model extends IgnitedRecord{ @dcunited08: There it is ![]() http://www.assembla.com/spaces/IgnitedRecord/documents
[eluser]dcunited08[/eluser]
Relations question: I have 2 tables, one is an items table and one is a machine table. How can I join them so that when I call an item from my items_model, I can load the corresponding machine object? Code: class items_model extends IgnitedRecord{ I would like to load the items like so (within a items_model method): Code: $items = $this->find_all(); Or even have them loaded when I run the original find_all().
[eluser]Sander Versluys[/eluser]
Aha it makes sense now! m4rw3r you're awesome! :lol: :exclaim: Thanks!
[eluser]m4rw3r[/eluser]
@dcunited08: You can call join_related(), then they are joined and fetched with one SINGLE query. ![]() Saves a lot of queries with has many relations (and habtm too). So your code (I hope I guessed right about your relations): Code: class item_model extends IgnitedRecord{
[eluser]dcunited08[/eluser]
@m4rw3r How do I set the foreign key (do I have to use the has_many method instead)? Code: class item_model extends IgnitedRecord{ Thank you so much for your quick responses. |
Welcome Guest, Not a member yet? Register Sign In |