Skip to content

Commit

Permalink
Add language
Browse files Browse the repository at this point in the history
  • Loading branch information
adcuz committed Nov 2, 2015
1 parent 4299157 commit 7999dfe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ function SetSecret($consumerSecret) {
$this->_consumerSecret = $consumerSecret;
}

function SearchFood($query, $region = false) {
function SearchFood($query, $region = false, $language = false) {

$url = Client::$base . 'method=foods.search';

$url = $url . '&search_expression=' . urlencode($query);

if ($region !== false) {
$url = $url . '&region=' . urlencode($region);
}

if ($language !== false) {
$url = $url . '&language=' . urlencode($language);
}

$oauth = new OAuthBase();

Expand All @@ -55,6 +60,7 @@ function SearchFood($query, $region = false) {
$response = $this->GetQueryResponse($normalizedUrl, $normalizedRequestParameters . '&' . OAuthBase::$OAUTH_SIGNATURE . '=' . urlencode($signature));

return $response;

}

function GetFood($foodId, $subCats = false, $flagDefaultServing = false) {
Expand Down

0 comments on commit 7999dfe

Please sign in to comment.