2
votes

I make a simple findAll function and I get the following error:

Catchable Fatal Error: Object of class DateTime could not be converted to string in vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php line 2429

   $em = $this->getDoctrine()->getManager();
   $ppk = $em->getRepository('EgBundle:Table')
                ->findAll();

The entities has been created automatically and I didn't made anything specific on this table entity. What is wrong? I don't really understand...

Edit:

So apparently there is a primary key between an integer and a date.

if ($class->isIdentifierComposite) {
     (....)
     implode (' ', array('idTrn' => '100', 'date' => object(DateTime)))
1
are all properties correctly configured? - Wouter J
Everything has been done automatically from the Symfony app. - Alexandre
yeah, something can go wrong... - Wouter J

1 Answers

1
votes

http://www.doctrine-project.org/jira/browse/DDC-1209

Doctrine 2 has always required id fields to be castable as string, which is not the case of a DateTime object.

It's kind of enoying :s

Edit:

But here there is a recent reported issue

http://www.doctrine-project.org/jira/browse/DDC-2724