public ImageToolkitBase::setSource($source)
Sets the source path of the image file.
string $source: The source path of the image file.
\Drupal\Core\ImageToolkit\ImageToolkitInterface An instance of the current toolkit object.
\BadMethodCallException After being set initially, the source image cannot be changed.
Overrides ImageToolkitInterface::setSource
public function setSource($source) { // If a previous image has been loaded, there is no way to know if the // toolkit implementation needs to perform any additional actions like // freeing memory. Therefore, the source image cannot be changed once set. if ($this->source) { throw new \BadMethodCallException(__METHOD__ . '() may only be called once'); } $this->source = $source; return $this; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!ImageToolkit!ImageToolkitBase.php/function/ImageToolkitBase::setSource/8.1.x