PHP code example of machour / yii2-softdelete-trait
1. Go to this page and download the library: Download machour/yii2-softdelete-trait library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
machour / yii2-softdelete-trait example snippets
class Article extends ActiveRecord
{
use \machour\yii2\behaviors\SoftDeleteTrait;
static public function getDeletedAtAttribute()
{
return self::tableName() . '.deleted_at';
}
}