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();
        }
    }