<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "providers".
 *
 * @property integer $id
 * @property string $name
 * @property string $details
 * @property string $image
 */
class Providers extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'providers';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'details', 'image'], 'required'],
            [['details'], 'string'],
			[['image'], 'file', 'extensions'=>'jpg, gif, png'],
			[['image'],  'safe'],
            [['name', 'image'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'details' => 'Details',
            'image' => 'Image',
        ];
    }
}
