WormsAdapter
class WormsAdapter implementsLabelSourceAdapterContract
WoRMS label source adapter.
Constants
MAX_RESULTS |
WoRMS limits their results to a maximum of 50. We use a loop to get more results for each "find" request. This is the number of maximum results that the loop will return to prevent too many requests. |
Properties
protectedSoapClient | $client | SOAP client for the WoRMS webservice. |
Methods
Set the SOAP client instance to use for requests.
Get the SOAP client instance to use for requests.
Find labels by scientific name.
Create the label (or labels) from the label source based on an API request.
Returns true
for accepted WoRMS items and false
otherwise.
Parse a WoRMS item to the internal representation.
Create (and save) a single label.
Create (and save) a label and all WoRMS parents that don't already exist in the tree.
Extract the aphia IDs in correct ordering from a WoRMS classification hierarchy.
Details
at line39
setSoapClient(SoapClient$client)
Set the SOAP client instance to use for requests.
at line49
SoapClient
getSoapClient()
Get the SOAP client instance to use for requests.
at line68
array
find(Request$request)
Find labels by scientific name.
Uses the getAphiaRecords
function of the WoRMS web service.
see: http://www.marinespecies.org/aphia.php?p=soap
at line129
array
create(int$id,Request$request)
Create the label (or labels) from the label source based on an API request.
Required request parameters:
string name Name of the new label
string color Color of the new label (like bada55
)
int source_id AphiaID of the new label in WoRMS
int label_source_id ID of the WoRMS LabelSource
Optional request parameters:
bool recursive Specifies if all parent labels should be fetched and inserted, too. int parent_id ID of the parent label. Must not be present if recursive is present.
at line169
privatebool
filterUnaccepted(object$item)
Returns true
for accepted WoRMS items and false
otherwise.
at line180
privatearray
parseItem(object$item)
Parse a WoRMS item to the internal representation.
at line211
privatearray
createSingleLabel(array$attributes)
Create (and save) a single label.
at line233
privatearray
createRecursiveLabels(array$attributes)
Create (and save) a label and all WoRMS parents that don't already exist in the tree.
at line291
privatearray
extractParents(object$hierarchy)
Extract the aphia IDs in correct ordering from a WoRMS classification hierarchy.