Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$returnFullResponse behavior in AllInOneDomain.php #54

Open
pentatonicfunk opened this issue Dec 29, 2022 · 0 comments
Open

$returnFullResponse behavior in AllInOneDomain.php #54

pentatonicfunk opened this issue Dec 29, 2022 · 0 comments

Comments

@pentatonicfunk
Copy link

$returnFullResponse should behave as it say, which is return full response
but looking at the codes here :

public function customResponseHandling($arrayResult, $returnFullResponse = true)
{
if ($returnFullResponse) {
if (isset($arrayResult['attributes']['premium']['items'])) {
$tempHold = $arrayResult['attributes']['premium']['items'];
} else {
$tempHold = null;
}
$arrayResult = array(
'lookup' => $arrayResult['attributes']['lookup']['items'],
'premium' => $tempHold,
'suggestion' => $arrayResult['attributes']['suggestion']['items'],
);
}
return $arrayResult;
when $returnFullResponse = true, it instead "limiting" the response, not returning full response.

Compare with other code, e.g.

public function customResponseHandling($arrayResult, $returnFullResponse = true)
{
if (!$returnFullResponse) {
if (isset($arrayResult['attributes'])) {
$resultRaw = array();
if (isset($arrayResult['attributes']['lookup']['items'])) {
$resultRaw['lookup'] = $arrayResult['attributes']['lookup']['items'];
}
if (isset($arrayResult['attributes']['suggestion']['items'])) {
$resultRaw['suggestion'] = $arrayResult['attributes']['suggestion']['items'];
}
$arrayResult = $resultRaw;
}
}
return $arrayResult;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant