/** * @return array|bool|null|CmsTree|\yii\db\ActiveRecord */ public function getModel() { if ($this->_model !== false) { return $this->_model; } if (!($id = \Yii::$app->request->get('id'))) { $this->_model = null; return false; } $this->_model = CmsTree::find()->where(['id' => $id])->one(); return $this->_model; }