Doctrine 1
  1. Doctrine 1
  2. DC-625

Doctrine_Query throws exception for custom hydrator that extends stock hydrator

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      Windows Vista, Apache 2.2, PHP 5.3, MySQL 5.1

      Description

      I have a custom hydrator that extends Doctrine_Hydrator_ScalarDriver, for the sole purpose of simplifying the column keys (by passing false as the 3rd parameter on _gatherRowData):

      class Doctrine_Hydrator_AssocDriver extends Doctrine_Hydrator_ScalarDriver
      {
      public function hydrateResultSet($stmt)
      {
      $cache = array();
      $result = array();

      while ($data = $stmt->fetch(Doctrine_Core::FETCH_ASSOC))

      { $result[] = $this->_gatherRowData($data, $cache, false); }

      return $result;
      }
      }

      The processPendingFields method in Doctrine_Query is unnecessarily throwing a Doctrine_Query_Exception at line 465. This can be resolved by skipping hydration methods that extend None, Scalar and SingleScalar.

      A diff of the changes is attached.

      1. Query.diff
        1 kB
        Jared Mellentine

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Jared Mellentine
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: