How to change the default "WhoDidiT" behavior in cakephp

I am using 'WhoDidiT' in my model to insert the user_id. His work is wonderful. Now I need to insert a different user_id instead of the user_id login. Is there a way to insert a different user_id without changing "WhoDidiT"

var $actsAs = array(
    'WhoDidIt'=>array(
                     'created_by_field'=>'created_by',
                     'modified_by_field'=>'modified_by'
                ),

 );

      

+3


source to share


1 answer


After saving, you can update that specific field

$this->Model->saveField('created_by',$id);

      



this will do the trick

+2


source







All Articles