Closed RuneSP closed 9 years ago
Hi @RuneSP,
Yes, you can use ignoreFields
:
class Post extends CActiveRecord
{
public function behaviors()
{
return array(
'AuditFieldBehavior' => array(
'insert' => array('modified', 'modified_by', 'deleted', 'deleted_by'),
'update' => array('created', 'created_by', 'modified'),
),
);
}
}
Sorry, should be like this
class Post extends CActiveRecord
{
public function behaviors()
{
return array(
'AuditFieldBehavior' => array(
'class' => 'audit.components.AuditFieldBehavior',
'ignoreFields' => array(
'insert' => array('modified', 'modified_by', 'deleted', 'deleted_by'),
'update' => array('created', 'created_by', 'modified'),
),
),
);
}
}
I have the audit module up and running and its working great.
However I would like to be able to specify which attributes (or fields) of each model that should be tracked. For instance I have a model with a lot of attributes that are often changed, but I'm only interested in tracking the value of the "status" property. Is this possible?