class_mcObjectStatistic.inc.php 1.06 KB
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of class_mcObjectStatistic
 *
 * @author Frederick <frederick at mensch.coop>
 */
class mcObjectStatistic {
	
	private static $statistics = array();
	
	public static function getCount__construct($param_Object) {
		$obj_classname = get_class($param_Object);
		if(!mcArray::checkKeyHasFullArray(mcObjectStatistic::$statistics, $obj_classname)) {
			mcObjectStatistic::$statistics[$obj_classname] = array();
		}
		
		if(!array_key_exists('__construct', mcObjectStatistic::$statistics[$obj_classname])) {
			mcObjectStatistic::$statistics[$obj_classname]['__construct'] = 0;
		}
		mcObjectStatistic::$statistics[$obj_classname]['__construct']++;
		return mcObjectStatistic::$statistics[$obj_classname]['__construct'];
	}
	
	public static function get__toString($param_Object) {
		$obj_classname = get_class($param_Object);
		$var_string = "obj(".$obj_classname." i[".mcObjectStatistic::$statistics[$obj_classname]['__construct']."])";
		return $var_string;
	}
}

?>