Skip to content

Response Helper methods

Dominik Brader edited this page Apr 10, 2019 · 1 revision

Description

As a counterpart to all other methods in the respective Response objects, helper methods do not return a value that was returned by FINDOLOGIC. Usually they have some logic behind them that checks for existence/value of properties.

Example

As a small example we have the method getAlternativeQuery, which will return a different value based on if the didYouMeanQuery is set or not.

//  ...initialization...
//  ...setting of parameters and sending the request...

/** @var XmlResponse $xmlResponse */
echo $xmlResponse->getQuery()->getAlternativeQuery();
// If the response has a didYouMeanQuery set, this one will be the didYouMeanQuery.
// Otherwise the value of the queryString is returned.