public function get_samples($sampleids) {
        global $DB;

        list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
        $users = $DB->get_records_select('user', "id $sql", $params);

        $userids = array_keys($users);
        $sampleids = array_combine($userids, $userids);

        $users = array_map(function($user) {
            return ['user' => $user, 'context' => \context_user::instance($user->id)];
        }, $users);

        // No related data attached.
        return [$sampleids, $users];
    }
public function get_samples($sampleids) {
        global $DB;

        list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
        $users = $DB->get_records_select('user', "id $sql", $params);

        $userids = array_keys($users);
        $sampleids = array_combine($userids, $userids);

        $users = array_map(function($user) {
            return ['user' => $user, 'context' => \context_user::instance($user->id)];
        }, $users);

        // No related data attached.
        return [$sampleids, $users];
    }
public function get_samples ( $ sampleids ) { global $ DB ; list ( $ sql , $ params ) = $ DB -> get_in_or_equal ( $ sampleids , SQL_PARAMS_NAMED ) ; $ users = $ DB -> get_records_select ( 'user' , "id $sql" , $ params ) ; $ userids = array_keys ( $ users ) ; $ sampleids = array_combine ( $ userids , $ userids ) ; $ users = array_map ( function ( $ user ) { return [ 'user' => $ user , 'context' => \ context_user :: instance ( $ user -> id ) ] ; } , $ users ) ; // No related data attached. return [ $ sampleids , $ users ] ; }
Returns samples data from sample ids.

@param int[] $sampleids
@return array
Returns samples data from sample ids .