| Current Path : /var/www/html/maiwp.bak/backend/models/ |
| Current File : /var/www/html/maiwp.bak/backend/models/ReleaseThemes.php |
<?php
namespace backend\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\behaviors\BlameableBehavior;
use yii\db\Expression;
use yii\db\ActiveRecord;
use asinfotrack\yii2\audittrail\behaviors\AuditTrailBehavior;
/**
* This is the model class for table "release_themes".
*
* @property int $theme_id
* @property string|null $theme_name
* @property int|null $theme_parent_id
* @property string|null $created_at
* @property string|null $created_by
* @property string|null $updated_at
* @property string|null $updated_by
*/
class ReleaseThemes extends \yii\db\ActiveRecord {
/**
* {@inheritdoc}
*/
public static function tableName() {
return 'directory_release';
}
public function behaviors() {
return [
'audittrail' => [
'class' => AuditTrailBehavior::className(),
// some of the optional configurations
'ignoredAttributes' => ['created_at', 'updated_at'],
'consoleUserId' => 1,
'attributeOutput' => [
'desktop_id' => function ($value) {
$model = Desktop::findOne($value);
return sprintf('%s %s', $model->manufacturer, $model->device_name);
},
'last_checked' => 'datetime',
],
],
];
}
/**
* {@inheritdoc}
*/
public function rules() {
return [
[['theme_parent_id'], 'integer'],
[['created_at', 'updated_at', 'created_by', 'updated_by'], 'safe'],
[['theme_name'], 'required'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels() {
return [
'theme_id' => 'Theme ID',
'theme_name' => 'Department Name',
'theme_parent_id' => 'Theme Parent ID',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
];
}
}