You are here

protected function ImageEffectAddForm::prepareImageEffect in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 61
Contains \Drupal\image\Form\ImageEffectAddForm.

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;
}