/** * Count all data * * @param callable|array|int $terms Use it if you want more terms * @param string $column Column to count * @param bool $distinct Need a distinct count? * @return int */ public function count($terms = null, $column = '', $distinct = false) { if (!$this->table) { return 0; } $query = $this->db->select()->count($column ?: '*', 'count', $distinct)->from($this->table); $this->normalizeTerms($query, $terms); return (int) $query->execute()->fetch()['count']; }