/** * @return \yii\db\ActiveQuery */ public function getRegister() { return $this->hasOne(Register::className(), ['uid' => 'id']); }
protected function findModel($id) { if (($model = Register::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }