Why does select max from a column with querybuilder return an array?

I’m trying to get the last contact of a user, here is the query:

public function dateDernierContact($utilisateur): ?Contact
        return $this->createQueryBuilder('c')
            ->andWhere('c.utilisateur = :val')
            ->andWhere('c.archive = true')
            ->setParameter('val', $utilisateur)

And where I use it:


Last, the error:

Warning: strtotime() expects parameter 1 to be string, array given

Also I use Mariadb from wamp don’t know if it could be the problem.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *