<?php

namespace common\models;

use Yii;
use artbox\core\components\imagemanager\models\ImageManager;

/**
 * This is the model class for table "partner".
 *
 * @property int $id
 * @property int $image_id
 * @property bool $status
 * @property int $sort
 * @property string $link
 */
class Partner extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'partner';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['image_id', 'sort'], 'default', 'value' => null],
            [['image_id', 'sort'], 'integer'],
            [['status'], 'boolean'],
            [['link'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'image_id' => Yii::t('app', 'Image ID'),
            'status' => Yii::t('app', 'Status'),
            'sort' => Yii::t('app', 'Sort'),
            'link' => Yii::t('app', 'Link'),
        ];
    }


    public function getImage()
    {
    	return $this->hasOne(ImageManager::className(),['id'=>'image_id']);
    }



}
