machour / yii2-softdelete-trait
This extension allow you to soft delete your ActiveRecord entities
Package info
github.com/machour/yii2-softdelete-trait
Type:yii2-extension
pkg:composer/machour/yii2-softdelete-trait
1.0.0
2015-11-20 09:41 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2026-02-16 05:57:37 UTC
README
This trait allow you to store any attribute change happening to an ActiveRecord
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require machour/yii2-softdelete-trait "*"
or add
"machour/yii2-softdelete-trait": "*"
to the require section of your composer.json file.
Configuration
You need to configure your model as follows:
class Article extends ActiveRecord { use \machour\yii2\behaviors\SoftDeleteTrait; static public function getDeletedAtAttribute() { return self::tableName() . '.deleted_at'; } }