public function add_users(array $userids) : userlist {
        global $DB;

        if (!empty($userids)) {
            list($useridsql, $useridparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
            $sql = "SELECT DISTINCT u.id
                      FROM {user} u
                     WHERE u.id {$useridsql}";
            $this->add_from_sql('id', $sql, $useridparams);
        }
        return $this;
    }
public function add_users(array $userids) : userlist {
        global $DB;

        if (!empty($userids)) {
            list($useridsql, $useridparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
            $sql = "SELECT DISTINCT u.id
                      FROM {user} u
                     WHERE u.id {$useridsql}";
            $this->add_from_sql('id', $sql, $useridparams);
        }
        return $this;
    }
public function add_users ( array $ userids ) : userlist { global $ DB ; if ( ! empty ( $ userids ) ) { list ( $ useridsql , $ useridparams ) = $ DB -> get_in_or_equal ( $ userids , SQL_PARAMS_NAMED ) ; $ sql = "SELECT DISTINCT u.id
                      FROM {user} u
                     WHERE u.id {$useridsql}" ; $ this -> add_from_sql ( 'id' , $ sql , $ useridparams ) ; } return $ this ; }
Adds the user users for given users.

@param   int[]   $userids
@return  $this
Adds the user users for given users .