From 0ac7375802d4508a82598378d0e8558b866cd5d3 Mon Sep 17 00:00:00 2001 From: kruglov Date: Thu, 4 Jul 2013 15:51:49 +0400 Subject: [PATCH] Update README.md --- README.md | 5 ++--- lib/IntaroCrm/RestApi.php | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d757ea0..58ac7e4 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,8 @@ Usage ``` php -$crmApiClient = new \IntaroCrmRestApi('http://demo.intarocrm.ru', +$crmApiClient = new \IntaroCrm\RestApi('http://demo.intarocrm.ru', 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH'); - ``` Constructor arguments are: @@ -42,7 +41,7 @@ Constructor arguments are: ``` php $orderTypes = $crmApiClient->orderTypesList(); + if (!is_null($crmApiClient->getLastError())) return $crmApiClient->getLastError(); - ``` \ No newline at end of file diff --git a/lib/IntaroCrm/RestApi.php b/lib/IntaroCrm/RestApi.php index dc1aba1..e18f2b8 100644 --- a/lib/IntaroCrm/RestApi.php +++ b/lib/IntaroCrm/RestApi.php @@ -44,11 +44,13 @@ class RestApi $this->apiKey = $apiKey; } + public function getStatusCode() { return $this->statusCode; } + /* Получение кода статуса и сообщения об ошибке */ public function getLastError() { if (!is_null($this->lastError)) @@ -57,6 +59,7 @@ class RestApi return null; } + /* Псообщения об ошибке */ public function getLastErrorMessage() { return $this->lastError;