public function count() {
        $repo = $this->getRepository();

        return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey());
    }
public function count() {
        $repo = $this->getRepository();

        return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey());
    }
public function count ( ) { $ repo = $ this -> getRepository ( ) ; return $ repo -> aggregate ( $ this -> limit ( 0 ) , __FUNCTION__ , $ repo -> getPrimaryKey ( ) ) ; }
Pass the query to the repository to interact with the database.
Return the count of how many records exist.

@return int
Pass the query to the repository to interact with the database . Return the count of how many records exist .