Commit bdd16379 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен валидатор файлов

parent cd69015a
...@@ -16,6 +16,7 @@ use Yii; ...@@ -16,6 +16,7 @@ use Yii;
*/ */
class AnalyticsSchoolLessonFile extends \yii\db\ActiveRecord class AnalyticsSchoolLessonFile extends \yii\db\ActiveRecord
{ {
public $document;
/** /**
* @inheritdoc * @inheritdoc
*/ */
...@@ -34,6 +35,7 @@ class AnalyticsSchoolLessonFile extends \yii\db\ActiveRecord ...@@ -34,6 +35,7 @@ class AnalyticsSchoolLessonFile extends \yii\db\ActiveRecord
[['lesson_id'], 'integer'], [['lesson_id'], 'integer'],
[['file'], 'string'], [['file'], 'string'],
[['title'], 'string', 'max' => 255], [['title'], 'string', 'max' => 255],
[['document'], 'file', 'extensions' => 'PDF, RAR, ZIP, DOC. XLS, PPT'],
[['lesson_id'], 'exist', 'skipOnError' => true, 'targetClass' => AnalyticsSchoolLesson::className(), 'targetAttribute' => ['lesson_id' => 'id']], [['lesson_id'], 'exist', 'skipOnError' => true, 'targetClass' => AnalyticsSchoolLesson::className(), 'targetAttribute' => ['lesson_id' => '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