/** * Save the diagram image to a location of your choice * @param string $path [description] */ public function saveImage($path) { $this->execute(); if (!is_writable($path)) { throw new \Exception("File or path is not writeable: " . $path); } CCache::writeFile($path, $this->image); return $this; }