You are here

public function FileDealerManagerInterface::createInstanceFromSchemeAndMime in Media Migration 8

Returns a FileDealer plugin instance that matches the scheme and MIME.

FileDealer plugins may specify scheme ("public", "private" etc) and MIMEs ("image", "audio" etc). This method returns a plugin that is able to manage the migration of files with the given storage scheme and main MIME type:

  • For first, the manager tries to find a plugin that exactly matches the given scheme and MIME.
  • When no plugin was found that strictly matches, then the manager tries find a plugin that's scheme isn't limited, but the given MIME matches.
  • When no plugin was found that matches to the given MIME, then this method tries to return a plugin instance whose MIME isn't limited, but its specified scheme matches the scheme argument.
  • When no matching plugin was found, but the default "fallback" plugin is available, then a fallback plugin instance will be returned.

Parameters

string $scheme: The URI scheme.

string $mime: The main MIME type's first part.

Return value

\Drupal\media_migration\FileDealerPluginInterface|null A fully configured plugin instance or NULL if no applicable plugin was found.

1 method overrides FileDealerManagerInterface::createInstanceFromSchemeAndMime()
FileDealerManager::createInstanceFromSchemeAndMime in src/FileDealerManager.php
Returns a FileDealer plugin instance that matches the scheme and MIME.

File

src/FileDealerManagerInterface.php, line 37

Class

FileDealerManagerInterface
Interface of FileDealerManager.

Namespace

Drupal\media_migration

Code

public function createInstanceFromSchemeAndMime(string $scheme, string $mime);