You are here

public function Embed::__construct in CKEditor Media Embed Plugin 8

Constructs an Embed object.

Parameters

\GuzzleHttp\ClientInterface $http_client: The http client used to do retrieval of embed codes.

\Drupal\Core\Utility\UnroutedUrlAssemblerInterface $url_assembler: The url assembler used to create url from a parsed url.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.

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

\Drupal\Core\Path\CurrentPathStack $current_path: The current path service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

File

src/Embed.php, line 94

Class

Embed
The default CKEditor Media Embed class.

Namespace

Drupal\ckeditor_media_embed

Code

public function __construct(ClientInterface $http_client, UnroutedUrlAssemblerInterface $url_assembler, RequestStack $request_stack, MessengerInterface $messenger, ConfigFactory $config_factory, CurrentPathStack $current_path, ModuleHandlerInterface $module_handler) {
  $this->httpClient = $http_client;
  $this->urlAssembler = $url_assembler;
  $this->requestStack = $request_stack;
  $this->configFactory = $config_factory;
  $this->messenger = $messenger;
  $this->currentPath = $current_path;
  $this->moduleHandler = $module_handler;
  $embed_provider = $this->configFactory
    ->get('ckeditor_media_embed.settings')
    ->get('embed_provider');
  $this
    ->setEmbedProvider($embed_provider);
}