<?php namespace app\models; use Yii; /** * This is the model class for table "{{%plant}}". * * @property int $id * @property string $title * @property string $description * @property double $height * @property int $bush_type * @property int $flower_form * @property int $flower_tint * @property string $created_at * @property int $cost * @property int $top * @property int $active * @property string $edit_at */ class Plant extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return '{{%plant}}'; } /** * {@inheritdoc} */ public function rules() { return [ [['title'], 'required'], [['description'], 'string'], [['height'], 'number'], [['bush_type', 'flower_form', 'flower_tint', 'cost'], 'integer'], [['created_at', 'edit_at'], 'datetime'], [['top', 'active'], 'integer', 'max' => 1], [['title'], 'string', 'max' => 256], [['title'], 'unique'], [['title', 'description', 'height', 'bush_type', 'flower_form', 'flower_tint', 'cost', 'top', 'active'], 'safe'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'title' => 'Название', 'description' => 'Описание', 'height' => 'Высота куста', 'bush_type' => 'Тип куста', 'flower_form' => 'Форма цветка', 'flower_tint' => 'Оттенок цветка', 'created_at' => 'Дата создания', 'cost' => 'Цена', 'top' => 'показать в топ', 'active' => 'Показывать', 'edit_at' => 'Дата редактирования', ]; } }