Doctrine 1
  1. Doctrine 1
  2. DC-585

Hydrate Array does not return full array, when Hydrate Scalar does

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      OS : Ubuntu 9.04
      PHP : PHP 5.2.6-3ubuntu4.5

      Description

      Description : Upon hydrating as array I will receive one row returned. If I am to hydrate as Scalar, I will get 200+ rows. Also, if i echo the sql ($q->getSqlQuery()) and run that raw, it will also return around 200+ rows.

      $q = Doctrine_Query::create()
      ->select('DISTINCT(co.name) AS field, co.name AS value')
      ->from('Model_Country co')
      ->leftJoin('co.City ci');

      //here we will get only the first row
      $results = $q->execute(array(), Doctrine::HYDRATE_ARRAY);

      //Here we will get all 200+ rows
      $results = $q->execute(array(), Doctrine::HYDRATE_SCALAR);

      I have yet to dig to deep into this, but if it is indeed a bug, my guess is it is in Doctrine_Hydrator_Graph::hydrateResultSet()

      I can provide more data if needed.

      1. Doctrine-DC-585-b.patch
        0.7 kB
        Pierrot Evrard
      2. Doctrine-DC-585-c.patch
        0.7 kB
        Pierrot Evrard

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            James Solomon
          • Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: