<?php
/************************************************** 
 *                 Bot Gadu-Gadu                  * 
 ************************************************** 
 * Wersja: 2.5 Stable                             * 
 * Data: 17.09.2012 (12:07)                       * 
 * Autor: Jacek Kowalski (http://jacekk.info)     * 
 *                                                * 
 * Utwor rozprowadzany na licencji                * 
 * http://creativecommons.org/licenses/by-nc/2.5/ * 
 **************************************************/

class BotImageGG extends BotImage {
	protected $hash;
	
	function __construct($hash) {
		$this->hash = $hash;
	}
	
	function getHash() {
		return $this->hash;
	}
	
	function getImage() {
		return imagecreatefromstring($this->getImageData());
	}
	
	function getImageData() {
		if($this->data === NULL) {
			$push = new BotGGAPI();
			$this->data = $push->getImage($this->hash);
		}
		
		return $this->data;
	}
}
?>