public static function get_contact_requests_between_users(int $userid, int $requesteduserid) : array {
        global $DB;

        $sql = "SELECT *
                  FROM {message_contact_requests} mcr
                 WHERE (mcr.userid = ? AND mcr.requesteduserid = ?)
                    OR (mcr.userid = ? AND mcr.requesteduserid = ?)";
        return $DB->get_records_sql($sql, [$userid, $requesteduserid, $requesteduserid, $userid]);
    }
public static function get_contact_requests_between_users(int $userid, int $requesteduserid) : array {
        global $DB;

        $sql = "SELECT *
                  FROM {message_contact_requests} mcr
                 WHERE (mcr.userid = ? AND mcr.requesteduserid = ?)
                    OR (mcr.userid = ? AND mcr.requesteduserid = ?)";
        return $DB->get_records_sql($sql, [$userid, $requesteduserid, $requesteduserid, $userid]);
    }
public static function get_contact_requests_between_users ( int $ userid , int $ requesteduserid ) : array { global $ DB ; $ sql = "SELECT *
                  FROM {message_contact_requests} mcr
                 WHERE (mcr.userid = ? AND mcr.requesteduserid = ?)
                    OR (mcr.userid = ? AND mcr.requesteduserid = ?)" ; return $ DB -> get_records_sql ( $ sql , [ $ userid , $ requesteduserid , $ requesteduserid , $ userid ] ) ; }
Get contact requests between users.

@param int $userid The id of the user who is creating the contact request
@param int $requesteduserid The id of the user being requested
@return \stdClass[]
Get contact requests between users .