You are here

public function OAuth2ControllerBase::__construct in Social Post 3.x

Same name and namespace in other branches
  1. 8.2 src/Controller/OAuth2ControllerBase.php \Drupal\social_post\Controller\OAuth2ControllerBase::__construct()

SocialAuthControllerBase constructor.

Parameters

string $module: The module name.

string $plugin_id: The plugin id.

\Drupal\social_api\Plugin\NetworkManager $network_manager: Used to get an instance of the network plugin.

\Drupal\social_post\User\UserAuthenticator $user_authenticator: Used to manage user authentication/registration.

\Drupal\social_post\PostManager\OAuth2ManagerInterface $provider_manager: Used to manage authentication methods.

\Symfony\Component\HttpFoundation\RequestStack $request: Used to access GET parameters.

\Drupal\social_post\DataHandler $data_handler: The Social Auth data handler.

\Drupal\Core\Render\RendererInterface $renderer: Used to handle metadata for redirection to authentication URL.

\Drupal\social_post\Entity\Controller\SocialPostListBuilder $list_builder: The Social Post entity list builder.

Overrides ControllerBase::__construct

File

src/Controller/OAuth2ControllerBase.php, line 98

Class

OAuth2ControllerBase
Handle responses for Social Post implementer controllers.

Namespace

Drupal\social_post\Controller

Code

public function __construct($module, $plugin_id, NetworkManager $network_manager, UserAuthenticator $user_authenticator, OAuth2ManagerInterface $provider_manager, RequestStack $request, DataHandler $data_handler, RendererInterface $renderer, SocialPostListBuilder $list_builder) {
  parent::__construct($list_builder);
  $this->module = $module;
  $this->pluginId = $plugin_id;
  $this->networkManager = $network_manager;
  $this->userAuthenticator = $user_authenticator;
  $this->providerManager = $provider_manager;
  $this->request = $request;
  $this->dataHandler = $data_handler;
  $this->renderer = $renderer;

  // Sets the plugin id in user authenticator.
  $this->userAuthenticator
    ->setPluginId($plugin_id);
}