shamanzpua/entity-change-log-behavior
Composer 安装命令:
composer require shamanzpua/entity-change-log-behavior
包简介
Yii2 Behavior. Logger for entity changes
关键字:
README 文档
README
Logs models state before and after change
Installation
Add to composer.json
"require": {
"shamanzpua/entity-change-log-behavior": "*"
}
Usage:
public function behaviors() { return [ [ 'class' => EntityChangeLogBehavior::class, 'logModelClass' => Log::class, //ActiveRecord log table class 'attributes' => [ //attributes of owner. Default: all attributes 'name', 'date', 'id', ], 'columns' => [ //Required log table columns 'action' => 'action_column_name' // Default 'action', 'new_value' => 'new_value_column_name' // Default 'new_value', 'old_value' => 'old_value_column_name' // Default 'old_value', ], 'relatedAttributes' => [ //attributes of owners relations 'user' => ['email'], 'category' => ['name'], ], 'additionalLogTableFields' => [ //additional log table fields. key -> log table col, value -> owners col 'log_item_name' => 'title', ], ] ]; }
统计信息
- 总下载量: 1.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-04-12