CakePHP-HABTM-Counter-Cache-Plugin icon indicating copy to clipboard operation
CakePHP-HABTM-Counter-Cache-Plugin copied to clipboard

Compatibility with CakePHP 2.x

Open NEOSolutions opened this issue 12 years ago • 1 comments

I got this errors when I enable the plugin:

Strict (2048): Declaration of BlogSetting::afterSave() should be compatible with Model::afterSave($created) [APP\Plugin\Blog\Model\BlogSetting.php, line 10] Strict (2048): Declaration of BlogPost::afterSave() should be compatible with Model::afterSave($created) [APP\Plugin\Blog\Model\BlogPost.php, line 435] Strict (2048): Declaration of HabtmCounterCacheBehavior::setup() should be compatible with ModelBehavior::setup(Model $model, $config = Array) [APP\Plugin\habtm_counter_cache\Model\Behavior\HabtmCounterCacheBehavior.php, line 27] Strict (2048): Declaration of HabtmCounterCacheBehavior::beforeSave() should be compatible with ModelBehavior::beforeSave(Model $model) [APP\Plugin\habtm_counter_cache\Model\Behavior\HabtmCounterCacheBehavior.php, line 27] Strict (2048): Declaration of HabtmCounterCacheBehavior::afterSave() should be compatible with ModelBehavior::afterSave(Model $model, $created) [APP\Plugin\habtm_counter_cache\Model\Behavior\HabtmCounterCacheBehavior.php, line 27] Strict (2048): Declaration of HabtmCounterCacheBehavior::beforeDelete() should be compatible with ModelBehavior::beforeDelete(Model $model, $cascade = true) [APP\Plugin\habtm_counter_cache\Model\Behavior\HabtmCounterCacheBehavior.php, line 27] Strict (2048): Declaration of HabtmCounterCacheBehavior::afterDelete() should be compatible with ModelBehavior::afterDelete(Model $model) [APP\Plugin\habtm_counter_cache\Model\Behavior\HabtmCounterCacheBehavior.php, line 27]

NEOSolutions avatar Jan 05 '13 20:01 NEOSolutions

1- open the plugin file 2- find "public function setup(&$model, $config = null)" and change it with "public function setup(Model $model, $config = null)" -> just change the '&' character with the word 'Model' 3- repeat this manipulation to the other callback (afterSave, afterDelete ...) that's all talks ;)

flashios09 avatar Feb 27 '13 03:02 flashios09