missing count method in EntityRepository in php 5.4 branch #5600

Closed
opened 2026-01-22 15:12:24 +01:00 by admin · 1 comment
Owner

Originally created by @gianpaolodn on GitHub (Jul 6, 2017).

Originally assigned to: @lcobucci on GitHub.

I've just installed version 2.5.5-DEV from composer for PHP 5.6 and I was trying to use the count function after getRepository, but after getting this error

The method name must start with either findBy or findOneBy

I investigated and noticed that in this branch the count method is not implemented in the EntityRepository.

How come?

ps: inserting the code

    public function count(array $criteria)
    {
        return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->count($criteria);
    }

it just works.

Originally created by @gianpaolodn on GitHub (Jul 6, 2017). Originally assigned to: @lcobucci on GitHub. I've just installed version 2.5.5-DEV from composer for PHP 5.6 and I was trying to use the count function after getRepository, but after getting this error The method name must start with either findBy or findOneBy I investigated and noticed that in this branch the count method is not implemented in the EntityRepository. How come? ps: inserting the code ``` public function count(array $criteria) { return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->count($criteria); } ``` it just works.
admin added the InvalidQuestion labels 2026-01-22 15:12:24 +01:00
admin closed this issue 2026-01-22 15:12:25 +01:00
Author
Owner

@lcobucci commented on GitHub (Jul 7, 2017):

@gianpaolodn that's a new feature on 2.6 (which is going to be released soon), that's why it's not there.

@lcobucci commented on GitHub (Jul 7, 2017): @gianpaolodn that's a new feature on 2.6 (which is going to be released soon), that's why it's not there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5600