<?php

namespace common\modules\artboxfile\models;

use Yii;
use yii\db\ActiveRecord;

class File extends ActiveRecord {

    public $fileUploadName;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['file'], 'string', 'max' => 255],
            [[$this->fileUploadName], 'safe'],
            [[$this->fileUploadName], 'file', 'extensions' => 'jpg, gif, png'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'file' => Yii::t('artbox', 'File name'),
            'fileUpload' => Yii::t('artbox', 'File'),
        ];
    }
}