public function Textimage::setStyle in Textimage 8.3
Same name and namespace in other branches
- 8.4 src/Textimage.php \Drupal\textimage\Textimage::setStyle()
Set the image style.
Parameters
\Drupal\image\ImageStyleInterface $image_style: The image style to be used to derive the Textimage.
Return value
$this
Overrides TextimageInterface::setStyle
File
- src/
Textimage.php, line 285
Class
- Textimage
- Provides a Textimage.
Namespace
Drupal\textimageCode
public function setStyle(ImageStyleInterface $image_style) {
if ($this->style) {
throw new TextimageException("Image style already set");
}
$this
->set('style', $image_style);
$effects = @$this->style
->getEffects()
->getConfiguration();
$this
->setEffects($effects);
return $this;
}