IgnitedRecord 1.0 pre-release |
[eluser]m4rw3r[/eluser]
I've also enabled edit permissions for visitors, so if you have something interesting about IgnitedRecord (examples, how to use it with other libraries, behaviours, etc.) please create a wiki page.
[eluser]Heli[/eluser]
Hello, first sorry for my english. Second, I've got problem: I downloded IR 0.2 from link and I tried to done "Quick Start", but at first I've got same error as stensi: Quote: Then I've read the post of m4rw3r Posted: 28 August 2008 10:24 AM and desided to took last version of IR from SVN, it was 117 revision. And after that I've got another error: Code: A Database Error Occurred
[eluser]Heli[/eluser]
And this is my Controller: Code: class User_controller extends Controller{ Code: class User extends IgnitedRecord{ Code: class Group extends IgnitedRecord{
[eluser]m4rw3r[/eluser]
Can you post the query, so I can see what's wrong?
[eluser]m4rw3r[/eluser]
Oh, now I see! Your code here messes things up: Code: $related_recs =& $rec1->related('groups'); The first call to get() runs the correct query and then it resets the $related_recs object. The second gets an empty query because of this (an empty query object). So the solution is to either remove the $test = $related_recs->get(); line or replace the second $related_recs->get() with $test. I'll add an error message for those occasions in the future.
[eluser]the ronald[/eluser]
First off. I have to say great job on IgnitedRecord... When doing an update or an insert ie: Code: $this->examplemodel->new_record($array)->save(); What I am wanting to do is pass the mysql NOW() function through. So in the array it would be something like: Code: $array['firstname'] = 'John'; Thanks in advance for your help...
[eluser]the ronald[/eluser]
Well I think I answered my own question. Code: $array['first_name'] = 'John'; This seemed to work for me. Is this the correct way of handling mysql native function through IR? If not I would love to see a different approach...
[eluser]m4rw3r[/eluser]
I see that I need to come up with a neat way to say that a certain value shouldn't be escaped. One way is to set it as a property in the model: Code: class Foo extends IgnitedRecord{ (not if I add something like Datamapper's auto table creation ). Another way is to add a method and property to the IR_record: Code: $post = $this->post->new_record(); I dunno which one I should choose, what do you think? And if you have other solution, don't hesitate to suggest it. The reason this is needed is that every record should be independent (ie. the model (or sql-lib) shouldn't contain record data, which is the case with the current workaround, see Ticket). Also I need to refactor the relation code again, because of the "through" relation type *sigh*. This won't affect the current relation fetching/defining api at all. |
Welcome Guest, Not a member yet? Register Sign In |