Your original post showed 'uses' for the tables in question, which infers that you don't have them linked to the controller's model.
If they are connected, you may not have recursive set properly to cause Cake to include them. Cake needs to understand how the tables get joined in order to build the SQL. On Dec 27, 6:45 am, "Chad Casselman" <[email protected]> wrote: > Even though the binding is in the models correctly, I have to respecify the > associations in this controller that are already in the models that are > being "used"? Assuming that that HABTM is not going to be a problem. > > Chad > > On Fri, Dec 26, 2008 at 11:11 PM, Webweave <[email protected]> wrote: > > > In order to fetch data from both tables, you need to join them, Cake > > won't do this automagically. > > > On Dec 26, 5:40 pm, "Chad Casselman" <[email protected]> wrote: > > > Should it bring in all hardcoded (model) associations when I import them? > > > > Here is what I have and I can't pull any fields from Sequences or > > > PackagesSequence objects/tables > > > > var $uses = array('Package','Sequence','PackagesSequence'); > > > $extra = array( > > > 'recursive' => 1, //int > > > 'fields' => array('Package.name', 'Sequence.name'), > > //array > > > of field names > > > ); > > > > $this->Package->find('all', $extra); > > > > I get an error that it doesn't know the Sequence table. Thoughts? Do I > > > have to recode the associations already in the models? > > > > Chad > > > > On Fri, Dec 26, 2008 at 6:26 PM, Arthur Pemberton <[email protected]> > > wrote: > > > > > On Fri, Dec 26, 2008 at 5:14 PM, Chad Casselman <[email protected]> > > > > wrote: > > > > > I have a Controller for Jobs with a model Job. > > > > > > When I hit /jobs (the index function of Job Controller), I need to > > run a > > > > > query on 2 other tables (not joined to Job) to find values to > > manually > > > > > insert into jobs before actually displaying the index. > > > > > > I have tried several things but can't seem to make any progress on > > this. > > > > > > Can anyone help me with this? > > > > > > 1) select fields from a join on customers and packages (complex > > > > conditions) > > > > > I believe you want to bind those models to each other [1] > > > > > > 2) iterate through results and insert/update values in job > > > > > Once you setup the appropriate bindings, you can do a find('all') on > > > > them and iterate over the results of that. [2] may be clearer. > > > > > > 3) display jobs > > > > > I'm guessing that part already works with your index() action. > > > > > > Thank you in advance. > > > > > > Chad > > > > > [1] > > > >http://book.cakephp.org/view/86/Creating-and-Destroying-Associations-. > > .. > > > > [2]http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM > > > > > -- > > > > Fedora 9 : sulphur is good for the skin > > > > (www.pembo13.com) > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
