BmltClient
in package
Main BMLT client class for querying BMLT servers with built-in geocoding support.
This class provides a complete interface to BMLT (Basic Meeting List Tool) servers, allowing you to search for meetings, get server information, formats, service bodies, and perform geocoding operations.
Tags
Table of Contents
Properties
- $defaultFormat : BmltDataFormat
- $enableGeocoding : bool
- $geocodingService : GeocodingService|null
- $httpClient : Client
- $rootServerUrl : string
- $timeout : int
- $userAgent : string
Methods
- __construct() : mixed
- Create a new BMLT client instance.
- geocodeAddress() : GeocodeResult
- Geocode an address to coordinates
- getChanges() : array<string|int, mixed>
- Get changes within a date range
- getDefaultFormat() : BmltDataFormat
- getFieldValues() : array<string|int, mixed>
- Get field values
- getFormats() : array<string|int, mixed>
- Get meeting formats
- getRootServerUrl() : string
- getServerInfo() : ServerInfo
- Get server information
- getServiceBodies() : array<string|int, mixed>
- Get service bodies
- getTimeout() : int
- getUserAgent() : string
- reverseGeocode() : GeocodeResult
- Reverse geocode coordinates to an address
- searchMeetings() : array<string|int, Meeting>
- Search for meetings using the BMLT API.
- searchMeetingsByAddress() : array<string|int, mixed>
- Search for meetings by address using geocoding
- searchMeetingsByCoordinates() : array<string|int, mixed>
- Search for meetings by geographic coordinates
- setDefaultFormat() : void
- setRootServerUrl() : void
- setTimeout() : void
- setUserAgent() : void
- makeRequest() : mixed
- Make a request to the BMLT API
- parseResponse() : mixed
- Parse response based on format
Properties
$defaultFormat
private
BmltDataFormat
$defaultFormat
= BmltDataFormat::JSON
$enableGeocoding
private
bool
$enableGeocoding
= true
$geocodingService
private
GeocodingService|null
$geocodingService
= null
$httpClient
private
Client
$httpClient
$rootServerUrl
private
string
$rootServerUrl
$timeout
private
int
$timeout
= 30
$userAgent
private
string
$userAgent
= 'bmlt-php-query-client/1.0.0'
Methods
__construct()
Create a new BMLT client instance.
public
__construct(string $rootServerUrl[, BmltDataFormat $defaultFormat = BmltDataFormat::JSON ][, int $timeout = 30 ][, string $userAgent = 'bmlt-php-query-client/1.0.0' ][, bool $enableGeocoding = true ][, GeocodingService|null $geocodingService = null ]) : mixed
Parameters
- $rootServerUrl : string
-
The root server URL (e.g., 'https://bmlt.example.org/main_server')
- $defaultFormat : BmltDataFormat = BmltDataFormat::JSON
-
Default data format for API requests
- $timeout : int = 30
-
Request timeout in seconds
- $userAgent : string = 'bmlt-php-query-client/1.0.0'
-
Custom user agent string
- $enableGeocoding : bool = true
-
Whether to enable geocoding features
- $geocodingService : GeocodingService|null = null
-
Custom geocoding service instance
Tags
geocodeAddress()
Geocode an address to coordinates
public
geocodeAddress(string $address) : GeocodeResult
Parameters
- $address : string
Return values
GeocodeResultgetChanges()
Get changes within a date range
public
getChanges(string $startDate[, string|null $endDate = null ][, int|null $serviceBodyId = null ]) : array<string|int, mixed>
Parameters
- $startDate : string
- $endDate : string|null = null
- $serviceBodyId : int|null = null
Return values
array<string|int, mixed>getDefaultFormat()
public
getDefaultFormat() : BmltDataFormat
Return values
BmltDataFormatgetFieldValues()
Get field values
public
getFieldValues(string $meetingKey) : array<string|int, mixed>
Parameters
- $meetingKey : string
Return values
array<string|int, mixed>getFormats()
Get meeting formats
public
getFormats([array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>getRootServerUrl()
public
getRootServerUrl() : string
Return values
stringgetServerInfo()
Get server information
public
getServerInfo() : ServerInfo
Return values
ServerInfogetServiceBodies()
Get service bodies
public
getServiceBodies([array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>getTimeout()
public
getTimeout() : int
Return values
intgetUserAgent()
public
getUserAgent() : string
Return values
stringreverseGeocode()
Reverse geocode coordinates to an address
public
reverseGeocode(Coordinates $coordinates) : GeocodeResult
Parameters
- $coordinates : Coordinates
Return values
GeocodeResultsearchMeetings()
Search for meetings using the BMLT API.
public
searchMeetings([array<string|int, mixed> $params = [] ]) : array<string|int, Meeting>
Parameters
- $params : array<string|int, mixed> = []
-
Search parameters (e.g., weekdays, venue_types, page_size)
Tags
Return values
array<string|int, Meeting> —Array of Meeting objects
searchMeetingsByAddress()
Search for meetings by address using geocoding
public
searchMeetingsByAddress(string $address, float $radiusMiles[, float|null $radiusKm = null ][, bool $sortByDistance = true ][, array<string|int, mixed> $searchParams = [] ]) : array<string|int, mixed>
Parameters
- $address : string
- $radiusMiles : float
- $radiusKm : float|null = null
- $sortByDistance : bool = true
- $searchParams : array<string|int, mixed> = []
Return values
array<string|int, mixed>searchMeetingsByCoordinates()
Search for meetings by geographic coordinates
public
searchMeetingsByCoordinates(Coordinates $coordinates, float $radiusMiles[, float|null $radiusKm = null ][, array<string|int, mixed> $searchParams = [] ]) : array<string|int, mixed>
Parameters
- $coordinates : Coordinates
- $radiusMiles : float
- $radiusKm : float|null = null
- $searchParams : array<string|int, mixed> = []
Return values
array<string|int, mixed>setDefaultFormat()
public
setDefaultFormat(BmltDataFormat $format) : void
Parameters
- $format : BmltDataFormat
setRootServerUrl()
public
setRootServerUrl(string $url) : void
Parameters
- $url : string
setTimeout()
public
setTimeout(int $timeout) : void
Parameters
- $timeout : int
setUserAgent()
public
setUserAgent(string $userAgent) : void
Parameters
- $userAgent : string
makeRequest()
Make a request to the BMLT API
private
makeRequest(BmltEndpoint $endpoint[, array<string|int, mixed> $parameters = [] ][, BmltDataFormat|null $format = null ]) : mixed
Parameters
- $endpoint : BmltEndpoint
- $parameters : array<string|int, mixed> = []
- $format : BmltDataFormat|null = null
parseResponse()
Parse response based on format
private
parseResponse(string $responseText, BmltDataFormat $format[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $responseText : string
- $format : BmltDataFormat
- $parameters : array<string|int, mixed> = []