2017-06-22 00:55:08 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 5.4
|
|
|
|
*
|
2017-06-22 16:42:42 +03:00
|
|
|
* Stores
|
2017-06-22 00:55:08 +03:00
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace RetailCrm\Methods\V5;
|
|
|
|
|
|
|
|
use RetailCrm\Methods\V4\Stores as Previous;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 5.4
|
|
|
|
*
|
2017-06-22 16:42:42 +03:00
|
|
|
* Stores class
|
2017-06-22 00:55:08 +03:00
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
*/
|
|
|
|
trait Stores
|
|
|
|
{
|
|
|
|
use Previous;
|
|
|
|
|
2017-11-17 15:02:54 +03:00
|
|
|
/**
|
|
|
|
* Get store settings
|
|
|
|
*
|
|
|
|
* @param string $code get settings code
|
|
|
|
*
|
2018-02-20 17:50:45 +03:00
|
|
|
* @return void
|
2017-11-17 15:02:54 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function storeSettingsGet($code)
|
|
|
|
{
|
2018-02-20 17:50:45 +03:00
|
|
|
throw new \InvalidArgumentException("This method is not available, setting code: $code is unnecessary");
|
2017-11-17 15:02:54 +03:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:55:08 +03:00
|
|
|
/**
|
|
|
|
* Get products groups
|
|
|
|
*
|
|
|
|
* @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
|
2018-02-21 09:42:10 +03:00
|
|
|
*
|
2017-06-22 00:55:08 +03:00
|
|
|
* @return \RetailCrm\Response\ApiResponse
|
|
|
|
*/
|
|
|
|
public function storeProductsGroups(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;
|
|
|
|
}
|
|
|
|
|
2018-02-20 17:50:45 +03:00
|
|
|
/* @noinspection PhpUndefinedMethodInspection */
|
2017-06-22 00:55:08 +03:00
|
|
|
return $this->client->makeRequest(
|
|
|
|
'/store/product-groups',
|
|
|
|
"GET",
|
|
|
|
$parameters
|
|
|
|
);
|
|
|
|
}
|
2018-02-21 09:42:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
);
|
|
|
|
}
|
2017-06-22 00:55:08 +03:00
|
|
|
}
|