class_mcObjectStatistic.inc.php
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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;
}
}
?>