本文整理汇总了PHP中Statistics::setCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Statistics::setCount方法的具体用法?PHP Statistics::setCount怎么用?PHP Statistics::setCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistics
的用法示例。
在下文中一共展示了Statistics::setCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStat
/**
* This method returns Statistics object to create the pie graph or the status list
* @return Statistics
*/
public function getStat()
{
$count = array();
$size = array();
$blks = array();
$db_result = $this->db_request->select(null, ACCT_TABLE, array(STATUS), null);
$stat = new Statistics();
foreach ($db_result as $line) {
$stname = $this->db_request->statusName($line[STATUS]);
$count[$stname] = $line['SUM(' . COUNT . ')'];
$size[$stname] = $line['SUM(' . SIZE . ')'];
$blks[$stname] = $line['SUM(' . BLOCKS . ')'];
}
$stat->setSize($size);
$stat->setBlocks($blks);
$stat->setCount($count);
return $stat;
}
示例2: getStat
/**
* This method returns Statistics object to create the pie graph or the user list
* @return Statistics
*/
public function getStat()
{
$count = array();
$size = array();
$blks = array();
$db_result = $this->db_request->select(null, ACCT_TABLE, array(GROUP), null);
$stat = new Statistics();
foreach ($db_result as $line) {
if ($line[GROUP] && $line['SUM(' . COUNT . ')'] && $line['SUM(' . SIZE . ')']) {
$count[$line[GROUP]] = $line['SUM(' . COUNT . ')'];
$size[$line[GROUP]] = $line['SUM(' . SIZE . ')'];
$blks[$line[GROUP]] = $line['SUM(' . BLOCKS . ')'];
}
}
$stat->setSize($size);
$stat->setBlocks($blks);
$stat->setCount($count);
return $stat;
}