ivankff/yii2-log-after-save
Composer 安装命令:
composer require ivankff/yii2-log-after-save
包简介
yii2 save logs after AR saving
README 文档
README
ActiveRecord
/** * @param int $statusId * @param string|null $comment */ public function setStatus($statusId, $comment = null) { $this->setAttribute('status_id', $statusId); $this->_addLog(new StatusLog(['order_id' => $this->id, 'status_id' => $statusId, 'comment' => $comment])); } /** * @param ActiveRecord $log */ protected function _addLog(ActiveRecord $log) { /** @var LogAfterSaveBehavior $behavior */ $behavior = $this->getBehavior(LogAfterSaveBehavior::NAME); if (! $behavior) $behavior = $this->attachBehavior(LogAfterSaveBehavior::NAME, LogAfterSaveBehavior::class); $behavior->addLog($log); }
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-12-19