I'm querying the database with 2 findby's, is there a way to do it in one findby with 2 conditions?
$this->entityManager->getRepository(User::class)->findOneByConfirmtoken($token)
&& $this->entityManager->getRepository(User::class)->findOneById($id)
->findBy([
'property1' => 'value1',
'property2' => 'value2',
])
See the docs about using conditions