I am wondering if this fix is working correctly or has regressed?
I have a YAML file as follows:
Acme\Entity\SearchExecution:
type: entity
table: search_execution
id:
search:
associationKey: true
# It seems this is not working
dateExecuted:
type: datetime
column: Date
fields:
executionTime:
type: integer
manyToOne:
search:
targetEntity: Acme\Entity\Search
joinColumn:
name: SearchID
referencedColumnName: id
user:
targetEntity: Acme\Entity\User
joinColumn:
name: ByUserID
referencedColumnName: id
So the "dateExecuted" field is used to compose an artificial primary key since the table has no PK.
The error is:
[ErrorException]
Catchable Fatal Error: Object of class DateTime could not be converted to string in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1295
Exception trace:
() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1295
Symfony\Component\HttpKernel\Debug\ErrorHandler->handle() at n/a:n/a
implode() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1295
Doctrine\ORM\UnitOfWork->addToIdentityMap() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1125
Doctrine\ORM\UnitOfWork->scheduleForInsert() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:810
Doctrine\ORM\UnitOfWork->persistNew() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1540
Doctrine\ORM\UnitOfWork->doPersist() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1501
Doctrine\ORM\UnitOfWork->persist() at vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:565
...
In my composer.json, the relevant versions of Doctrine are:
{
{
"package": "doctrine/common",
"version": "2.3.0-RC1"
},
{
"package": "doctrine/dbal",
"version": "2.3.x-dev",
"source-reference": "239630b61f03f39d198441eced1bfffb7b0e61d1",
"commit-date": "1346866589"
},
{
"package": "doctrine/orm",
"version": "2.3.0-RC1"
},
}
Is this a bug or am I misusing this?
Test case: https://github.com/mridgway/doctrine2/blob/DDC-1209/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php