W3cubDocs

/Drupal 8

public function ImageToolkitOperationManager::getToolkitOperation

public ImageToolkitOperationManager::getToolkitOperation(ImageToolkitInterface $toolkit, $operation)

Returns a toolkit operation plugin instance.

Parameters

\Drupal\Core\ImageToolkit\ImageToolkitInterface $toolkit: The toolkit instance.

string $operation: The operation (e.g. "crop").

Return value

\Drupal\Core\ImageToolkit\ImageToolkitOperationInterface An instance of the requested toolkit operation plugin.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException When no plugin is available.

Overrides ImageToolkitOperationManagerInterface::getToolkitOperation

File

core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationManager.php, line 118

Class

ImageToolkitOperationManager
Manages toolkit operation plugins.

Namespace

Drupal\Core\ImageToolkit

Code

public function getToolkitOperation(ImageToolkitInterface $toolkit, $operation) {
  $plugin_id = $this->getToolkitOperationPluginId($toolkit, $operation);
  return $this->createInstance($plugin_id, array(), $toolkit);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!ImageToolkit!ImageToolkitOperationManager.php/function/ImageToolkitOperationManager::getToolkitOperation/8.1.x