Get the count of log entries matching a query.
public getCountWhere ( array $Where ) : integer | ||
$Where | array | The filter. |
return | integer | Returns the count. |
/** * View spam logs. * * @since 2.0.? * @access public * * @param int $Page Page number. */ public function spam($Page = '') { $this->permission(array('Garden.Moderation.Manage', 'Moderation.Spam.Manage'), false); list($Offset, $Limit) = offsetLimit($Page, 10); $this->setData('Title', t('Spam Queue')); $Where = array('Operation' => array('Spam')); $RecordCount = $this->LogModel->getCountWhere($Where); $this->setData('RecordCount', $RecordCount); if ($Offset >= $RecordCount) { $Offset = $RecordCount - $Limit; } $Log = $this->LogModel->getWhere($Where, 'LogID', 'Desc', $Offset, $Limit); $this->setData('Log', $Log); if ($this->deliveryType() == DELIVERY_TYPE_VIEW) { $this->View = 'Table'; } $this->addSideMenu('dashboard/log/spam'); $this->render(); }