Doctrine 1
  1. Doctrine 1
  2. DC-206

The date type cannot be read in the YYYY-MM-DD format in fixtures

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.2.0-BETA2
    • Fix Version/s: None
    • Component/s: Data Fixtures
    • Labels:
      None
    • Environment:
      PostgreSQL 8.3.7

      Description

      Hi there!

      Consider the following relation:

      EyPayment:
        actAs:
          Timestampable:
          SoftDelete:
        columns:
          id:
            type:               integer(6)
            primary:            true
            autoincrement:      true
          comment:
            type:               string(255)
            notnull:            false
          requested_at:
            type:               date
            notnull:            false
          received_at:
            type:               date
            notnull:            false
          sent_at:
            type:               date
            notnull:            false
          signed_at:
            type:               date
            notnull:            false
          validated_at:
            type:               date
            notnull:            false
      

      Consider the following fixtures:

      EyPayment:
        ey_payment_1:
          comment:              bla bla
          requested_at:         2009-01-11
          received_at:          2009-01-14
          created_at:           2009-01-15 19:00
      

      Only the created_at field is filled in the database, whereas the requested_at and received_at are not. However, as specified in the Doctrine 1.0 book, a date field can be filled with the YYYY-MM-DD format.

      Note that I'm using PostgreSQL.

      Thanks,
      Jérémy Subtil, Sensio Labs

        Activity

        Hide
        Jonathan H. Wage added a comment -

        The YAML specification reads dates into a unix timestamp, so strtotime() is used. If you want to force it to be a string date, then you need to wrap it in single quotes.

        Show
        Jonathan H. Wage added a comment - The YAML specification reads dates into a unix timestamp, so strtotime() is used. If you want to force it to be a string date, then you need to wrap it in single quotes.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Jérémy Subtil
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: