You are here

public function InstagramPostCollectorFactory::createInstance in Social Feed 8

Creates a pre-configured instance.

Parameters

string $apiKey: The API Key.

string $apiSecret: The API Secret.

string $redirectUri: The Redirect URI.

string $accessToken: The access token.

Return value

\Drupal\socialfeed\Services\InstagramPostCollector A fully configured instance from InstagramPostCollector.

Throws

\Exception If the instance cannot be created, such as if the ID is invalid.

File

src/Services/InstagramPostCollectorFactory.php, line 74

Class

InstagramPostCollectorFactory
Class InstagramPostCollectorFactory.

Namespace

Drupal\socialfeed\Services

Code

public function createInstance(string $apiKey, string $apiSecret, string $redirectUri, string $accessToken) {
  return new InstagramPostCollector($apiKey ?: $this->defaultApiKey, $apiSecret ?: $this->defaultApiSecret, $redirectUri ?: $this->defaultRedirectUri, $accessToken ?: $this->defaultAccessToken);
}