hasOne(Store::ClassName(), ['id' => 'store_id']); } public static function setData($params) { try { $model = new self(); $model->loadDefaultValues(); if (!$model->load($params, '')) throw new \Exception($model->getErrorMessage()); if (!$model->save()) throw new Exception($model->getErrorMessage()); return true; } catch (\Exception $e) { self::setStaticError($e->getMessage()); return false; } } }