getStoreVisitBanner() creates and other query and make a other call to the api. This call is supposed to returned new data about different fields, but instead return the same data as the first query i made.
I can not figure out why. I displayed the query made in the function getStoreVisitBanner($id) and the query is good, but the returned content is not good.
Every time i try to make 2 successive call to the api, the second call is not returning the expected content.
Could you tell us how exactly the response retrieved is not what you’d expect? Also, what is the structure of your queries? (without any credentials, of course)
I am making a call to retrieve the coordinates of all my stores. So i call this function that makes a call and return all coordinates about all my stores.
public function getStoresCoordinates()
{
$data = [];
$query = $this->getQuery()
->select([“fields.uri”, “fields.coordinates”]);
$stores = $this->getEntries($query);
the problem is there, making this second call to the api return the same data as the first call i made, even if the query is a new one, querying the field visit_banner of the store content-type.
I expect to get field.visit_banner data, but the content is the same as the first call i made…
Entry {#841 ▼ #fields: array:2 [▼
“uri” => array:1 []
“coordinates” => array:1 [▼
“en-US” => Location {#836 }
]
]
-localeCode: “en-US” #localeCodes: array:3 [] #client: Client {#21 } #sys: SystemProperties {#833 }
}
I made a test and each time i make 2 successives calls to the api, the content of the second call is the same as the first call even if i query on other fields.
would you mind sharing the code of your getEntries and getAsset methods, so we can better understand what’s going on? Before trying to figure out if there’s anything wrong with the SDK, I’d like to have a full picture of your code, thank you!
In fact, if we create one instance of the client and we try to make 2 successives calls to the api, the second call returns exactly the same content as the first call no mather the query you give…
But, if each time we want to call the api we create a new instance of the client, then it works…
Mentioning this conversation and asking to be redirected to the PHP SDK developer (myself)? I’d like to rule out possible issues in the SDK. Thank you!