<?php
/************************************************** 
 *                 Bot Gadu-Gadu                  * 
 ************************************************** 
 * Wersja: 2.4 Stable                             * 
 * Data: 29.08.2012 (15:36)                       * 
 * 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;
	}
}
?>