function MediaType::sourcePluginCollection

Same name in other branches
  1. 8.9.x core/modules/media/src/Entity/MediaType.php \Drupal\media\Entity\MediaType::sourcePluginCollection()
  2. 10 core/modules/media/src/Entity/MediaType.php \Drupal\media\Entity\MediaType::sourcePluginCollection()
  3. 11.x core/modules/media/src/Entity/MediaType.php \Drupal\media\Entity\MediaType::sourcePluginCollection()

Returns media source lazy plugin collection.

Return value

\Drupal\Core\Plugin\DefaultSingleLazyPluginCollection|null The tag plugin collection or NULL if the plugin ID was not set yet.

1 call to MediaType::sourcePluginCollection()
MediaType::getPluginCollections in core/modules/media/src/Entity/MediaType.php

File

core/modules/media/src/Entity/MediaType.php, line 198

Class

MediaType
Defines the Media type configuration entity.

Namespace

Drupal\media\Entity

Code

protected function sourcePluginCollection() {
    if (!$this->sourcePluginCollection && $this->source) {
        $this->sourcePluginCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.media.source'), $this->source, $this->source_configuration);
    }
    return $this->sourcePluginCollection;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.