You are here

public static function TextimageImager::setState in Textimage 7.3

Set an Imager state variable.

Parameters

string $variable: state variable

mixed $value: value to set, or NULL to return current value

Return value

mixed variable value

4 calls to TextimageImager::setState()
Textimage::buildImage in classes/Textimage.inc
Build the image via core image_style_create_derivative() function.
TextimageImager::getState in classes/TextimageImager.inc
Get an Imager state variable.
textimage_background_effect in effects/textimage_background.inc
Implements 'textimage_background' image effect callback.
textimage_gif_transparency_effect in effects/textimage_gif_transparency.inc
Implements 'textimage_gif_transparency' image effect callback.

File

classes/TextimageImager.inc, line 253
Textimage - Image processor class.

Class

TextimageImager
Textimage - Image processor class.

Code

public static function setState($variable = NULL, $value = NULL) {
  static $keys;
  if (!isset($keys) or !$variable) {
    $keys = array();
  }
  if ($variable) {
    if ($value) {
      $keys[$variable] = $value;
      return $value;
    }
    else {
      return isset($keys[$variable]) ? $keys[$variable] : NULL;
    }
  }
}