/** * Get Customer */ public function getCustomers() { $customer = new \erdiko\shopify\models\Customer(); $data = $customer->getCustomers(); $this->setTitle('Shopify Customers'); $this->setContent($this->getLayout('json', $data)); }
/** * Get Customer */ public function getCustomers() { $customer = new \erdiko\shopify\models\Customer(); $message = ""; $isError = FALSE; try { $data = $customer->getCustomers(); } catch (ShopifyApiException $e) { $response_headers = $e->getResponseHeaders(); $message = "Error in getting Customer list :: " . $response_headers['http_status_code'] . ":" . $response_headers['http_status_message']; $isError = TRUE; } catch (ShopifyCurlException $e) { $message = "Error :: Shopify Curl Exception"; $isError = TRUE; } catch (\Exception $e) { $message = $e->getMessage(); $isError = TRUE; } if (!$isError) { $this->setTitle('Shopify Customers'); $this->setContent($this->getLayout('json', $data)); } else { $this->setContent($this->getLayout('message', $message, dirname(__DIR__))); } }