Commit 54fa0a47 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлена модель таблицы с файлами для уроков

parent 2a1ed332
<?php
namespace common\modules\analyticsSchool\models;
use Yii;
/**
* This is the model class for table "analytics_school_lesson_file".
*
* @property integer $id
* @property integer $lesson_id
* @property string $title
* @property string $file
*
* @property AnalyticsSchoolLesson $lesson
*/
class AnalyticsSchoolLessonFile extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'analytics_school_lesson_file';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['lesson_id', 'title', 'file'], 'required'],
[['lesson_id'], 'integer'],
[['file'], 'string'],
[['title'], 'string', 'max' => 255],
[['lesson_id'], 'exist', 'skipOnError' => true, 'targetClass' => AnalyticsSchoolLesson::className(), 'targetAttribute' => ['lesson_id' => 'id']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'lesson_id' => 'Lesson ID',
'title' => 'Title',
'file' => 'File',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLesson()
{
return $this->hasOne(AnalyticsSchoolLesson::className(), ['id' => 'lesson_id']);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment