Thanks for your response. Changing true => false still throws some errors (below) but it seems to work??
Warning (512): SQL Error: 1054: Unknown column 'Subcat.cat_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525] Warning (512): SQL Error: 1054: Unknown column 'Cat.location_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525] When I tried your contain option I get this: Model "LocalInfo" is not associated with model "Subcat" [CORE/cake/ libs/model/behaviors/containable.php, line 340] Any ideas? On Feb 13, 2:57 am, WebbedIT <[email protected]> wrote: > When using pagination with on the fly binds you need to specify the > last parameter as false to make the bind last for multiple queries. > > $this->LocalInfo->bindModel(array('belongsTo'=>array( > 'Cat'=>array( > 'foreignKey'=>false, > 'type'=>'INNER', > 'conditions'=>array('Subcat.cat_id = Cat.id') > ), > 'Location'=>array( > 'foreignKey'=>false, > 'type'=>'INNER', > 'conditions'=>array('Cat.location_id = Location.id') > ) > )), false); > > When using contain and specifying deep relations they need to be done > as follows > > $this->LocalInfo->Behaviors->attach('Containable'); > $this->paginate['LocalInfo'] = array( > 'contain' => array('Subcat'=>array( > 'Cat'=>array( > 'Location' > ) > )), > 'order' => 'LocalInfo.title' > ); Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
