You are here

public function ImageAPIOptimizePipeline::addProcessor in Image Optimize (or ImageAPI Optimize) 4.x

Same name and namespace in other branches
  1. 8.3 src/Entity/ImageAPIOptimizePipeline.php \Drupal\imageapi_optimize\Entity\ImageAPIOptimizePipeline::addProcessor()
  2. 8.2 src/Entity/ImageAPIOptimizePipeline.php \Drupal\imageapi_optimize\Entity\ImageAPIOptimizePipeline::addProcessor()

Saves an image optimize processor for this pipeline.

Parameters

array $configuration: An array of image optimize processor configuration.

Return value

string The image optimize processor ID.

Overrides ImageAPIOptimizePipelineInterface::addProcessor

File

src/Entity/ImageAPIOptimizePipeline.php, line 255

Class

ImageAPIOptimizePipeline
Defines an image optimize pipeline configuration entity.

Namespace

Drupal\imageapi_optimize\Entity

Code

public function addProcessor(array $configuration) {
  $configuration['uuid'] = $this
    ->uuidGenerator()
    ->generate();
  $this
    ->getProcessors()
    ->addInstanceId($configuration['uuid'], $configuration);
  return $configuration['uuid'];
}