IgnitedRecord 1.0 pre-release |
[eluser]jinfusion[/eluser]
Sorry, The answer you posted to my question is not clear enough for me. I know you are very busy, but I hope you can take a moment to expand on it a bit. The need is to access fields in the join/map table of a many to many rel. Can you run through a simple but full example? also I am assuming I can use the 'attr' multiple times per definition as I will have more then one attribute in the join table. Is that right? Thank you, Joel
[eluser]m4rw3r[/eluser]
@jinfusion: You just put all the different attributes in an array: Code: // define: Also, keep in mind when naming the attributes so their names doesn't collide with other columns @paul Apostol: Can you elaborate? Preferably a bit of the model code, if you have anything custom (=not using defaults) there, and what errors you are experiencing.
[eluser]Black Buddha[/eluser]
While working with IgnitedRecord, was having a terrible time doing a simple multiple-belongs to relationship: it would consistently throw a constraint violation exception. My relationship looked like this: Code: var $belongs_to = array(array('table' => 'account', 'fk' => 'account', 'name' => 'account'), and when I tried to set the relationships in the object like so: Code: $item->add('entity', $entity); I kept getting a constraint violation. I ended up (after a couple of hours of struggle) realizing that the function establish() in RelProperty.php automatically does a save() on the child, even if the child hasn't been completely configured. I ended up modifying RelProperty.php and changing line 371 from Code: return $child->save(); to Code: return true; Is this a known condition and multiple belongs_to relationships with constraints are not supported? It should probably have an option for belongs_to relationships that defers the save(): this would not only be more performant but would allow it to support these sorts of configurations.
[eluser]dcunited08[/eluser]
There is an issue with mssql in Ignitedquery->_protect_identifiers. I fixed by creating a regular expression which matches on two-word items. It can not match on items with 'AS' in it and I am not sure what else it should capture on so I made it as limited as possible. I changed Ignitedquery line 2446 and following to the code below. Any ideas? Code: // fixes error with escaped tablename
[eluser]Nabeel[/eluser]
I updated from the 1.0 to the latest one in SVN, hoping that my issue below would be fixed, but found out that this is broke: Code: return $this->where('TIMEDIFF (deptime, TIME(NOW())) <= '.$time, '', false); In the latest SVN version: Code: SELECT `schedules`.* FROM `schedules` Whereas in the older 'zipped' one: Code: SELECT `schedules`.* FROM `schedules` Can't get fetch_all to work either. So now I revert back to the older version: Code: public function upcoming_flights($time = 60) Code: $data['upcoming_flights'] = $this->schedules_model->upcoming_flights()->find_all(); Reverting to the older version, the query is formatted right, but only one result is being returned, though running the query returns 15. Not sure if it's a bug, or something I'm doing wrong
[eluser]Nabeel[/eluser]
Nevermind, I didn't supply the key for the schedules_model table. Woops. But, that brings my next question in - I added the foreign key for a join, but I guess you can't supply a different column in the current table to join on? For instance, instead of joining on ID, it should join on "apikey" in my example. Man, I'm so used to doing everything by hand, this is new
[eluser]ardinotow[/eluser]
Hi, I have a problem with find_all_by_sql. If I use $this->find_all_by_sql('myquery') function, it only showing one record instead of two records. But, If I use codeigniter active records $this->db->query('myquery') it can showing two records. Below is myquery: Code: 'SELECT COUNT(posts.id) AS posts_count, posts.date_posted Code: function wg_archive_list() Code: <?php And this is my controller that using codeigniter active record: Code: function wg_archive_list() Correct answer is i=2. How to fix this ? Thx
[eluser]m4rw3r[/eluser]
@ardinotow: You have to select the PK too, IR makes one record per PK. @Nabeel: Unfortunately not for the moment, and I don't know how much it is in demand to be able to relate with anything but the PK to an FK. @all: How usable would it be to relate to anything but the PK? @Black Buddah: Something I will take in consideration for my new ORM.
[eluser]gunter[/eluser]
I have a strange error: Code: $this->load->orm("tree"); Code: $this->load->orm(); |
Welcome Guest, Not a member yet? Register Sign In |