@param int $id
@param int $page

@return array|Model\Club\UserProfile[]
@throws Exception\BadResponseException
@throws ParserException
195141
public function ClubUsers(int $id, int $page = 1): array
    {
        return $this->myanimelist->getClubUsers(
            new Request\Club\UserListRequest($id, $page)
        );
    }
1086093
public function exportById($id): array
    {
        $user = Craft::$app->users->getUserById($id);
        return $this->export($user);
    }
1262702
private function findUser($id)
    {
        if (is_array($id)) {
            /** @var User $user */
            $model = User::findIdentities($id);
        } else {
            /** @var User $user */
            $model = User::findIdentity($id);
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('User not found');
        }
    }
1014621
protected function findModel($id)
    {
        $class = $this->userClassName;
        if (($user = $class::findIdentity($id)) !== null) {
            return new Assignment($id, $user);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
535253
public function getLogsByUserId($id, $page = 0, $pagesize = 100, $sort = 'id', $direction = 'asc')
    {
        if(is_null($id)) {
            throw new \Exception('User ID is required.');
        }

        $result = (Object)array(
            "logs" =>  array(),
            "total" => 0
        );

        $repo = $this->getRepository('\erdiko\users\entities\user\event\Log');

        $offset = 0;
        if ($page > 0) {
            $offset = ($page - 1) * $pagesize;
        }

        $result->logs = $repo->findBy(
            array("user_id" => $id),
            array(
                $sort => $direction
            ),
            $pagesize,
            $offset
        );

        // get total log count
        $result->total = (int)$repo->createQueryBuilder('u')
            ->select('count(u.id)')
            ->where('u.user_id = :user_id')
            ->setParameter("user_id", $id)
            ->getQuery()
            ->getSingleScalarResult();

        return $result;
    }
494140
public function refreshUsers($page = 1) {
		$query = WechatUser::find()->where(['appid' => $this->app->appid])->select('openid');

		$pageSize = 100;
		$pagination = new Pagination([
			'totalCount' => $query->count(),
			'defaultPageSize' => $pageSize,
			'pageSizeLimit' => [0, $pageSize],
		]);
		$pagination->setPage($page - 1, true);

		$users = $query->offset($pagination->offset)
			->limit($pagination->limit)
			->asArray()
			->all();

		$user_list = [];
		foreach($users as $user) {
			$user['lang'] = \Yii::$app->language;
			$user_list['user_list'][] = $user;
		}

		if($user_list) {
			$data = $this->getData('/cgi-bin/user/info/batchget', [
				'access_token' => $this->getAccessToken(),
			], Json::encode($user_list));
			if(isset($data['user_info_list'])) {
				foreach($data['user_info_list'] as $_user) {
					$user = WechatUser::findOne(['appid' => $this->app->appid, 'openid' => $_user['openid']]);
					if(!$user) {
						$user = new WechatUser;
						$user->appid = $this->app->appid;
						$user->openid = $_user['openid'];
					}
					$user->subscribe = $_user['subscribe'];
					if($user->subscribe == 1) {
						$user->subscribed_at = $_user['subscribed_at'];
						$user->name = $_user['nickname'];
						$user->sex = $_user['sex'];
						$user->country = $_user['country'];
						$user->city = $_user['city'];
						$user->province = $_user['province'];
						$user->language = $_user['language'];
						$user->headimgurl = $_user['headimgurl'];
						$user->remark = $_user['remark'];
						$user->groupid = $_user['groupid'];
					}
					if(isset($_user['unionid'])) {
						$user->unionid = $_user['unionid'];
					}
					$user->save();
				}
			}
		}

		return $page < $pagination->pageCount ? $this->refreshUsers($page + 1) : $this->errcode == 0;
	}
126556
public function actionDelete($id, $page = 1)
    {
        $model = $this->findModel($id);
/* moved to model:
        $subdir = $this->module->model('News')->getImageSubdir($model->id);
        $fullDir = $this->uploadsNewsDir . '/' . $subdir;//var_dump($fullDir);exit;
        if (is_dir($fullDir)) {
            @FileHelper::removeDirectory($fullDir);
        }
*/
        $model->delete(); // images and i18n-deletions also in main model

        Yii::$app->session->setFlash('success', Yii::t($this->tcModule, 'Record with ID={id} delete success', ['id' => $id]));

        $searchFormName = basename(NewsSearch::className());
        $paramSort = Yii::$app->request->get($searchFormName, []);
        foreach ($paramSort as $key => $val) {
            if (empty($val)) unset($paramSort[$key]);
        }
        return $this->redirect(['index',
            'page' => $page,
            $searchFormName => $paramSort,
            'sort' => $model->orderBy,
        ]);
    }
807155
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_USERS, User::class);

        return $this->getPaginator($dql, $limit, $page);
    }
135614
function fetchMemberOf( $id )
    {
        $user = eZUser::fetch( $id );
        if ( $user instanceof eZUser )
            $roleList = $user->roles();
        else // user group or other non user classes:
            $roleList = eZRole::fetchByUser( array( $id ), true );

        return array( 'result' => $roleList );
    }
866650
public function getPage($id)
    {
        $found_page = null;

        foreach ($this->pages as $page) {
            if ($page->id == $id) {
                $found_page = $page;
                break;
            }
        }

        return $found_page;
    }
979877
public function getEpisodes(int $id, int $page = 1): PaginatedResults
    {
        /* @var TheTVDbAPILanguageFallback $parent */
        $parent  = $this->parent;
        $closure = $this->getClosureForEpisodes($id, ['query' => ['page' => $page]]);

        return new PaginatedResults(
            $parent->getGenerator()->create($closure, BasicEpisode::class, $this->parent->getAcceptedLanguages(), true),
            $this->parent->getLastLinks()
        );
    }
1143200
protected function findModel($id) {
    $user = User::findIdentity($id);
    if ($user === null) {
      throw new NotFoundHttpException('The requested page does not exist');
    }

    return $user;
  }
700306
public function deletePage($page_id)
    {
        try {
            return json_decode($this->getClient()->delete('content/' . $page_id)->getBody(), true);
        } catch (BadResponseException $e) {
            throw $this->handleError($e);
        }
    }
372580
public function getAll($service, $page = 1, $perPage = 25)
    {
        $params = array(
            'page' => $page,
            'per_page' => $perPage
        );

        return $this->_user->get('account/identity/limit/' . $service, $params);
    }
975818
protected function findModel(int $id)
    {
        $class = $this->userIdentityClass;

        if (($user = $class::findIdentity($id)) !== null) {
            return new AssignmentModel($user);
        }

        throw new NotFoundHttpException(Yii::t('yii2mod.rbac', 'The requested page does not exist.'));
    }
1277944
public function TopPeople(int $page = 1): array
    {
        return $this->myanimelist->getTopPeople(
            new Request\Top\TopPeopleRequest($page)
        );
    }
668760
public function actionChangeVisible($id, $page = 1)
    {
        $model = $this->findModel($id);
        $model->is_visible = $model->is_visible ? false: true;
        $model->orderBy = $model::$defaultOrderBy;
        $model->save(false, ['is_visible']);

        $model->page = $model->calcPage($model::find()->where(['parent_id' => $model->parent_id]));

        return $this->redirect(['index',
            'parent' => $model->parent_id,
            'page'   => $model->page,
            'id'     => $id,
            'sort'   => $model->orderByToSort(),
        ]);
    }