We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce1b2ef commit 7579627Copy full SHA for 7579627
src/Api.php
@@ -2,6 +2,7 @@
2
3
namespace Shopify;
4
5
+use Shopify\Service\AbstractService;
6
use Shopify\Storage\PersistentStorageInterface;
7
use Shopify\Storage\SessionStorage;
8
use Shopify\Helper\OAuthHelper;
@@ -145,6 +146,17 @@ public function getOAuthHelper()
145
146
return new OAuthHelper($this, $this->getStorageInterface());
147
}
148
149
+ /**
150
+ * Helper function to create new service instances
151
+ *
152
+ * @param $serviceClass Fully Qualified Service className
153
+ * @return AbstractService
154
+ */
155
+ public function createService($serviceClass)
156
+ {
157
+ return new $serviceClass($this);
158
+ }
159
+
160
public function loadApiKeyFromEnv()
161
{
162
$this->api_key = getenv(self::SHOPIFY_API_KEY_NAME);
0 commit comments