protected function ImageAPIOptimizeProcessorAddForm::prepareImageAPIOptimizeProcessor in Image Optimize (or ImageAPI Optimize) 8.3
Same name and namespace in other branches
- 8.2 src/Form/ImageAPIOptimizeProcessorAddForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizeProcessorAddForm::prepareImageAPIOptimizeProcessor()
- 4.x src/Form/ImageAPIOptimizeProcessorAddForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizeProcessorAddForm::prepareImageAPIOptimizeProcessor()
Converts an image optimize processor ID into an object.
Parameters
string $imageapi_optimize_processor: The image optimize processor ID.
Return value
\Drupal\imageapi_optimize\ImageAPIOptimizeProcessorInterface The image optimize processor object.
Overrides ImageAPIOptimizeProcessorFormBase::prepareImageAPIOptimizeProcessor
File
- src/
Form/ ImageAPIOptimizeProcessorAddForm.php, line 56
Class
- ImageAPIOptimizeProcessorAddForm
- Provides an add form for image optimize processors.
Namespace
Drupal\imageapi_optimize\FormCode
protected function prepareImageAPIOptimizeProcessor($imageapi_optimize_processor) {
$imageapi_optimize_processor = $this->processorManager
->createInstance($imageapi_optimize_processor);
// Set the initial weight so this processor comes last.
$imageapi_optimize_processor
->setWeight(count($this->imageAPIOptimizePipeline
->getProcessors()));
return $imageapi_optimize_processor;
}