/** * Function: loadImage * * Returns an image instance for the given URL. If the URL has * been loaded before than an instance of the same instance is * returned as in the previous call. */ function loadImage($image) { $img = array_key_exists($image, $this->imageCache) ? $this->imageCache[$image] : null; if (!isset($img)) { $img = mxUtils::loadImage($image); if (isset($img)) { $this->imageCache[$image] = $img; } } return $img; }