Tuesday, February 28, 2012

Filter on a deep model association

Hi,
I have these 3 associated models :

class Author extends AppModel {
var $hasAndBelongsToMany = array('Book');
}

class Book extends AppModel {
var $belongsTo = array('Collection');
var $hasAndBelongsToMany = array('Author');
}

class Collection extends AppModel {
var $hasMany = array('Book');
}

I need to find the list of all the authors (with their associated
books) filtered by collection. I tried with the containable behaviour
but I can only filters on the Collection level.
Any help would be appreciated.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: