From 695b0555a19fdb64112320097b60e514055767be Mon Sep 17 00:00:00 2001 From: Ilyas Salikhov Date: Thu, 13 Nov 2014 09:39:01 +0300 Subject: [PATCH] Remove private and protected methods from docs --- apigen.neon | 4 - docs/api/404.html | 2 +- docs/api/class-RetailCrm.ApiClient.html | 175 ++--- ...ass-RetailCrm.Exception.CurlException.html | 16 +- ...ailCrm.Exception.InvalidJsonException.html | 16 +- docs/api/class-RetailCrm.Http.Client.html | 65 +- .../class-RetailCrm.Response.ApiResponse.html | 65 +- docs/api/deprecated.html | 2 +- docs/api/elementlist.js | 2 +- docs/api/namespace-RetailCrm.Exception.html | 2 +- docs/api/namespace-RetailCrm.Http.html | 2 +- docs/api/namespace-RetailCrm.Response.html | 2 +- docs/api/namespace-RetailCrm.html | 2 +- .../api/source-class-RetailCrm.ApiClient.html | 618 +++++++++--------- ...ass-RetailCrm.Exception.CurlException.html | 5 +- ...ailCrm.Exception.InvalidJsonException.html | 5 +- .../source-class-RetailCrm.Http.Client.html | 6 +- ...-class-RetailCrm.Response.ApiResponse.html | 5 +- docs/api/todo.html | 2 +- docs/api/tree.html | 2 +- 20 files changed, 416 insertions(+), 582 deletions(-) diff --git a/apigen.neon b/apigen.neon index 34c14d1..fffc08c 100644 --- a/apigen.neon +++ b/apigen.neon @@ -21,15 +21,11 @@ groups: auto autocomplete: - classes - constants - - functions - methods - - properties - classconstants accessLevels: - public - - protected - - private internal: true php: false diff --git a/docs/api/404.html b/docs/api/404.html index e69ce41..11f5255 100644 --- a/docs/api/404.html +++ b/docs/api/404.html @@ -114,6 +114,6 @@ - + diff --git a/docs/api/class-RetailCrm.ApiClient.html b/docs/api/class-RetailCrm.ApiClient.html index 833bee9..722740e 100644 --- a/docs/api/class-RetailCrm.ApiClient.html +++ b/docs/api/class-RetailCrm.ApiClient.html @@ -117,7 +117,7 @@ Namespace: RetailCrm
- Located at RetailCrm/ApiClient.php
+ Located at RetailCrm/ApiClient.php
@@ -435,6 +435,50 @@ + + + + + + + public + RetailCrm\Response\ApiResponse + + + + +
+ # + ordersStatuses( array $ids = array(), array $externalIds = array() ) + +
+

Returns statuses of the orders

+ +
+ +
@@ -449,7 +493,7 @@
# - ordersFixExternalIds( array $ids ) + ordersFixExternalIds( array $ids )

Save order IDs' (id and externalId) association in the CRM

@@ -490,7 +534,7 @@
# - customersCreate( array $customer ) + customersCreate( array $customer )

Create a customer

@@ -531,7 +575,7 @@
# - customersEdit( array $customer, mixed $by = 'externalId' ) + customersEdit( array $customer, mixed $by = 'externalId' )

Edit a customer

@@ -575,7 +619,7 @@
# - customersUpload( array $customers ) + customersUpload( array $customers )

Upload array of the customers

@@ -616,7 +660,7 @@
# - customersGet( string $id, string $by = 'externalId' ) + customersGet( string $id, string $by = 'externalId' )

Get customer by id or externalId

@@ -660,7 +704,7 @@
# - customersList( array $filter = array(), integer $page = null, integer $limit = null ) + customersList( array $filter = array(), integer $page = null, integer $limit = null )

Returns filtered customers list

@@ -707,7 +751,7 @@
# - customersFixExternalIds( array $ids ) + customersFixExternalIds( array $ids )

Save customer IDs' (id and externalId) association in the CRM

@@ -748,7 +792,7 @@
# - deliveryServicesList( ) + deliveryServicesList( )

Returns deliveryServices list

@@ -783,7 +827,7 @@
# - deliveryTypesList( ) + deliveryTypesList( )

Returns deliveryTypes list

@@ -818,7 +862,7 @@
# - orderMethodsList( ) + orderMethodsList( )

Returns orderMethods list

@@ -853,7 +897,7 @@
# - orderTypesList( ) + orderTypesList( )

Returns orderTypes list

@@ -888,7 +932,7 @@
# - paymentStatusesList( ) + paymentStatusesList( )

Returns paymentStatuses list

@@ -923,7 +967,7 @@
# - paymentTypesList( ) + paymentTypesList( )

Returns paymentTypes list

@@ -958,7 +1002,7 @@
# - productStatusesList( ) + productStatusesList( )

Returns productStatuses list

@@ -993,7 +1037,7 @@
# - statusGroupsList( ) + statusGroupsList( )

Returns statusGroups list

@@ -1028,7 +1072,7 @@
# - statusesList( ) + statusesList( )

Returns statuses list

@@ -1063,7 +1107,7 @@
# - deliveryServicesEdit( array $data ) + deliveryServicesEdit( array $data )

Edit deliveryService

@@ -1104,7 +1148,7 @@
# - deliveryTypesEdit( array $data ) + deliveryTypesEdit( array $data )

Edit deliveryType

@@ -1145,7 +1189,7 @@
# - orderMethodsEdit( array $data ) + orderMethodsEdit( array $data )

Edit orderMethod

@@ -1186,7 +1230,7 @@
# - orderTypesEdit( array $data ) + orderTypesEdit( array $data )

Edit orderType

@@ -1227,7 +1271,7 @@
# - paymentStatusesEdit( array $data ) + paymentStatusesEdit( array $data )

Edit paymentStatus

@@ -1268,7 +1312,7 @@
# - paymentTypesEdit( array $data ) + paymentTypesEdit( array $data )

Edit paymentType

@@ -1309,7 +1353,7 @@
# - productStatusesEdit( array $data ) + productStatusesEdit( array $data )

Edit productStatus

@@ -1350,7 +1394,7 @@
# - statusesEdit( array $data ) + statusesEdit( array $data )

Edit order status

@@ -1391,7 +1435,7 @@
# - statisticUpdate( ) + statisticUpdate( )

Update CRM basic statistic

@@ -1412,47 +1456,6 @@ -
-
- - - - - protected - boolean - - - - -
- # - checkIdParameter( string $by ) - -
-

Check ID parameter

- -
- -
@@ -1499,42 +1502,6 @@ -

Properties summary

- - - - - - - -
- protected - mixed - - $client - -
- - -
- - -
-
- # - -
-
- - - - - -
@@ -1543,6 +1510,6 @@
- + diff --git a/docs/api/class-RetailCrm.Exception.CurlException.html b/docs/api/class-RetailCrm.Exception.CurlException.html index 312bcf6..ad060da 100644 --- a/docs/api/class-RetailCrm.Exception.CurlException.html +++ b/docs/api/class-RetailCrm.Exception.CurlException.html @@ -167,20 +167,6 @@ RuntimeException -

Properties summary

- -

Properties inherited from Exception

-

- $code, - $file, - $line, - $message -

- - - - -
@@ -189,6 +175,6 @@ RuntimeException
- + diff --git a/docs/api/class-RetailCrm.Exception.InvalidJsonException.html b/docs/api/class-RetailCrm.Exception.InvalidJsonException.html index a04852e..4fabd63 100644 --- a/docs/api/class-RetailCrm.Exception.InvalidJsonException.html +++ b/docs/api/class-RetailCrm.Exception.InvalidJsonException.html @@ -173,20 +173,6 @@ DomainException -

Properties summary

- -

Properties inherited from Exception

-

- $code, - $file, - $line, - $message -

- - - - -
@@ -195,6 +181,6 @@ DomainException
- + diff --git a/docs/api/class-RetailCrm.Http.Client.html b/docs/api/class-RetailCrm.Http.Client.html index 93d3389..3388d10 100644 --- a/docs/api/class-RetailCrm.Http.Client.html +++ b/docs/api/class-RetailCrm.Http.Client.html @@ -274,69 +274,6 @@ -

Properties summary

- - - - - - - - - - - - - -
- protected - mixed - - $url - -
- - -
- - -
-
- # - -
-
- protected - mixed - - $defaultParameters - -
- - -
- - -
-
- # - -
-
- - - - - -
@@ -345,6 +282,6 @@
- + diff --git a/docs/api/class-RetailCrm.Response.ApiResponse.html b/docs/api/class-RetailCrm.Response.ApiResponse.html index 1913b15..2e6e4dd 100644 --- a/docs/api/class-RetailCrm.Response.ApiResponse.html +++ b/docs/api/class-RetailCrm.Response.ApiResponse.html @@ -499,69 +499,6 @@ -

Properties summary

- - - - - - - - - - - - - -
- protected - mixed - - $statusCode - -
- - -
- - -
-
- # - -
-
- protected - mixed - - $response - -
- - -
- - -
-
- # - -
-
- - - - - -
@@ -570,6 +507,6 @@
- + diff --git a/docs/api/deprecated.html b/docs/api/deprecated.html index 31c5b0d..4385397 100644 --- a/docs/api/deprecated.html +++ b/docs/api/deprecated.html @@ -118,6 +118,6 @@
- + diff --git a/docs/api/elementlist.js b/docs/api/elementlist.js index 534b0b0..17f8281 100644 --- a/docs/api/elementlist.js +++ b/docs/api/elementlist.js @@ -1,3 +1,3 @@ var ApiGen = ApiGen || {}; -ApiGen.elements = [["c","RetailCrm\\ApiClient"],["p","RetailCrm\\ApiClient::$client"],["m","RetailCrm\\ApiClient::__construct()"],["m","RetailCrm\\ApiClient::checkIdParameter()"],["m","RetailCrm\\ApiClient::customersCreate()"],["m","RetailCrm\\ApiClient::customersEdit()"],["m","RetailCrm\\ApiClient::customersFixExternalIds()"],["m","RetailCrm\\ApiClient::customersGet()"],["m","RetailCrm\\ApiClient::customersList()"],["m","RetailCrm\\ApiClient::customersUpload()"],["m","RetailCrm\\ApiClient::deliveryServicesEdit()"],["m","RetailCrm\\ApiClient::deliveryServicesList()"],["m","RetailCrm\\ApiClient::deliveryTypesEdit()"],["m","RetailCrm\\ApiClient::deliveryTypesList()"],["m","RetailCrm\\ApiClient::orderMethodsEdit()"],["m","RetailCrm\\ApiClient::orderMethodsList()"],["m","RetailCrm\\ApiClient::ordersCreate()"],["m","RetailCrm\\ApiClient::ordersEdit()"],["m","RetailCrm\\ApiClient::ordersFixExternalIds()"],["m","RetailCrm\\ApiClient::ordersGet()"],["m","RetailCrm\\ApiClient::ordersHistory()"],["m","RetailCrm\\ApiClient::ordersList()"],["m","RetailCrm\\ApiClient::ordersUpload()"],["m","RetailCrm\\ApiClient::orderTypesEdit()"],["m","RetailCrm\\ApiClient::orderTypesList()"],["m","RetailCrm\\ApiClient::paymentStatusesEdit()"],["m","RetailCrm\\ApiClient::paymentStatusesList()"],["m","RetailCrm\\ApiClient::paymentTypesEdit()"],["m","RetailCrm\\ApiClient::paymentTypesList()"],["m","RetailCrm\\ApiClient::productStatusesEdit()"],["m","RetailCrm\\ApiClient::productStatusesList()"],["m","RetailCrm\\ApiClient::statisticUpdate()"],["m","RetailCrm\\ApiClient::statusesEdit()"],["m","RetailCrm\\ApiClient::statusesList()"],["m","RetailCrm\\ApiClient::statusGroupsList()"],["cc","RetailCrm\\ApiClient::VERSION"],["c","RetailCrm\\Exception\\CurlException"],["c","RetailCrm\\Exception\\InvalidJsonException"],["c","RetailCrm\\Http\\Client"],["p","RetailCrm\\Http\\Client::$defaultParameters"],["p","RetailCrm\\Http\\Client::$url"],["m","RetailCrm\\Http\\Client::__construct()"],["m","RetailCrm\\Http\\Client::makeRequest()"],["cc","RetailCrm\\Http\\Client::METHOD_GET"],["cc","RetailCrm\\Http\\Client::METHOD_POST"],["c","RetailCrm\\Response\\ApiResponse"],["p","RetailCrm\\Response\\ApiResponse::$response"],["p","RetailCrm\\Response\\ApiResponse::$statusCode"],["m","RetailCrm\\Response\\ApiResponse::__call()"],["m","RetailCrm\\Response\\ApiResponse::__construct()"],["m","RetailCrm\\Response\\ApiResponse::__get()"],["m","RetailCrm\\Response\\ApiResponse::getStatusCode()"],["m","RetailCrm\\Response\\ApiResponse::isSuccessful()"],["m","RetailCrm\\Response\\ApiResponse::offsetExists()"],["m","RetailCrm\\Response\\ApiResponse::offsetGet()"],["m","RetailCrm\\Response\\ApiResponse::offsetSet()"],["m","RetailCrm\\Response\\ApiResponse::offsetUnset()"]]; +ApiGen.elements = [["c","RetailCrm\\ApiClient"],["m","RetailCrm\\ApiClient::__construct()"],["m","RetailCrm\\ApiClient::customersCreate()"],["m","RetailCrm\\ApiClient::customersEdit()"],["m","RetailCrm\\ApiClient::customersFixExternalIds()"],["m","RetailCrm\\ApiClient::customersGet()"],["m","RetailCrm\\ApiClient::customersList()"],["m","RetailCrm\\ApiClient::customersUpload()"],["m","RetailCrm\\ApiClient::deliveryServicesEdit()"],["m","RetailCrm\\ApiClient::deliveryServicesList()"],["m","RetailCrm\\ApiClient::deliveryTypesEdit()"],["m","RetailCrm\\ApiClient::deliveryTypesList()"],["m","RetailCrm\\ApiClient::orderMethodsEdit()"],["m","RetailCrm\\ApiClient::orderMethodsList()"],["m","RetailCrm\\ApiClient::ordersCreate()"],["m","RetailCrm\\ApiClient::ordersEdit()"],["m","RetailCrm\\ApiClient::ordersFixExternalIds()"],["m","RetailCrm\\ApiClient::ordersGet()"],["m","RetailCrm\\ApiClient::ordersHistory()"],["m","RetailCrm\\ApiClient::ordersList()"],["m","RetailCrm\\ApiClient::ordersStatuses()"],["m","RetailCrm\\ApiClient::ordersUpload()"],["m","RetailCrm\\ApiClient::orderTypesEdit()"],["m","RetailCrm\\ApiClient::orderTypesList()"],["m","RetailCrm\\ApiClient::paymentStatusesEdit()"],["m","RetailCrm\\ApiClient::paymentStatusesList()"],["m","RetailCrm\\ApiClient::paymentTypesEdit()"],["m","RetailCrm\\ApiClient::paymentTypesList()"],["m","RetailCrm\\ApiClient::productStatusesEdit()"],["m","RetailCrm\\ApiClient::productStatusesList()"],["m","RetailCrm\\ApiClient::statisticUpdate()"],["m","RetailCrm\\ApiClient::statusesEdit()"],["m","RetailCrm\\ApiClient::statusesList()"],["m","RetailCrm\\ApiClient::statusGroupsList()"],["cc","RetailCrm\\ApiClient::VERSION"],["c","RetailCrm\\Exception\\CurlException"],["c","RetailCrm\\Exception\\InvalidJsonException"],["c","RetailCrm\\Http\\Client"],["m","RetailCrm\\Http\\Client::__construct()"],["m","RetailCrm\\Http\\Client::makeRequest()"],["cc","RetailCrm\\Http\\Client::METHOD_GET"],["cc","RetailCrm\\Http\\Client::METHOD_POST"],["c","RetailCrm\\Response\\ApiResponse"],["m","RetailCrm\\Response\\ApiResponse::__call()"],["m","RetailCrm\\Response\\ApiResponse::__construct()"],["m","RetailCrm\\Response\\ApiResponse::__get()"],["m","RetailCrm\\Response\\ApiResponse::getStatusCode()"],["m","RetailCrm\\Response\\ApiResponse::isSuccessful()"],["m","RetailCrm\\Response\\ApiResponse::offsetExists()"],["m","RetailCrm\\Response\\ApiResponse::offsetGet()"],["m","RetailCrm\\Response\\ApiResponse::offsetSet()"],["m","RetailCrm\\Response\\ApiResponse::offsetUnset()"]]; diff --git a/docs/api/namespace-RetailCrm.Exception.html b/docs/api/namespace-RetailCrm.Exception.html index ec40614..4e1b1c9 100644 --- a/docs/api/namespace-RetailCrm.Exception.html +++ b/docs/api/namespace-RetailCrm.Exception.html @@ -125,6 +125,6 @@
- + diff --git a/docs/api/namespace-RetailCrm.Http.html b/docs/api/namespace-RetailCrm.Http.html index b45a157..e72d411 100644 --- a/docs/api/namespace-RetailCrm.Http.html +++ b/docs/api/namespace-RetailCrm.Http.html @@ -119,6 +119,6 @@
- + diff --git a/docs/api/namespace-RetailCrm.Response.html b/docs/api/namespace-RetailCrm.Response.html index 69e22fe..c945b01 100644 --- a/docs/api/namespace-RetailCrm.Response.html +++ b/docs/api/namespace-RetailCrm.Response.html @@ -119,6 +119,6 @@
- + diff --git a/docs/api/namespace-RetailCrm.html b/docs/api/namespace-RetailCrm.html index 4c61185..422ef3c 100644 --- a/docs/api/namespace-RetailCrm.html +++ b/docs/api/namespace-RetailCrm.html @@ -131,6 +131,6 @@
- + diff --git a/docs/api/source-class-RetailCrm.ApiClient.html b/docs/api/source-class-RetailCrm.ApiClient.html index 3067ff7..505684f 100644 --- a/docs/api/source-class-RetailCrm.ApiClient.html +++ b/docs/api/source-class-RetailCrm.ApiClient.html @@ -266,424 +266,446 @@ 168 } 169 170 /** -171 * Save order IDs' (id and externalId) association in the CRM +171 * Returns statuses of the orders 172 * -173 * @param array $ids -174 * @return ApiResponse -175 */ -176 public function ordersFixExternalIds(array $ids) -177 { -178 if (!sizeof($ids)) { -179 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); -180 } -181 -182 return $this->client->makeRequest("/orders/fix-external-ids", Client::METHOD_POST, array( -183 'orders' => json_encode($ids), -184 )); -185 } -186 -187 /** -188 * Create a customer -189 * -190 * @param array $customer -191 * @return ApiResponse -192 */ -193 public function customersCreate(array $customer) -194 { -195 if (!sizeof($customer)) { -196 throw new \InvalidArgumentException('Parameter `customer` must contains a data'); -197 } -198 -199 return $this->client->makeRequest("/customers/create", Client::METHOD_POST, array( -200 'customer' => json_encode($customer) -201 )); -202 } -203 -204 /** -205 * Edit a customer -206 * -207 * @param array $customer -208 * @return ApiResponse -209 */ -210 public function customersEdit(array $customer, $by = 'externalId') -211 { -212 if (!sizeof($customer)) { -213 throw new \InvalidArgumentException('Parameter `customer` must contains a data'); -214 } -215 -216 $this->checkIdParameter($by); -217 -218 if (!isset($customer[$by])) { -219 throw new \InvalidArgumentException(sprintf('Customer array must contain the "%s" parameter.', $by)); -220 } -221 -222 return $this->client->makeRequest("/customers/" . $customer[$by] . "/edit", Client::METHOD_POST, array( -223 'customer' => json_encode($customer), -224 'by' => $by, -225 )); -226 } -227 -228 /** -229 * Upload array of the customers -230 * -231 * @param array $customers -232 * @return ApiResponse -233 */ -234 public function customersUpload(array $customers) -235 { -236 if (!sizeof($customers)) { -237 throw new \InvalidArgumentException('Parameter `customers` must contains array of the customers'); -238 } -239 -240 return $this->client->makeRequest("/customers/upload", Client::METHOD_POST, array( -241 'customers' => json_encode($customers), -242 )); -243 } -244 -245 /** -246 * Get customer by id or externalId -247 * -248 * @param string $id -249 * @param string $by (default: 'externalId') -250 * @return ApiResponse -251 */ -252 public function customersGet($id, $by = 'externalId') -253 { -254 $this->checkIdParameter($by); -255 -256 return $this->client->makeRequest("/customers/$id", Client::METHOD_GET, array('by' => $by)); -257 } -258 -259 /** -260 * Returns filtered customers list -261 * -262 * @param array $filter (default: array()) -263 * @param int $page (default: null) -264 * @param int $limit (default: null) -265 * @return ApiResponse -266 */ -267 public function customersList(array $filter = array(), $page = null, $limit = null) -268 { -269 $parameters = array(); -270 -271 if (sizeof($filter)) { -272 $parameters['filter'] = $filter; -273 } -274 if (null !== $page) { -275 $parameters['page'] = (int) $page; -276 } -277 if (null !== $limit) { -278 $parameters['limit'] = (int) $limit; -279 } -280 -281 return $this->client->makeRequest('/customers', Client::METHOD_GET, $parameters); -282 } -283 -284 /** -285 * Save customer IDs' (id and externalId) association in the CRM -286 * -287 * @param array $ids -288 * @return ApiResponse -289 */ -290 public function customersFixExternalIds(array $ids) -291 { -292 if (!sizeof($ids)) { -293 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); +173 * @param array $ids (default: array()) +174 * @param array $externalIds (default: array()) +175 * @return ApiResponse +176 */ +177 public function ordersStatuses(array $ids = array(), array $externalIds = array()) +178 { +179 $parameters = array(); +180 +181 if (sizeof($ids)) { +182 $parameters['ids'] = $ids; +183 } +184 if (sizeof($externalIds)) { +185 $parameters['externalIds'] = $externalIds; +186 } +187 +188 return $this->client->makeRequest('/orders/statuses', Client::METHOD_GET, $parameters); +189 } +190 +191 /** +192 * Save order IDs' (id and externalId) association in the CRM +193 * +194 * @param array $ids +195 * @return ApiResponse +196 */ +197 public function ordersFixExternalIds(array $ids) +198 { +199 if (!sizeof($ids)) { +200 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); +201 } +202 +203 return $this->client->makeRequest("/orders/fix-external-ids", Client::METHOD_POST, array( +204 'orders' => json_encode($ids), +205 )); +206 } +207 +208 /** +209 * Create a customer +210 * +211 * @param array $customer +212 * @return ApiResponse +213 */ +214 public function customersCreate(array $customer) +215 { +216 if (!sizeof($customer)) { +217 throw new \InvalidArgumentException('Parameter `customer` must contains a data'); +218 } +219 +220 return $this->client->makeRequest("/customers/create", Client::METHOD_POST, array( +221 'customer' => json_encode($customer) +222 )); +223 } +224 +225 /** +226 * Edit a customer +227 * +228 * @param array $customer +229 * @return ApiResponse +230 */ +231 public function customersEdit(array $customer, $by = 'externalId') +232 { +233 if (!sizeof($customer)) { +234 throw new \InvalidArgumentException('Parameter `customer` must contains a data'); +235 } +236 +237 $this->checkIdParameter($by); +238 +239 if (!isset($customer[$by])) { +240 throw new \InvalidArgumentException(sprintf('Customer array must contain the "%s" parameter.', $by)); +241 } +242 +243 return $this->client->makeRequest("/customers/" . $customer[$by] . "/edit", Client::METHOD_POST, array( +244 'customer' => json_encode($customer), +245 'by' => $by, +246 )); +247 } +248 +249 /** +250 * Upload array of the customers +251 * +252 * @param array $customers +253 * @return ApiResponse +254 */ +255 public function customersUpload(array $customers) +256 { +257 if (!sizeof($customers)) { +258 throw new \InvalidArgumentException('Parameter `customers` must contains array of the customers'); +259 } +260 +261 return $this->client->makeRequest("/customers/upload", Client::METHOD_POST, array( +262 'customers' => json_encode($customers), +263 )); +264 } +265 +266 /** +267 * Get customer by id or externalId +268 * +269 * @param string $id +270 * @param string $by (default: 'externalId') +271 * @return ApiResponse +272 */ +273 public function customersGet($id, $by = 'externalId') +274 { +275 $this->checkIdParameter($by); +276 +277 return $this->client->makeRequest("/customers/$id", Client::METHOD_GET, array('by' => $by)); +278 } +279 +280 /** +281 * Returns filtered customers list +282 * +283 * @param array $filter (default: array()) +284 * @param int $page (default: null) +285 * @param int $limit (default: null) +286 * @return ApiResponse +287 */ +288 public function customersList(array $filter = array(), $page = null, $limit = null) +289 { +290 $parameters = array(); +291 +292 if (sizeof($filter)) { +293 $parameters['filter'] = $filter; 294 } -295 -296 return $this->client->makeRequest("/customers/fix-external-ids", Client::METHOD_POST, array( -297 'customers' => json_encode($ids), -298 )); -299 } -300 -301 /** -302 * Returns deliveryServices list -303 * -304 * @return ApiResponse -305 */ -306 public function deliveryServicesList() -307 { -308 return $this->client->makeRequest('/reference/delivery-services', Client::METHOD_GET); -309 } -310 -311 /** -312 * Returns deliveryTypes list -313 * -314 * @return ApiResponse -315 */ -316 public function deliveryTypesList() -317 { -318 return $this->client->makeRequest('/reference/delivery-types', Client::METHOD_GET); -319 } -320 -321 /** -322 * Returns orderMethods list -323 * -324 * @return ApiResponse -325 */ -326 public function orderMethodsList() -327 { -328 return $this->client->makeRequest('/reference/order-methods', Client::METHOD_GET); -329 } -330 -331 /** -332 * Returns orderTypes list -333 * -334 * @return ApiResponse -335 */ -336 public function orderTypesList() -337 { -338 return $this->client->makeRequest('/reference/order-types', Client::METHOD_GET); -339 } -340 -341 /** -342 * Returns paymentStatuses list -343 * -344 * @return ApiResponse -345 */ -346 public function paymentStatusesList() -347 { -348 return $this->client->makeRequest('/reference/payment-statuses', Client::METHOD_GET); -349 } -350 -351 /** -352 * Returns paymentTypes list -353 * -354 * @return ApiResponse -355 */ -356 public function paymentTypesList() -357 { -358 return $this->client->makeRequest('/reference/payment-types', Client::METHOD_GET); -359 } -360 -361 /** -362 * Returns productStatuses list -363 * -364 * @return ApiResponse -365 */ -366 public function productStatusesList() -367 { -368 return $this->client->makeRequest('/reference/product-statuses', Client::METHOD_GET); -369 } -370 -371 /** -372 * Returns statusGroups list -373 * -374 * @return ApiResponse -375 */ -376 public function statusGroupsList() -377 { -378 return $this->client->makeRequest('/reference/status-groups', Client::METHOD_GET); -379 } -380 -381 /** -382 * Returns statuses list -383 * -384 * @return ApiResponse -385 */ -386 public function statusesList() -387 { -388 return $this->client->makeRequest('/reference/statuses', Client::METHOD_GET); -389 } -390 -391 /** -392 * Edit deliveryService -393 * -394 * @param array $data delivery service data +295 if (null !== $page) { +296 $parameters['page'] = (int) $page; +297 } +298 if (null !== $limit) { +299 $parameters['limit'] = (int) $limit; +300 } +301 +302 return $this->client->makeRequest('/customers', Client::METHOD_GET, $parameters); +303 } +304 +305 /** +306 * Save customer IDs' (id and externalId) association in the CRM +307 * +308 * @param array $ids +309 * @return ApiResponse +310 */ +311 public function customersFixExternalIds(array $ids) +312 { +313 if (!sizeof($ids)) { +314 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); +315 } +316 +317 return $this->client->makeRequest("/customers/fix-external-ids", Client::METHOD_POST, array( +318 'customers' => json_encode($ids), +319 )); +320 } +321 +322 /** +323 * Returns deliveryServices list +324 * +325 * @return ApiResponse +326 */ +327 public function deliveryServicesList() +328 { +329 return $this->client->makeRequest('/reference/delivery-services', Client::METHOD_GET); +330 } +331 +332 /** +333 * Returns deliveryTypes list +334 * +335 * @return ApiResponse +336 */ +337 public function deliveryTypesList() +338 { +339 return $this->client->makeRequest('/reference/delivery-types', Client::METHOD_GET); +340 } +341 +342 /** +343 * Returns orderMethods list +344 * +345 * @return ApiResponse +346 */ +347 public function orderMethodsList() +348 { +349 return $this->client->makeRequest('/reference/order-methods', Client::METHOD_GET); +350 } +351 +352 /** +353 * Returns orderTypes list +354 * +355 * @return ApiResponse +356 */ +357 public function orderTypesList() +358 { +359 return $this->client->makeRequest('/reference/order-types', Client::METHOD_GET); +360 } +361 +362 /** +363 * Returns paymentStatuses list +364 * +365 * @return ApiResponse +366 */ +367 public function paymentStatusesList() +368 { +369 return $this->client->makeRequest('/reference/payment-statuses', Client::METHOD_GET); +370 } +371 +372 /** +373 * Returns paymentTypes list +374 * +375 * @return ApiResponse +376 */ +377 public function paymentTypesList() +378 { +379 return $this->client->makeRequest('/reference/payment-types', Client::METHOD_GET); +380 } +381 +382 /** +383 * Returns productStatuses list +384 * +385 * @return ApiResponse +386 */ +387 public function productStatusesList() +388 { +389 return $this->client->makeRequest('/reference/product-statuses', Client::METHOD_GET); +390 } +391 +392 /** +393 * Returns statusGroups list +394 * 395 * @return ApiResponse 396 */ -397 public function deliveryServicesEdit(array $data) +397 public function statusGroupsList() 398 { -399 if (!isset($data['code'])) { -400 throw new \InvalidArgumentException('Data must contain "code" parameter.'); -401 } -402 -403 return $this->client->makeRequest( -404 '/reference/delivery-services/' . $data['code'] . '/edit', -405 Client::METHOD_POST, -406 array( -407 'deliveryService' => json_encode($data) -408 ) -409 ); +399 return $this->client->makeRequest('/reference/status-groups', Client::METHOD_GET); +400 } +401 +402 /** +403 * Returns statuses list +404 * +405 * @return ApiResponse +406 */ +407 public function statusesList() +408 { +409 return $this->client->makeRequest('/reference/statuses', Client::METHOD_GET); 410 } 411 412 /** -413 * Edit deliveryType +413 * Edit deliveryService 414 * -415 * @param array $data delivery type data +415 * @param array $data delivery service data 416 * @return ApiResponse 417 */ -418 public function deliveryTypesEdit(array $data) +418 public function deliveryServicesEdit(array $data) 419 { 420 if (!isset($data['code'])) { 421 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 422 } 423 424 return $this->client->makeRequest( -425 '/reference/delivery-types/' . $data['code'] . '/edit', +425 '/reference/delivery-services/' . $data['code'] . '/edit', 426 Client::METHOD_POST, 427 array( -428 'deliveryType' => json_encode($data) +428 'deliveryService' => json_encode($data) 429 ) 430 ); 431 } 432 433 /** -434 * Edit orderMethod +434 * Edit deliveryType 435 * -436 * @param array $data order method data +436 * @param array $data delivery type data 437 * @return ApiResponse 438 */ -439 public function orderMethodsEdit(array $data) +439 public function deliveryTypesEdit(array $data) 440 { 441 if (!isset($data['code'])) { 442 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 443 } 444 445 return $this->client->makeRequest( -446 '/reference/order-methods/' . $data['code'] . '/edit', +446 '/reference/delivery-types/' . $data['code'] . '/edit', 447 Client::METHOD_POST, 448 array( -449 'orderMethod' => json_encode($data) +449 'deliveryType' => json_encode($data) 450 ) 451 ); 452 } 453 454 /** -455 * Edit orderType +455 * Edit orderMethod 456 * -457 * @param array $data order type data +457 * @param array $data order method data 458 * @return ApiResponse 459 */ -460 public function orderTypesEdit(array $data) +460 public function orderMethodsEdit(array $data) 461 { 462 if (!isset($data['code'])) { 463 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 464 } 465 466 return $this->client->makeRequest( -467 '/reference/order-types/' . $data['code'] . '/edit', +467 '/reference/order-methods/' . $data['code'] . '/edit', 468 Client::METHOD_POST, 469 array( -470 'orderType' => json_encode($data) +470 'orderMethod' => json_encode($data) 471 ) 472 ); 473 } 474 475 /** -476 * Edit paymentStatus +476 * Edit orderType 477 * -478 * @param array $data payment status data +478 * @param array $data order type data 479 * @return ApiResponse 480 */ -481 public function paymentStatusesEdit(array $data) +481 public function orderTypesEdit(array $data) 482 { 483 if (!isset($data['code'])) { 484 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 485 } 486 487 return $this->client->makeRequest( -488 '/reference/payment-statuses/' . $data['code'] . '/edit', +488 '/reference/order-types/' . $data['code'] . '/edit', 489 Client::METHOD_POST, 490 array( -491 'paymentStatus' => json_encode($data) +491 'orderType' => json_encode($data) 492 ) 493 ); 494 } 495 496 /** -497 * Edit paymentType +497 * Edit paymentStatus 498 * -499 * @param array $data payment type data +499 * @param array $data payment status data 500 * @return ApiResponse 501 */ -502 public function paymentTypesEdit(array $data) +502 public function paymentStatusesEdit(array $data) 503 { 504 if (!isset($data['code'])) { 505 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 506 } 507 508 return $this->client->makeRequest( -509 '/reference/payment-types/' . $data['code'] . '/edit', +509 '/reference/payment-statuses/' . $data['code'] . '/edit', 510 Client::METHOD_POST, 511 array( -512 'paymentType' => json_encode($data) +512 'paymentStatus' => json_encode($data) 513 ) 514 ); 515 } 516 517 /** -518 * Edit productStatus +518 * Edit paymentType 519 * -520 * @param array $data product status data +520 * @param array $data payment type data 521 * @return ApiResponse 522 */ -523 public function productStatusesEdit(array $data) +523 public function paymentTypesEdit(array $data) 524 { 525 if (!isset($data['code'])) { 526 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 527 } 528 529 return $this->client->makeRequest( -530 '/reference/product-statuses/' . $data['code'] . '/edit', +530 '/reference/payment-types/' . $data['code'] . '/edit', 531 Client::METHOD_POST, 532 array( -533 'productStatus' => json_encode($data) +533 'paymentType' => json_encode($data) 534 ) 535 ); 536 } 537 538 /** -539 * Edit order status +539 * Edit productStatus 540 * -541 * @param array $data status data +541 * @param array $data product status data 542 * @return ApiResponse 543 */ -544 public function statusesEdit(array $data) +544 public function productStatusesEdit(array $data) 545 { 546 if (!isset($data['code'])) { 547 throw new \InvalidArgumentException('Data must contain "code" parameter.'); 548 } 549 550 return $this->client->makeRequest( -551 '/reference/statuses/' . $data['code'] . '/edit', +551 '/reference/product-statuses/' . $data['code'] . '/edit', 552 Client::METHOD_POST, 553 array( -554 'status' => json_encode($data) +554 'productStatus' => json_encode($data) 555 ) 556 ); 557 } 558 559 /** -560 * Update CRM basic statistic +560 * Edit order status 561 * -562 * @return ApiResponse -563 */ -564 public function statisticUpdate() -565 { -566 return $this->client->makeRequest('/statistic/update', Client::METHOD_GET); -567 } -568 -569 /** -570 * Check ID parameter -571 * -572 * @param string $by -573 * @return bool -574 */ -575 protected function checkIdParameter($by) -576 { -577 $allowedForBy = array('externalId', 'id'); -578 if (!in_array($by, $allowedForBy)) { -579 throw new \InvalidArgumentException(sprintf( -580 'Value "%s" for parameter "by" is not valid. Allowed values are %s.', -581 $by, -582 implode(', ', $allowedForBy) -583 )); -584 } -585 -586 return true; -587 } -588 } +562 * @param array $data status data +563 * @return ApiResponse +564 */ +565 public function statusesEdit(array $data) +566 { +567 if (!isset($data['code'])) { +568 throw new \InvalidArgumentException('Data must contain "code" parameter.'); +569 } +570 +571 return $this->client->makeRequest( +572 '/reference/statuses/' . $data['code'] . '/edit', +573 Client::METHOD_POST, +574 array( +575 'status' => json_encode($data) +576 ) +577 ); +578 } +579 +580 /** +581 * Update CRM basic statistic +582 * +583 * @return ApiResponse +584 */ +585 public function statisticUpdate() +586 { +587 return $this->client->makeRequest('/statistic/update', Client::METHOD_GET); +588 } +589 +590 /** +591 * Check ID parameter +592 * +593 * @param string $by +594 * @return bool +595 */ +596 protected function checkIdParameter($by) +597 { +598 $allowedForBy = array('externalId', 'id'); +599 if (!in_array($by, $allowedForBy)) { +600 throw new \InvalidArgumentException(sprintf( +601 'Value "%s" for parameter "by" is not valid. Allowed values are %s.', +602 $by, +603 implode(', ', $allowedForBy) +604 )); +605 } +606 +607 return true; +608 } +609 } +610
- + diff --git a/docs/api/source-class-RetailCrm.Exception.CurlException.html b/docs/api/source-class-RetailCrm.Exception.CurlException.html index 792e4f7..2609383 100644 --- a/docs/api/source-class-RetailCrm.Exception.CurlException.html +++ b/docs/api/source-class-RetailCrm.Exception.CurlException.html @@ -103,7 +103,8 @@ 4 5 class CurlException extends \RuntimeException 6 { -7 } +7 } +8
- + diff --git a/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html b/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html index 3927ab9..bdca89b 100644 --- a/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html +++ b/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html @@ -103,7 +103,8 @@ 4 5 class InvalidJsonException extends \DomainException 6 { -7 } +7 } +8
- + diff --git a/docs/api/source-class-RetailCrm.Http.Client.html b/docs/api/source-class-RetailCrm.Http.Client.html index 161030e..6d55d28 100644 --- a/docs/api/source-class-RetailCrm.Http.Client.html +++ b/docs/api/source-class-RetailCrm.Http.Client.html @@ -153,7 +153,7 @@ 55 56 $ch = curl_init(); 57 curl_setopt($ch, CURLOPT_URL, $path); -58 curl_setopt($ch, CURLOPT_FAILONERROR, FALSE); +58 curl_setopt($ch, CURLOPT_FAILONERROR, false); 59 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable 60 curl_setopt($ch, CURLOPT_TIMEOUT, (int) $timeout); // times out after 30s 61 // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); @@ -177,7 +177,7 @@ 79 80 return new ApiResponse($statusCode, $responseBody); 81 } -82 } +82 } 83
@@ -186,6 +186,6 @@
- + diff --git a/docs/api/source-class-RetailCrm.Response.ApiResponse.html b/docs/api/source-class-RetailCrm.Response.ApiResponse.html index 1e31d70..1e00010 100644 --- a/docs/api/source-class-RetailCrm.Response.ApiResponse.html +++ b/docs/api/source-class-RetailCrm.Response.ApiResponse.html @@ -222,7 +222,8 @@ 124 125 return $this->response[$offset]; 126 } -127 } +127 } +128
- + diff --git a/docs/api/todo.html b/docs/api/todo.html index cf47cf3..7b8d857 100644 --- a/docs/api/todo.html +++ b/docs/api/todo.html @@ -118,6 +118,6 @@
- + diff --git a/docs/api/tree.html b/docs/api/tree.html index c171b2c..eb748db 100644 --- a/docs/api/tree.html +++ b/docs/api/tree.html @@ -186,6 +186,6 @@
- +