protected function findModel(string $id): AuthItemModel
    {
        $auth = Yii::$app->getAuthManager();
        $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);

        if (empty($item)) {
            throw new NotFoundHttpException(Yii::t('yii2mod.rbac', 'The requested page does not exist.'));
        }

        return new AuthItemModel($item);
    }
protected function findModel(string $id): AuthItemModel
    {
        $auth = Yii::$app->getAuthManager();
        $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);

        if (empty($item)) {
            throw new NotFoundHttpException(Yii::t('yii2mod.rbac', 'The requested page does not exist.'));
        }

        return new AuthItemModel($item);
    }
protected function findModel ( string $ id ) : AuthItemModel { $ auth = Yii :: $ app -> getAuthManager ( ) ; $ item = $ this -> type === Item :: TYPE_ROLE ? $ auth -> getRole ( $ id ) : $ auth -> getPermission ( $ id ) ; if ( empty ( $ item ) ) { throw new NotFoundHttpException ( Yii :: t ( 'yii2mod.rbac' , 'The requested page does not exist.' ) ) ; } return new AuthItemModel ( $ item ) ; }
Finds the AuthItem model based on its primary key value.

If the model is not found, a 404 HTTP exception will be thrown.

@param string $id

@return AuthItemModel the loaded model

@throws NotFoundHttpException if the model cannot be found
Finds the AuthItem model based on its primary key value .