DataMapper ORM v1.8.2 |
[eluser]WanWizard[/eluser]
Looked at it again. The reset should be there, as an empty object must be passed to the iterator. The query is run by $this->get_raw(), which is on the current object. get_raw() does nothing more then run a standard $this->db->get(), so I don't see why the where clause would not be honored in your example. It will ignore the limit() call, since you need to pass offset and limit to get_iterated(), and if you don't, the default NULL values will reset your previous setting.
[eluser]nickaceph[/eluser]
Thanks, Got it. run through the code again and got what i needed. $model->where('id',2)->limit(1,0); $qq = $model->get_raw(); $ww= $qq->result_array(); that's it, I will just need to encapsulate it in the inherited class thanks
[eluser]davidMC1982[/eluser]
[quote author="WanWizard" date="1378116496"]I find it odd that the error message is missing the related object name ("unable to relate order with <missing>."), which can only happen if it can't find the "model" property. Which fields are exactly in $cart_contents? Any field that might overwrite a reserved model object property, such as "model"? p.s. I don't support Datamapper anymore, so I really don't have time to dive into it if this is not the problem...[/quote] Hi, The same error is now happening with another relationship, where the save should be for an "empty" object. Code: //Displays a test report Code: <?php Code: <?php This time it's for a one-to-one relationship but it's using the same model. The only potential clue is that in both cases it's the $some_model->save($orderdetail) that doesn't work. Saving the relationship using $orderdetail->save($some_model) does work. I know you don't have time to debug etc, but do you have any ideas where to look? Thanks
[eluser]WanWizard[/eluser]
You've got the latest version from Bitbucket? I vaguely remember some fixes in this area.
[eluser]davidMC1982[/eluser]
Funnily enough, I remember not having the latest version was the cause of a previous problem ( to_json() bugs ) so I "updated" to the latest version per your website, 1.8.2.1. This seems to be almost two years out-of-date per bitbucket so I'll just download the latest commit and try that. Many thanks for your help.
[eluser]WanWizard[/eluser]
Haven't been really active with CI since 2011, so that is quite possible. I tried to keep the code on bitbucket up to date, but didn't have time to do anything else (like releasing or documentation).
[eluser]NotSmilie[/eluser]
Hi, This is really great, amazing library you have created here! I do have some issues, which I'm not sure how to go on about. My error is this one: http://i.imgur.com/o80sBTA.png My code is as follows: Code: <?php My database tables can be seen on the left side on this image: http://i.imgur.com/qaoZjWR.png I tried to use mysql instead of mysqli without any change in the error message (except that it was mysql instead of mysqli). I tried comment out auto populate, and the has many relations, without luck as well. The error occurs when I try to simply get a user by: $user = new User(); $user->where("id", $primary_key)->get();
[eluser]kakallatt[/eluser]
I don't understand why it return INSERT query. It should be UPDATE. My table is using slug for primary key instead of id. Does it cause?? Here is my code: Code: public function set_item($slug, $value) { Thank you.
[eluser]Unknown[/eluser]
Wanted to add my thanks for Bard's hack on pg.35. As much as I hate having to mess with the actual active record code, it's beyond frustrating that it prevents us from accomplishing what we need to do.
[eluser]chiqui3d[/eluser]
How I can get model name in the controller? I'm trying to self ::$model;. Code: Access to undeclared static property: miclass::$model in Any help? Thanks |
Welcome Guest, Not a member yet? Register Sign In |