I would like to use the combination of two foreign keys plus the datetime field as my combined primary key.
But I get a
Catchable Fatal Error: Object of class DateTime could not be converted to string in C:developmentxampphtdocshappyfacesvendordoctrineormlibDoctrineORMUnitOfWork.php line 1337
when I do so. As soon as I remove the id: true
from my YML entity declaration everything works fine again.
What is the problem that occurs here? It seems to be rather a Symfony2 or a Doctrine2 bug to me, because the datetime is set fine in the database if I don't declare the datetime column to be part of the primary key.
Can anyone help or advise?
See Question&Answers more detail:os