Make sure we always show the correct error count on the build errors tab.
This commit is contained in:
parent
795be912f9
commit
317f63e8b6
2 changed files with 24 additions and 1 deletions
|
|
@ -54,4 +54,27 @@ class BuildErrorStore extends BuildErrorStoreBase
|
|||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the total number of errors for a given build.
|
||||
* @param $buildId
|
||||
* @param string $since date string
|
||||
* @return array
|
||||
*/
|
||||
public function getErrorTotalForBuild($buildId)
|
||||
{
|
||||
$query = 'SELECT COUNT(*) AS total FROM build_error
|
||||
WHERE build_id = :build';
|
||||
|
||||
$stmt = Database::getConnection('read')->prepare($query);
|
||||
|
||||
$stmt->bindValue(':build', $buildId, \PDO::PARAM_INT);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
$res = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
return $res['total'];
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue