CompanyInfo.php 1.73 KB
<?php

    namespace common\models;

    use Yii;

    /**
     * This is the model class for table "company_info".
     * @property integer $company_info_id
     * @property string  $name
     * @property integer $staff
     * @property string  $street
     * @property string  $house
     */
    class CompanyInfo extends \yii\db\ActiveRecord
    {

        /**
         * @inheritdoc
         */
        public static function tableName()
        {
            return 'company_info';
        }

        /**
         * @inheritdoc
         */
        public function rules()
        {
            return [
                [
                    [
                        'name',
                    ],
                    'required',
                ],
                [
                    [
                        'name',
                        'street',
                        'house',
                    ],
                    'string',
                ],
                [
                    [ 'staff' ],
                    'default',
                    'value' => 1,
                ],
                [
                    [ 'staff' ],
                    'integer',
                    'min' => 1,
                    'max' => 100000
                ],
            ];
        }

        /**
         * @inheritdoc
         */
        public function attributeLabels()
        {
            return [
                'company_info_id' => Yii::t('app', 'company_info_id'),
                'name'            => Yii::t('app', 'name_company'),
                'staff'           => Yii::t('app', 'staff'),
                'street'          => Yii::t('app', 'street'),
                'house'           => Yii::t('app', 'house'),
            ];
        }
    }