Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2768

Doctrine could not work with date as primary key

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Part of my mapping:

       
      id:
          statDate:
              type: date
          phrase:
              type: string
          bannerId:
              type: integer
      

      So I've got an exception:

      Object of class DateTime could not be converted to string in /Users/hell0w0rd/dev/rsol/direct/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 13
      45

        Issue Links

          Activity

          Hide
          Marco Pivetta added a comment -

          DateTime instances must implement `__toString` in order to be used as identifiers. That is a known limitation.

          See http://stackoverflow.com/questions/15080573/doctrine-2-orm-datetime-field-in-identifier/15085566#comment21225419_15085566

          Show
          Marco Pivetta added a comment - DateTime instances must implement `__toString` in order to be used as identifiers. That is a known limitation. See http://stackoverflow.com/questions/15080573/doctrine-2-orm-datetime-field-in-identifier/15085566#comment21225419_15085566

            People

            • Assignee:
              Marco Pivetta
              Reporter:
              Nikita
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: