public function delete(SS_HTTPRequest $request) { $hash = $_REQUEST['hash']; $error = Error::get()->filter('Hash', $hash)->first(); if ($error) { $error->delete(); } foreach (ErrorOccurance::get()->filter('Hash', $hash) as $errorOccurance) { /* @var $errorOccurance ErrorOccurance */ $errorOccurance->delete(); } return $this->redirect('dev/logs'); }
/** * @return int */ public function NumOccurances() { return ErrorOccurance::get()->filter('Hash', $this->Hash)->count(); }