Want to log each save activity of all model table. I used afterSave method in a single model i.e. working fine.
Now in place of adding same in all modelTable one by one, I want to write below method in a single file from where all modelTable by default can run this method/function.
I tried it with behaviour as well but not exactally know how behaviour will work for this.
public function afterSave($event, $entity, $options)
{
$ActionLogs = TableRegistry::get('ActionLogs');
-------
-------
$ActionLogs->save($ActionLogsEntity);
}