akeneo / api-php-client

PHP client of Akeneo PIM API
https://packagist.org/packages/akeneo/api-php-client
Other
92 stars 56 forks source link

Operators for filters to search resources incomplete #199

Closed wucherpfennig closed 2 years ago

wucherpfennig commented 3 years ago

Dear all

I have noticed that the operators are incomplete. Missing are the ones for completeness filtering on models.

https://api.akeneo.com/documentation/filter.html#on-completeness

BR wucherpfennig

tomglvng commented 2 years ago

Hi @wucherpfennig,

Thank you for your contribution! You're right, and we will have a look at it. Stay tuned!

Regards,

The Akeneo development team,

LevFlavien commented 2 years ago

Hi @wucherpfennig

You should be able to make it work like this:

$searchBuilder = new \Akeneo\Pim\ApiClient\Search\SearchBuilder();

// Third argument $value must be left null.
$searchBuilder->addFilter('completeness', 'ALL COMPLETE', null, ['locale' => 'en_US', 'scope' => 'ecommerce'])

$page = $client->getProductModelApi()->listPerPage(100, true, ['search' => $searchFilters]);

Although I agree there is room for improvement by making the call much more explicit, does it answers your initial comment?

tomglvng commented 2 years ago

Done in https://github.com/akeneo/api-php-client/pull/226. Thanks again!