Your IP : 216.73.216.79


Current Path : /var/www/html/maiwp.bak/backend/models/
Upload File :
Current File : /var/www/html/maiwp.bak/backend/models/ContentIndicator.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 "content_photo_gallery".
 *
 */
class ContentIndicator extends \yii\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return 'indicator';
    }

    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 [
            [['image', 'image2', 'title', 'amount', 'subtitle', 'month', 'cat', 'code','sort'], 'safe'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'image' => Yii::t('app', 'Top Image'),
            'image2' => Yii::t('app', 'Bottom Image'),
            'month' => 'Month / Year Label',
            'cat' => 'Category',
            'code' => 'Source Code (PHP)',
            'sort'=>'Sort',
        ];
    }

}