Doctrine 1
  1. Doctrine 1
  2. DC-769

Variable type different for return value from Doctrine_Record->toArray() depending on whether the object is from a select, or a save.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.1, 1.2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu9.10, PHP 5.2.6, Symfony 1.4.1, Postgres8.4

      Description

      With a object that is created via a save(), and the record's primary key is a INT fed by a SEQUENCE, the type of the variable is an INT.

      With an object that is hydrated from the database via a SELECT, the record's primary key INT will come back in 'toArray()' as a STRING.

      That means that checking for type has to know what context it came from, user, INSERT, or SELECT. Not fun.

      This also screws up converting arrays to JSON, 'cause the STRINGS get quotation marks and the INTS do not.

      As a general rule, everything FROM the database seems to be strings. Yes, I know, everything 'on the wire' or 'through a socket' comes out as text. And it's a lot faster to leave it that way.

      But having the type be different depending on the database operation? Not sure I like that.

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Can you provide a test case so that we can see if we can come up with a patch?

        Show
        Jonathan H. Wage added a comment - Can you provide a test case so that we can see if we can come up with a patch?

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Dennis Gearon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: