/** * Get abuse reports for a comment * * @param integer $item Item to look for reports on * @param string $category Item type * @return integer */ public function getAbuseReports($item, $category) { $database = App::get('db'); $ra = new \Components\Support\Tables\ReportAbuse($database); return $ra->getCount(array('id' => $item, 'category' => $category)); }
/** * HAs this comment been reported * * @return boolean True if reported, False if not */ public function isReported() { if ($this->get('reports', -1) > 0) { return true; } // Reports hasn't been set if ($this->get('reports', -1) == -1) { if (is_file(PATH_CORE . DS . 'components' . DS . 'com_support' . DS . 'tables' . DS . 'reportabuse.php')) { include_once PATH_CORE . DS . 'components' . DS . 'com_support' . DS . 'tables' . DS . 'reportabuse.php'; $ra = new \Components\Support\Tables\ReportAbuse($this->_db); $val = $ra->getCount(array('id' => $this->get('id'), 'category' => 'pubreview')); $this->set('reports', $val); if ($this->get('reports') > 0) { return true; } } } return false; }