255], [['company_id'], 'exist', 'skipOnError' => true, 'targetClass' => Company::class, 'targetAttribute' => ['company_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'address' => 'Адрес', 'company_id' => 'Компания', 'name' => 'Название', ]; } /** * Gets query for [[Checks]]. * * @return \yii\db\ActiveQuery */ public function getChecks() { return $this->hasMany(Check::class, ['addresses_id' => 'id']); } /** * Gets query for [[Company]]. * * @return \yii\db\ActiveQuery */ public function getCompany() { return $this->hasOne(Company::class, ['id' => 'company_id']); } }