Hotel.php 1.12 KB
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%hotel}}".
 *
 * @property integer $id
 * @property string $photo
 * @property string $name
 * @property string $address
 * @property string $price
 * @property string $distance
 * @property integer $rating
 * @property integer $spot_id
 */
class Hotel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%hotel}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['rating', 'spot_id'], 'integer'],
            [['spot_id'], 'required'],
            [['photo', 'name', 'address', 'price', 'distance'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'photo' => 'Photo',
            'name' => 'Name',
            'address' => 'Address',
            'price' => 'Price',
            'distance' => 'Distance',
            'rating' => 'Rating',
            'spot_id' => 'Spot ID',
        ];
    }
}