public function count() { $countCopy = clone $this->builder(); $stmt = $countCopy->select('COUNT(*)')->resetQueryPart('orderBy')->execute(); return (int) $stmt->fetchColumn(0); }