Your IP : 216.73.216.79


Current Path : /var/www/html/dosm/backend/models/
Upload File :
Current File : /var/www/html/dosm/backend/models/ReleaseThemes1.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 ReleaseThemes1 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', 'sort'], 'integer'],
            [['created_at', 'updated_at', 'created_by', 'updated_by', 'theme_address', 'map', 'theme_email', 'theme_phone', 'theme_fax'], 'safe'],
            [['theme_name', 'sort'], 'required'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'theme_id' => 'Theme ID',
            'theme_name' => 'Themes Name',
            'theme_parent_id' => 'Theme Parent ID',
            'created_at' => 'Created At',
            'created_by' => 'Created By',
            'updated_at' => 'Updated At',
            'updated_by' => 'Updated By',
            'theme_thumbnail' => 'Icon image',
        ];
    }

}