has and belongs to many - Cakephp hasAndBelongsToMany with countercache? -


anyone know how countercache working on habtm setup?

- categories ;id, name, test_count  - tests ; id, name  - test_to_categories ; test_id, category_id 

use counter cache in join model (test_to_categories) through belongsto associations.

if not job you'll have implement custom counter method , call in aftersave() of model should count updated.

by way "test_to_categories" not following conventions. should categories_tests. conventions there reason. ;)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -