hitmeister / api-sdk-php

Kaufland.de Onlineshop (former real.de and Hitmeister) API SDK for PHP
https://www.real.de/api/v1/
MIT License
23 stars 28 forks source link

client->units->get() Get all untis #106

Open San7ro opened 3 years ago

San7ro commented 3 years ago

I want to get all units, but there is no method to do this. This is the only way to do: units()->get(id_item); The documation allows it. You can get a list of all of your own units by sending a GET request to the /units/seller/ endpoint. Note: it can take several minutes for units to show up in this list after they are created.

NastiaNovik commented 3 years ago

Hi @San7ro, have you tried units()->find() ? Because by get(id), you will get only one unit back, but with find() you should get the whole list.

San7ro commented 3 years ago

Yes of curse: $client->units()->find(); gives me the error: Fatal error: Uncaught Error: Call to undefined method Hitmeister\Component\Api\Namespaces\UnitsNamespace::find()

benjaminsattler commented 3 years ago

hi @San7ro, thanks for reaching out with this issue. We'll look into it!

sirajea commented 3 years ago

@San7ro find() is a method of the FindBuilder class, so the following should work: $client->units()->buildFind()->find();