[DDC-2601] [GH-750] Update to allow casting objects to strings (if possible) for non-composi... Created: 07/Aug/13  Updated: 13/Dec/13  Resolved: 13/Dec/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of tomsowerby:

Url: https://github.com/doctrine/doctrine2/pull/750

Message:

...te-key id attributes.

Bug discovered when using a table with 2 columns, both being used as a composite primary key.
Columns are:

  • user column linked by foreign key (which, when imported, was not mapped as an @id field)
  • datetime column

Php Datetime class was extended to implement a __toString function (as described here http://stackoverflow.com/a/15085566), but this was not being called because doctrine was not recognising the entity as having a composite primary key (due to the non-datetime user key being joined via foreign key (which may in itself be a bug)).

When adding an extra empty text field as part of the composite key, everything worked, it's just because the only non-joined-column was an object, and it managed to avoid the (implode) code that would have cast it as a string.

This change casts the object, in this case a custom datetime, to a string, if it is not part of a composite key.



 Comments   
Comment by Doctrine Bot [ 07/Aug/13 ]

A related Github Pull-Request [GH-750] was closed:
https://github.com/doctrine/doctrine2/pull/750

Comment by Doctrine Bot [ 08/Aug/13 ]

A related Github Pull-Request [GH-750] was reopened:
https://github.com/doctrine/doctrine2/pull/750

Comment by Doctrine Bot [ 28/Nov/13 ]

A related Github Pull-Request [GH-750] was closed:
https://github.com/doctrine/doctrine2/pull/750

Generated at Sat Oct 25 23:13:42 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.