You can use Containable for what you're trying to do, I think. On Wed, Jan 28, 2009 at 6:44 AM, maxmil <[email protected]> wrote: > > I have the following scenario in my model. > > A has a ManyToOne relationship with B > B has a ManyToOne relationship with C > > I would like to use "find" on A but be able to put conditions on field > in object C. > > Something like: > > $this->A->find('all', array('conditions' => array('B.C.someField' => > 'someValue'); > > However i can't reference fields on C from A. How do i need to > redefine my model assosiations (or find conditions) to acheive this. > > I realize that i could use A->query($sql) but i would like to use the > query with $paginate which i think means that it can't be an sql > query. > > >
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
