Search
in package
Search Utilities
Utility functions related to search and search strings
Table of Contents
Methods
- searchByUsage() : mixed
- searchConstituenciesByQuery() : array<string|int, mixed>
- Search Constituencies
- searchMemberDbLookup() : mixed
- Return query result from looking for MPs
- searchMemberDbLookupWithNames() : mixed
- speakerIDsToNames() : string
- replace speaker:NNNN with speaker:Name in search string
- speakerNamesForIDs() : array<string|int, mixed>
- get list of names of speaker IDs from search string
Methods
searchByUsage()
public
static searchByUsage(mixed $search[, mixed $house = 0 ]) : mixed
Parameters
- $search : mixed
- $house : mixed = 0
searchConstituenciesByQuery()
Search Constituencies
public
static searchConstituenciesByQuery(string $searchterm) : array<string|int, mixed>
Given a search term, find constituencies by name or postcode.
Parameters
- $searchterm : string
-
The term to search for.
Return values
array<string|int, mixed> —A list of the array of constituencies, then a boolean saying whether it was a postcode used.
searchMemberDbLookup()
Return query result from looking for MPs
public
static searchMemberDbLookup(mixed $searchstring[, mixed $current_only = false ]) : mixed
Parameters
- $searchstring : mixed
- $current_only : mixed = false
searchMemberDbLookupWithNames()
public
static searchMemberDbLookupWithNames(mixed $searchstring[, mixed $current_only = false ]) : mixed
Parameters
- $searchstring : mixed
- $current_only : mixed = false
speakerIDsToNames()
replace speaker:NNNN with speaker:Name in search string
public
static speakerIDsToNames(string $searchstring) : string
Parameters
- $searchstring : string
-
The search string with the speaker:NNN text
Return values
string —The search string with replaced speaker IDs
speakerNamesForIDs()
get list of names of speaker IDs from search string
public
static speakerNamesForIDs(string $searchstring) : array<string|int, mixed>
Parameters
- $searchstring : string
-
The search string with the speaker:NNN text
Return values
array<string|int, mixed> —Array with the speaker id string as key and speaker name as value