I've never been happy with this line. Counting should not be done by directly doing another find, there are plenty cases where either the information is not needed or it can be derived from the query itself.

Cases where you don't need it:

* Very big tables, doing a count is just overkill it is better to return an estimate or just bypass counting completely
* Prev/Next only pagination
* Infinite scroll pagination handled by javascript

Cases where you can derive it:

* Information can be available through ROWS_NUMBER() function in the query (if added by user)
* User is using another repository like elastic search that returns the total number along with the query response

Cases not covered by this implementation:

* Finders using distinct or group by: rewriting the query to have count(*) will break the actual count
* Finders using  expensive left joins that are not crucial for counting, the user should be able to unbind those to avoid the extra cost.

As always, programming is a game of trade-offs. I'd be happy to leave any of those cases out. Personally I think the two most important are covering queries with distinct or group by and getting the count info directly from the query itself. On a closer look, it seems that both cases can resolved by asking the same query object about its count, instead of building a new one.

    $query = $object->find($type);
    $results = $query->execute();
    $count = $query->count(); // Same query gets changed to just get the count

If we go that way, we would need a method for altering the query count programatically. This is just a crazy idea:

   public function findLikesPerUser($query) {
        $query->select(['user_id', 'count(*)'])->group(['user_id']);
        //specify a custom counter
        $query->count(function($query) {
            // A simple example
            return 10000;

            // A convoluted example that will be te actual solution to this problem:
            return $this->_buildQuery()->select('count(*)')->from($query);
        });
   }