Do you have?
class Listing extends AppModel {
public $belongsTo = array('Category');
}
class Category extends AppModel {
public $hasMay = array('Listing');
}
Then you should be able to:
$listing = $this->Listing->findAll(array('category_id' =>
$category_id));
On Jan 26, 9:30 pm, bob
I have a Listings table and another Categories table, and Lists hasMany
Categories. I am trying to write a cake query where it finds all lists in a
certain category.
$listings = $this->Listing->findAll(
array('Category.category_id'=>$category_id)
);
this returns an error.
Also, if I do $this->Li