Your IP : 216.73.216.79


Current Path : /var/www/html/mydlvsacc/backend/models/
Upload File :
Current File : /var/www/html/mydlvsacc/backend/models/ContentVideo.php

<?php

namespace backend\models;

use Yii;
use asinfotrack\yii2\audittrail\behaviors\AuditTrailBehavior;

/**
 * This is the model class for table "content_video".
 *
 * @property int $content_video_id
 * @property string $content_video_title
 * @property string $content_video_title_en
 * @property string $content_video_description
 * @property string $content_video_description_en
 * @property int $content_video_status
 * @property string $content_created_at
 * @property string $content_created_by
 * @property string $content_updated_at
 * @property string $content_updated_by
 * @property string $content_video_featured
 */
class ContentVideo extends \common\models\Dermaga
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'content_video';
    }


    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 [
            [['content_video_title','content_video_url'], 'required'],
            [['content_video_status'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['content_video_title', 'content_video_title_en'], 'string', 'max' => 500],
            [['content_video_featured'], 'string', 'max' => 1],
            [['content_video_description', 'content_video_description_en'], 'string', 'max' => 2500],
            [['created_by', 'updated_by'], 'string', 'max' => 300],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'content_video_id' => Yii::t('app', 'ID'),
            'content_video_title' => Yii::t('app', 'Tajuk'),
            'content_video_title_en' => Yii::t('app', 'Tajuk En'),
            'content_video_description' => Yii::t('app', 'Penerangan'),
            'content_video_description_en' => Yii::t('app', 'Penerangan En'),
            'content_video_status' => Yii::t('app', 'Video Status'),
            'content_video_featured' => Yii::t('app', 'Papar Video Di Laman Hadapan'),
            'created_at' => Yii::t('app', 'Created At'),
            'created_by' => Yii::t('app', 'Created By'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'updated_by' => Yii::t('app', 'Updated By'),
        ];
    }
}