Finds the Role model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param string $id
@return Role the loaded model
@throws NotFoundHttpException if the model cannot be found
345439
protected function findModel($id)
    {
        if (($model = Role::findByName($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('maddoger/user', 'The requested role does not exist.'));
        }
    }
1015915
protected function findModel($id)
    {
        if (($model = Media::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1143200
protected function findModel($id) {
    $user = User::findIdentity($id);
    if ($user === null) {
      throw new NotFoundHttpException('The requested page does not exist');
    }

    return $user;
  }
389365
protected function getPost($id)
    {
        $post = $this->postManager->find($id);

        if (null === $post) {
            throw new NotFoundHttpException(sprintf('Post (%d) not found', $id));
        }

        return $post;
    }
747803
protected function findModel($id)
    {
        /** @var Comment $model */
        $model = Address::findOne($id);
        if ($model !== null) {
            return $model;
        } else {
            throw new HttpException(404, \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_RECORD_NOT_FOUND'));
        }
    }
481410
protected function findModel($id)
    {
        $item = $this->type === Item::TYPE_ROLE ? Yii::$app->getAuthManager()->getRole($id) :
            Yii::$app->getAuthManager()->getPermission($id);
        if ($item) {
            return new AuthItem($item);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
183874
public function findModel($id)
    {
        $model = call_user_func_array([$this->MainModel, 'findOne'], [$id]);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
137992
public function findByRoleID($id)
    {
        $usersWithRepo = [];
        $users = $this->model->all();

        foreach ($users as $user) {
            if ($user->roles->first()->id == $id) {
                $usersWithRepo[] = $user;
            }
        }

        return $usersWithRepo;
    }
1351711
protected function findModel($id)
    {
        if (($model = Contact::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
962672
protected function findModel($id)
    {
        if (($model = ProductTypeMeta::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1055331
protected function findUser($id)
    {
        if (($model = User::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1240897
protected function findModel($id)
    {
        $auth = Yii::$app->getAuthManager();
        $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);
        if ($item) {
            return new AdminAuthItem($item);
        } else {
            throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.'));
        }
    }
684176
public function findOneById($id)
    {
        $persister = $this->entityManager->getEntityPersister($this->className);

        return $persister->loadOneById($id);
    }
44731
protected function findModel($id)
    {
        $item = Yii::$app->authManager->getRule($id);
        if ($item) {
            return new BizRule($item);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
1075989
public function findModel($id)
    {
        $model = $this->findModelClassObject($this->modelClass, $id, 'view');
        
        if (!$model) {
            throw new NotFoundHttpException("Unable to find the Model for the given ID");
        }
        
        return $model;
    }
1341309
public function findById($id)
    {
        if( is_null($id)) {
            throw new \Exception('ID is required');
        }

        try {
            $role = $this->getRepository('\erdiko\users\entities\Role');
            $result = $role->find($id);
        }catch (\Exception $e) {
            \error_log($e->getMessage());
        }
        return $result;
    }
1022066
public function fetchRole($id, array $options = [])
    {
        $data = [
            '_id' => $id
        ];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs('getRole'),
            $data,
            $options
        );

        return new Role($this, $response['result']['_id'], $response['result']['_source'], $response['result']['_meta']);
    }