public function stat($Key, $Value = null, $Op = 'set')
{
if (!isset($this->Data['Stats'])) {
$this->Data['Stats'] = array();
}
$Stats =& $this->Data['Stats'];
if ($Value !== null) {
switch (strtolower($Op)) {
case 'add':
$Value += val($Key, $Stats, 0);
$Stats[$Key] = $Value;
break;
case 'set':
$Stats[$Key] = $Value;
break;
case 'time':
$Stats[$Key] = date('Y-m-d H:i:s', $Value);
}
return $Stats[$Key];
} else {
return val($Key, $Stats, null);
}
}