You are here

public function FacebookPostCollectorFactory::createInstance in Social Feed 8

Creates a pre-configured instance.

Parameters

string $appId: The facebook application id.

string $appSecret: The facebook application secret.

string $userToken: The facebook user token.

string $pageName: The facebook page name.

Return value

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

Throws

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

File

src/Services/FacebookPostCollectorFactory.php, line 67

Class

FacebookPostCollectorFactory
Class FacebookPostCollectorFactory.

Namespace

Drupal\socialfeed\Services

Code

public function createInstance(string $appId, string $appSecret, string $userToken, string $pageName) {
  return new FacebookPostCollector($appId ?: $this->defaultAppId, $appSecret ?: $this->defaultAppSecret, $userToken ?: $this->defaultUserToken, $pageName ?: ($this->pageName = $pageName));
}