From d1a73d7acd9fdf027ce58b5b858e9e5577944a1e Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 21 Feb 2018 09:42:10 +0300 Subject: [PATCH] Products properties --- README.md | 2 ++ lib/RetailCrm/Methods/V5/Stores.php | 36 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/README.md b/README.md index 9c16498..c24d4de 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/retailcrm/api-client-php.svg?branch=master)](https://travis-ci.org/retailcrm/api-client-php) + # retailCRM API PHP client PHP-client for [retailCRM API](http://www.retailcrm.pro/docs/Developers/ApiVersion5). diff --git a/lib/RetailCrm/Methods/V5/Stores.php b/lib/RetailCrm/Methods/V5/Stores.php index 6af7cf2..b625835 100644 --- a/lib/RetailCrm/Methods/V5/Stores.php +++ b/lib/RetailCrm/Methods/V5/Stores.php @@ -54,6 +54,7 @@ trait Stores * @throws \InvalidArgumentException * @throws \RetailCrm\Exception\CurlException * @throws \RetailCrm\Exception\InvalidJsonException + * * @return \RetailCrm\Response\ApiResponse */ public function storeProductsGroups(array $filter = [], $page = null, $limit = null) @@ -77,4 +78,39 @@ trait Stores $parameters ); } + + /** + * Get products properties + * + * @param array $filter (default: array()) + * @param int $page (default: null) + * @param int $limit (default: null) + * + * @throws \InvalidArgumentException + * @throws \RetailCrm\Exception\CurlException + * @throws \RetailCrm\Exception\InvalidJsonException + * + * @return \RetailCrm\Response\ApiResponse + */ + public function storeProductsProperties(array $filter = [], $page = null, $limit = null) + { + $parameters = []; + + if (count($filter)) { + $parameters['filter'] = $filter; + } + if (null !== $page) { + $parameters['page'] = (int) $page; + } + if (null !== $limit) { + $parameters['limit'] = (int) $limit; + } + + /* @noinspection PhpUndefinedMethodInspection */ + return $this->client->makeRequest( + '/store/products/properties', + "GET", + $parameters + ); + } }