Returns information about the next user
@return mixed array of user info, all grades and feedback or null when no more users found
165449
public function next_user() {
        if (!$this->users_rs) {
            return false; // no users present
        }

        if (!$this->users_rs->valid()) {
            if ($current = $this->_pop()) {
                // this is not good - user or grades updated between the two reads above :-(
            }

            return false; // no more users
        } else {
            $user = $this->users_rs->current();
            $this->users_rs->next();
        }

        // find grades of this user
        $grade_records = array();
        while (true) {
            if (!$current = $this->_pop()) {
                break; // no more grades
            }

            if (empty($current->userid)) {
                break;
            }

            if ($current->userid != $user->id) {
                // grade of the next user, we have all for this user
                $this->_push($current);
                break;
            }

            $grade_records[$current->itemid] = $current;
        }

        $grades = array();
        $feedbacks = array();

        if (!empty($this->grade_items)) {
            foreach ($this->grade_items as $grade_item) {
                if (!isset($feedbacks[$grade_item->id])) {
                    $feedbacks[$grade_item->id] = new stdClass();
                }
                if (array_key_exists($grade_item->id, $grade_records)) {
                    $feedbacks[$grade_item->id]->feedback       = $grade_records[$grade_item->id]->feedback;
                    $feedbacks[$grade_item->id]->feedbackformat = $grade_records[$grade_item->id]->feedbackformat;
                    unset($grade_records[$grade_item->id]->feedback);
                    unset($grade_records[$grade_item->id]->feedbackformat);
                    $grades[$grade_item->id] = new grade_grade($grade_records[$grade_item->id], false);
                } else {
                    $feedbacks[$grade_item->id]->feedback       = '';
                    $feedbacks[$grade_item->id]->feedbackformat = FORMAT_MOODLE;
                    $grades[$grade_item->id] =
                        new grade_grade(array('userid'=>$user->id, 'itemid'=>$grade_item->id), false);
                }
                $grades[$grade_item->id]->grade_item = $grade_item;
            }
        }

        // Set user suspended status.
        $user->suspendedenrolment = isset($this->suspendedusers[$user->id]);
        $result = new stdClass();
        $result->user      = $user;
        $result->grades    = $grades;
        $result->feedbacks = $feedbacks;
        return $result;
    }
1113726
public function getNext() {
		$nextPrompt = array();
		$prompts = $this->getPrompts();

		foreach ( $prompts as $prompt ) {
			$isDismissed      = isset( $prompt['time_dismissed'] );
			$isOlder          = empty( $nextPrompt ) || ( ! $isDismissed && $prompt['time_added'] < $nextPrompt['time_added'] );
			$isStillSnoozing  = ! empty( $prompt['time_snoozed_until'] ) && $prompt['time_snoozed_until'] > time();

			if ( ! $isDismissed && $isOlder && ! $isStillSnoozing ) {
				$nextPrompt = $prompt;
			}
		}

		if ( ! $this->isMinInterval() ) {
			$nextPrompt = array();
		}

		return $nextPrompt;
	}
956895
public function getNextUnansweredToken()
    {
        $tokenSelect = $this->tracker->getTokenSelect();
        $tokenSelect
                ->andReceptionCodes()
                // ->andRespondents()
                // ->andRespondentOrganizations()
                // ->andConsents
                ->andRounds(array())
                ->andSurveys(array())
                ->forRespondent($this->getRespondentId())
                ->forGroupId($this->getSurvey()->getGroupId())
                ->onlySucces()
                ->onlyValid()
                ->forWhere('gsu_active = 1')
                ->forWhere('gro_active = 1 OR gro_active IS NULL')
                ->order(array('gto_valid_from', 'gto_round_order'));

        $this->_addRelation($tokenSelect);

        if ($tokenData = $tokenSelect->fetchRow()) {
            return $this->tracker->getToken($tokenData);
        }
    }
956180
public function getUserSelectedSorting()
    {
        $sortDirections = ['desc', 'asc'];

        $request = Registry::get(\OxidEsales\Eshop\Core\Request::class);
        $sortBy = $request->getRequestParameter($this->getSortOrderByParameterName());
        $sortOrder = $request->getRequestParameter($this->getSortOrderParameterName());

        if ($sortBy &&
            $sortOrder &&
            Registry::getUtils()->isValidAlpha($sortOrder) &&
            in_array(Str::getStr()->strtolower($sortOrder), $sortDirections) &&
            in_array($sortBy, $this->getSortColumns())
        ) {
            return ['sortby' => $sortBy, 'sortdir' => $sortOrder];
        }
    }
386547
protected function getListUser()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->user->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('store')) {
            return $this->user->getList(array('store_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('role')) {
            return $this->user->getList(array('role_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->user->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
218906
protected function getUsers(): array
    {
        return $this->repository->sudo(function (Repository $repository) {
            $query = new LocationQuery();
            $query->filter = new ContentTypeIdentifier('user');
            $query->offset = 0;
            $query->limit = 10;
            $query->performCount = true;
            $query->sortClauses[] = new SortClause\ContentName();

            $users = [];
            do {
                $results = $repository->getSearchService()->findContent($query);
                foreach ($results->searchHits as $hit) {
                    $users[] = $repository->sudo(function (Repository $repository) use ($hit) {
                        return $repository->getUserService()->loadUser($hit->valueObject->id);
                    });
                }

                $query->offset += $query->limit;
            } while ($query->offset < $results->totalCount);

            return $users;
        });
    }
228869
protected function askForUsers()
    {
        $default = 0;
        $users = $this->users();
        $user_names = array_merge(
            ['Skip'],
            collect($users)->pluck('name')->toArray()
        );

        $selected_user_names =  $this->choice('Users?', $user_names ,$default, null, true);

        if ($selected_user_names == 0) return null;
        $users = collect($users)->filter(function ($user) use ($selected_user_names) {
            return in_array($user->name,$selected_user_names);
        });

        return $users->pluck('id');
    }
705092
public function getUsersList() {
        $response=CodeBank_ClientAPI::responseBase();
        
        $members=Permission::get_members_by_permission(array('ADMIN', 'CODE_BANK_ACCESS'));
        foreach($members as $member) {
            $response['data'][]=array(
                                    'id'=>$member->ID,
                                    'username'=>$member->Email,
                                    'lastLogin'=>$member->LastVisited
                                );
        }
        
        
        return $response;
    }
331908
private function getAllInfo()
    {
        $data = [];
        $recommendation_area = $this->_parser->find('.borderClass table');
        foreach ($recommendation_area as $each_recom) {
            $tmp = [];

            $content_area = $each_recom->find('td', 1);
            $other_area = $each_recom->find('div[id^=simaid]', 0);

            $tmp['id'] = $this->getRecomId($content_area);
            $tmp['title'] = $this->getRecomTitle($content_area);
            $tmp['image'] = $this->getRecomImage($each_recom);
            $tmp['username'] = $this->getRecomUsername($content_area);
            $tmp['recommendation'] = $this->getRecomText($content_area);
            $tmp['other'] = $this->getRecomOther($other_area);

            $data[] = $tmp;
        }

        return $data;
    }
487939
private function getAllInfo()
    {
        $data = [];
        foreach ($this->_parser->find('.borderClass') as $user) {
            if ($user->align != 'center') {
                continue;
            }

            $temp_user = [];

            $temp_user['name'] = $this->getName($user);
            $temp_user['image'] = $this->getImage($user);
            $temp_user['last_online'] = $this->getLastOnline($user);

            $data[] = $temp_user;
        }

        return $data;
    }
206204
public function get_profile_fields() {
        global $DB;
        if (!$fields = $DB->get_records('user_info_field', null, 'shortname', 'id,shortname')) {
            return null;
        }
        $res = array(0 => get_string('anyfield', 'filters'));
        foreach ($fields as $k => $v) {
            $res[$k] = $v->shortname;
        }
        return $res;
    }
604121
public function getUserInfo(): array
    {
        $data = [
            'isMobile' => 'false',
            'includeKalsysInfos' => 'false',
            'token' => $this->token,
        ];
        $response = $this->doGet('/np/users/me', $data);
        $userInfo = json_decode($response, true);

        return $userInfo;
    }
248866
public static function getCurrentUser()
    {
        if (static::$currentUser instanceof AVUser)
        {
            return static::$currentUser;
        }
        $storage = AVClient::getStorage();
        $userData = $storage->get("user");
        if ($userData instanceof AVUser)
        {
            static::$currentUser = $userData;

            return $userData;
        }
        if (isset($userData["id"]) && isset($userData["_sessionToken"]))
        {
            $user = AVUser::create("_User", $userData["id"]);
            unset($userData["id"]);
            $user->_sessionToken = $userData["_sessionToken"];
            unset($userData["_sessionToken"]);
            foreach ($userData as $key => $value)
            {
                $user->set($key, $value);
            }
            $user->_opSetQueue = array();
            static::$currentUser = $user;

            return $user;
        }

        return null;
    }
863010
protected function load_users() {
        global $CFG;

        // Create a graded_users_iterator because it will properly check the groups etc.
        $defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
        $showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);
        $showonlyactiveenrol = $showonlyactiveenrol || !has_capability('moodle/course:viewsuspendedusers', $this->context);

        require_once($CFG->dirroot.'/grade/lib.php');
        $gui = new \graded_users_iterator($this->course, null, $this->groupid);
        $gui->require_active_enrolment($showonlyactiveenrol);
        $gui->init();

        // Flatten the users.
        $users = array();
        while ($user = $gui->next_user()) {
            $users[$user->user->id] = $user->user;
        }
        $gui->close();
        return $users;
    }
272037
public function lastReply()
    {
        try {
            $replies = ForumReply::where('post_id', $this->id)->get();

            if ($replies->isEmpty()) {
                return null;
            }

            $reply = $replies->last();

            return [
                'author' => $reply->author->name,
                'date' => $reply->created_at
            ];
        } catch (Exception $e) {
            return null;
        }
    }
295381
protected function getUsers() {
        if (!$this->_users) {
            $this->_users = new UserList($this->version, $this->solution['sid']);
        }

        return $this->_users;
    }
409259
public function getPersonalData(): array
    {
        $photo = $this->input('photo_id');

        if (is_array($photo) && !$photo) {
            $photo = null;
        }

        return [
            'first_name' => $this->input('first_name'),
            'last_name' => $this->input('last_name'),
            'photo_id' => $photo,
            'description' => $this->input('description'),
            'phone' => $this->input('phone'),
            'address' => $this->input('address'),
            'notification_email' => $this->input('notification_email'),
        ];
    }