public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }