Page 112 of 211,266, showing 20 records out of 4,225,308 total, starting on record 2,221, ending on 2,240
# | Username | Text | |
---|---|---|---|
# | Aug 7th 2008, 04:31 | Martz | poluta1: and if you try and implement it and get any errors, please bin your code of what you have (app controller, app model, and any models using it) |
# | Aug 7th 2008, 04:31 | stevieboy | pgcd: i meant you are wrong. foreach is usefull and the right approach for that |
# | Aug 7th 2008, 04:31 | Martz | JeffEmbracedDC: i ran away from HABTM and any complex queries I'd need for them a long time ago ;) Life is too short for HABTM! ;) |
# | Aug 7th 2008, 04:32 | JeffEmbracedDC | Martz: hah really? hmm |
# | Aug 7th 2008, 04:32 | pgcd | stevieboy: =) i'll use it... honestly, it's just that i'm so new to cakephp that I always expect there's a "neater" way of doing everything |
# | Aug 7th 2008, 04:33 | stevieboy | pgcd: cake helps with data retrival and so on. in the view it's mostly normal php with the vars |
# | Aug 7th 2008, 04:33 | pgcd | speed and memory usage of foreach don't worry me in this case, seeing as it's gonna be 3/4 records at most for every loop |
# | Aug 7th 2008, 04:33 | Martz | JeffEmbracedDC: yeah. I tend to make my schema now with a 3rd real model instead of a join table, so that I can add meta data, easily define complex conditions etc |
# | Aug 7th 2008, 04:34 | JeffEmbracedDC | Martz: well...... are you familiar with 'with' associations? which allow for added meta data and faux model access of the join table? |
# | Aug 7th 2008, 04:34 | Martz | JeffEmbracedDC: the downside, which someone pointed out to me, is that mysql isnt able to "ensure integrity" of not having the same 2 foreign keys, since they are not primary keys like in a HABTM join table. However that is solveable with validaiton and checking at the PHP level |
# | Aug 7th 2008, 04:35 | Martz | JeffEmbracedDC: im aware it exists, I played with it, but I dont use it |
# | Aug 7th 2008, 04:35 | JeffEmbracedDC | Martz: Gotchya |
# | Aug 7th 2008, 04:35 | alkemann | Martz: JeffEmbracedDC when using a with I have been forced to add an id field and put it as primary key, but that has worked well |
# | Aug 7th 2008, 04:35 | pgcd | stevieboy: that is good advice - it might save me a lot of time down the road if i just *do* things instead of perusing manual api and google to see if there's something else that does it |
# | Aug 7th 2008, 04:36 | pgcd | as somebody said, sometime it's quicker to just reinvent the wheel =) |
# | Aug 7th 2008, 04:36 | stevieboy | pgcd: it's always good to have an open eye. but mostly you can check the manual for the helpers provided. if you arent lucky there, try it the normal way |
# | Aug 7th 2008, 04:36 | JeffEmbracedDC | alkemann: works great in my opinion.. only downside I've come across so far.. is.. I'm not sure how you add beforeSave/afterSave/whatever functions to the faux model.. or if it's possible at all. |
# | Aug 7th 2008, 04:36 | alkemann | JeffEmbracedDC: u can make the with model in same way as other models |
# | Aug 7th 2008, 04:36 | alkemann | in fact cake makes a model for all habtm relationships |
# | Aug 7th 2008, 04:37 | alkemann | Users HABTM Groups => Model UsersGroup |