You are here

protected function ImageEffectAddForm::prepareImageEffect in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/image/src/Form/ImageEffectAddForm.php \Drupal\image\Form\ImageEffectAddForm::prepareImageEffect()

Converts an image effect ID into an object.

Parameters

string $image_effect: The image effect ID.

Return value

\Drupal\image\ImageEffectInterface The image effect object.

Overrides ImageEffectFormBase::prepareImageEffect

File

core/modules/image/src/Form/ImageEffectAddForm.php, line 58

Class

ImageEffectAddForm
Provides an add form for image effects.

Namespace

Drupal\image\Form

Code

protected function prepareImageEffect($image_effect) {
  $image_effect = $this->effectManager
    ->createInstance($image_effect);

  // Set the initial weight so this effect comes last.
  $image_effect
    ->setWeight(count($this->imageStyle
    ->getEffects()));
  return $image_effect;
}