<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "price_t".
 *
 * @property integer $id
 * @property integer $order_id
 * @property integer $type_id
 * @property string $val
 * @property integer $is_nopay
 * @property string $created_at
 * @property string $updated_at
 */
class PriceT extends \common\models\Base
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'price_t';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id', 'type_id'], 'required'],
            [['order_id', 'type_id', 'is_nopay'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['val'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_id' => 'Order ID',
            'type_id' => 'Type ID',
            'val' => 'Val',
            'is_nopay' => 'Is No Pay',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    public function getOrder()
    {
        return $this->hasOne(OrderT::className(),['id'=>'order_id']);
    }

    public function getType()
    {
        return $this->hasOne(InsurerTypeT::className(),['id'=>'type_id']);
    }
}