Your IP : 216.73.216.79


Current Path : /var/www/html/dosm/backend/modules/contentVideo/models/
Upload File :
Current File : /var/www/html/dosm/backend/modules/contentVideo/models/ContentVideo.php

<?php

namespace backend\modules\contentVideo\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_video".
 *
 * @property int $video_id
 * @property string|null $video_date
 * @property string|null $video_category
 * @property string|null $video_status
 * @property string|null $video_page
 * @property string|null $created_at
 * @property int|null $created_by
 * @property string|null $updated_at
 * @property int|null $updated_by
 */
class ContentVideo extends \yii\db\ActiveRecord {

    public $video_title;
    public $video_location;
    public $video_content;
    public $video_language;

    /**
     * {@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 [
            [['video_title', 'video_language', 'video_status', 'video_code', 'video_date', 'video_category'], 'required'],
            [['video_date', 'created_at', 'updated_at', 'video_tag', 'video_location', 'video_source', 'video_img', 'video_page',
            'meta_title', 'meta_descr', 'meta_keyword', 'meta_author', 'meta_img', 'publish_date_start', 'publish_time_start',
            'publish_date_end', 'publish_time_end', 'video_url', 'video_upload', 'video_external'], 'safe'],
            [['created_by', 'updated_by', 'video_sorting'], 'integer'],
            [['video_category', 'video_status'], 'string', 'max' => 255],
            [['video_code'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'video_id' => Yii::t('app', 'Video ID'),
            'video_date' => Yii::t('app', 'Video Date'),
            'video_category' => Yii::t('app', 'Type'),
            'video_sorting' => Yii::t('app', 'Sorting'),
            'video_status' => Yii::t('app', 'Status'),
            'video_page' => Yii::t('app', 'Portal Display'),
            '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'),
            'video_title' => Yii::t('app', 'Title'),
            'video_content' => Yii::t('app', 'Content'),
            'video_language' => Yii::t('app', 'Language'),
            'video_location' => Yii::t('app', 'Location'),
            'video_url' => Yii::t('app', 'Youtube Embed URL'),
            'video_source' => Yii::t('app', 'Source'),
            'video_img' => Yii::t('app', 'Video Thumbnail'),
            'video_code' => Yii::t('app', 'Page Slug'),
            'meta_title' => 'Meta Title',
            'meta_descr' => 'Meta Description',
            'meta_keyword' => 'Meta Keywords',
            'meta_author' => 'Author',
            'meta_img' => 'Image Thumbnail',
            'video_upload' => 'Upload Video',
            'video_external' => 'External Link'
        ];
    }

}