Skip to content

Latest commit

 

History

History
executable file
·
38 lines (28 loc) · 692 Bytes

README.md

File metadata and controls

executable file
·
38 lines (28 loc) · 692 Bytes

Soft delete behavior for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist vyants/yii2-softdelete "*"

or add

"vyants/yii2-softdelete": "*"

to the require section of your composer.json file.

Usage

public function behaviors() {
     return [
         'softDelete' => ['class' => 'vyants\softdelete\SoftDelete',
             'statusAttribute' => 'status',
             'timeAttribute' => false,
             'deletedValue' => -1,
             'activeValue' => 1,
         ],
     ];
}