entity_id INT
activity_id INT
created_at TIMESTAMP
created_by INT
###Append UserActivityListener to boopstrap config section like this
'bootstrap' => array (
[
'class' => '\yiiBoy\activity\UserActivityListener',
'watchClassNameEventName' => [
['\namespace\Model1', ActiveRecord::EVENT_AFTER_INSERT],
['\namespace\Model1', ActiveRecord::EVENT_AFTER_UPDATE],
['\namespace\Model1', ActiveRecord::EVENT_AFTER_DELETE],
['\namespace\Model2', ActiveRecord::EVENT_AFTER_INSERT],
['\namespace\Model2', ActiveRecord::EVENT_AFTER_UPDATE],
['\namespace\Model2', ActiveRecord::EVENT_AFTER_DELETE],
],
'activityClass' => '\namespace\Activity',
'entityAttribute' => 'entity_id',
'activityAttribute' => 'activity_id',
'createdAtAttribute' => 'created_at',
'createdAtValue' => new Expression('NOW()'),
'createdByAttribute' => 'created_by',
'getActivityIdByEvent' => ['\namespace\Activity','getActivityIdByEvent'],
],
),