You are here

protected function CronHandler::getInstagramSourcePluginID in Instagram Feeds 8

Gets Media source plugin ID.

Parameters

string $media_type_name: The Instagram media type system name.

Return value

string Source plugin ID or NULL.

1 call to CronHandler::getInstagramSourcePluginID()
CronHandler::createMediaEntity in src/CronHandler.php
Creates Media entity with Instagram data.

File

src/CronHandler.php, line 333

Class

CronHandler
Instagram Feeds Cron Handler Service.

Namespace

Drupal\instagram_feeds

Code

protected function getInstagramSourcePluginID($media_type_name) : string {
  if (!isset($this->mediaTypeSourceIDs[$media_type_name])) {

    /** @var \Drupal\media\MediaTypeInterface $mediaType */
    $mediaType = $this->entityTypeManager
      ->getStorage('media_type')
      ->load($media_type_name);
    $this->mediaTypeSourceIDs[$media_type_name] = $mediaType
      ->getSource()
      ->getPluginId();
  }
  return $this->mediaTypeSourceIDs[$media_type_name];
}