I’m trying to get the catalog objects out of these calls.
I’ve tried things like $response->getItems() and $response->getObjects() which don’t work because those methods don’t exist in this version. So, how do I get the goods from the response?
$response = $this->client->catalog->list(
new ListCatalogRequest([
'types' => 'CATEGORY',
]),
);
$response2 = $this->client->catalog->list(
new ListCatalogRequest([]),
);
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
In this code, $categories and $allObjects will be arrays containing the catalog objects returned by the API calls. Each element in these arrays will be an instance of CatalogObject.