You are here

public function SimpleFbConnectFbManager::__construct in Simple FB Connect 8.2

Same name and namespace in other branches
  1. 8.3 src/SimpleFbConnectFbManager.php \Drupal\simple_fb_connect\SimpleFbConnectFbManager::__construct()

Constructor.

File

src/SimpleFbConnectFbManager.php, line 40
Contains \Drupal\simple_fb_connect\SimpleFbConnectFbManager.

Class

SimpleFbConnectFbManager
Contains all Simple FB Connect logic that is related to Facebook interaction.

Namespace

Drupal\simple_fb_connect

Code

public function __construct(ConfigFactoryInterface $config_factory, LoggerChannelFactoryInterface $logger_factory, SessionInterface $session, EventDispatcherInterface $event_dispatcher, EntityFieldManagerInterface $entity_field_manager, UrlGeneratorInterface $url_generator) {

  // Injected dependencies.
  $this->configFactory = $config_factory;
  $this->loggerFactory = $logger_factory;
  $this->session = $session;
  $this->eventDispatcher = $event_dispatcher;
  $this->entityFieldManager = $entity_field_manager;
  $this->urlGenerator = $url_generator;

  // Other member variables.
  $this->scope = array(
    'email',
  );
  $this->returnUrl = $this->urlGenerator
    ->generateFromRoute('simple_fb_connect.return_from_fb', array(), array(
    'absolute' => TRUE,
  ));

  // Initialize Facebook App to Facebook SDK library.
  $this
    ->initializeApp();
}