Your IP : 216.73.216.79


Current Path : /var/www/html/learn/backend/modules/learning/models/
Upload File :
Current File : /var/www/html/learn/backend/modules/learning/models/LearningChapter.php

<?php

namespace backend\modules\learning\models;

use Yii;

/**
 * This is the model class for table "learning_chapter".
 *
 * @property int $chapter_id
 * @property int|null $main_id
 * @property string|null $chapter_title
 * @property string|null $chapter_type
 * @property string|null $chapter_content
 * @property int|null $chapter_sort
 * @property string|null $chapter_status
 * @property string|null $created_at
 * @property string|null $created_by
 * @property string|null $created_user_type
 * @property string|null $updated_at
 * @property string|null $updated_by
 * @property string|null $updated_user_type
 */
class LearningChapter extends \yii\db\ActiveRecord {

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

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['main_id', 'chapter_sort'], 'integer'],
            [['chapter_content'], 'string'],
            [['chapter_info', 'created_at', 'updated_at', 'chapter_title', 'chapter_type', 'chapter_status', 'created_by',
            'created_user_type', 'updated_by', 'updated_user_type', 'chapter_video_type', 'chapter_video_embed'], 'safe'],
            [['chapter_title', 'chapter_status', 'chapter_time'], 'required', 'message' => Yii::t('app', '{attribute} cannot be blank')],
            [['chapter_content'], 'required', 'on' => 'create', 'message' => Yii::t('app', '{attribute} cannot be blank')],
            [['chapter_video_type'], 'required', 'on' => 'createvideo', 'message' => Yii::t('app', '{attribute} cannot be blank')],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'chapter_id' => Yii::t('app', 'Chapter ID'),
            'main_id' => Yii::t('app', 'Main ID'),
            'chapter_title' => Yii::t('app', 'Chapter Title'),
            'chapter_type' => Yii::t('app', 'Chapter Type'),
            'chapter_content' => Yii::t('app', 'Chapter Content'),
            'chapter_sort' => Yii::t('app', 'Chapter Sort'),
            'chapter_status' => Yii::t('app', 'Chapter Status'),
            'created_at' => Yii::t('app', 'Created At'),
            'created_by' => Yii::t('app', 'Created By'),
            'created_user_type' => Yii::t('app', 'Created User Type'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'updated_user_type' => Yii::t('app', 'Updated User Type'),
            'chapter_time' => Yii::t('app', 'Learning Time (Minutes)'),
            'chapter_info' => Yii::t('app', 'Additional Information'),
            'chapter_video_type' => Yii::t('app', 'Video Type'),
            'chapter_video_embed' => Yii::t('app', 'Youtube URL'),
        ];
    }

}