<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "fix_car_beautify".
 *
 * @property integer $id
 * @property string $price
 * @property integer $project_id
 * @property string $created_at
 * @property string $updated_at
 *
 * @property FixCarProject $project
 */
class FixCarBeautify extends \common\models\Base
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'fix_car_beautify';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['price'], 'number'],
            [['project_id'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => FixCarProject::className(), 'targetAttribute' => ['project_id' => 'id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'price' => 'Price',
            'project_id' => 'Project ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getProject()
    {
        return $this->hasOne(FixCarProject::className(), ['id' => 'project_id']);
    }
}
