category.php array( 'className' => 'Category', 'joinTable' => 'categories_categories', 'foreignKey' => 'category_id', 'associationForeignKey' => 'child_id', 'order' => 'Category.name ASC' ), ); var $recursive = 1000; } ?> work.php array( 'className' => 'Category', 'joinTable' => 'works_categories', 'foreignKey' => 'work_id', 'associationForeignKey' => 'category_id', 'conditions' => '', ), ); /* var $hasAndBelongsToMany = array('Category' => array( 'className' => 'Category', 'joinTable' => 'works_categories', ), ); */ } ?> works_category.php