You are here

public function PixelSubscriber::__construct in Simple Facebook Pixel 8

PixelSubscriber constructor.

Parameters

\Drupal\Core\Config\ConfigFactory $config_factory: The config factory.

\Drupal\simple_facebook_pixel\PixelBuilderService $pixel_builder: The Pixel builder.

File

src/EventSubscriber/PixelSubscriber.php, line 65

Class

PixelSubscriber
Class PixelSubscriber.

Namespace

Drupal\simple_facebook_pixel\EventSubscriber

Code

public function __construct(ConfigFactory $config_factory, PixelBuilderService $pixel_builder) {
  $this->configFactory = $config_factory
    ->get('simple_facebook_pixel.settings');
  $this->pixelBuilder = $pixel_builder;
  if (\Drupal::hasService('commerce_store.current_store') && \Drupal::hasService('commerce_price.chain_price_resolver') && \Drupal::hasService('current_user')) {
    $this->currentStore = \Drupal::service('commerce_store.current_store');
    $this->chainPriceResolver = \Drupal::service('commerce_price.chain_price_resolver');
    $this->currentUser = \Drupal::service('current_user');
  }
}