Пример #1
0
 /**
  * @return \ActiveResource\Connections\GuzzleConnection
  */
 public function getConnection()
 {
     if (empty($this->connection)) {
         $adapter = Guzzle::getAdapter();
         $this->connection = new GuzzleConnection("https://{$this->shopName}.myshopify.com");
         $this->connection->setClient($adapter);
         $this->connection->setBasePath('/admin');
         $accessToken = $this->getAuth()->getAccessToken();
         if ($accessToken) {
             $this->connection->getClient()->appendRequestHeader('X-Shopify-Access-Token', $accessToken);
         }
     }
     return $this->connection;
 }
Пример #2
0
 /**
  * @return \ActiveResource\Connections\GuzzleConnection
  */
 public function getConnection()
 {
     if (empty($this->connection)) {
         $adapter = Guzzle::getAdapter();
         $this->connection = new GuzzleConnection("https://{$this->shopName}.myshopify.com");
         $this->connection->setClient($adapter);
         $this->connection->setBasePath('/admin');
     }
     return $this->connection;
 }