
After a "composer update" on my Symfony porject, I have this error inside my repository:
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, User::class);
}
public function countOnlineUsers(): int
{
return $this->createQueryBuilder('u')
->select('count(u) as userOnline')
->where('u.lastSeenDate >= :time')
->setParameter('time', (new DateTime())->modify('-15 minutes'))
->getQuery()
->getSingleScalarResult()
;
}
I use new DateTime()
on different place of the project and I don’t have this error on other place.
Source: Symfony Questions
Was this helpful?
0 / 0