Doctrine 1
  1. Doctrine 1
  2. DC-813

Add ability to register a custom hydrator as a class instance instead of a class name

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.2.3
    • Component/s: Query
    • Labels:
      None

      Description

      Currently its only possible to register a custom hydrator as a string name. However in order to inject additional attributes it would be beneficial to be able to register an instance of the custom hydrator class.

      http://www.doctrine-project.org/documentation/manual/1_2/en/data-hydrators#writing-hydration-method

      So instead of:
      $manager->registerHydrator('my_hydrator', 'Doctrine_Hydrator_MyHydrator');

      One could do:
      $manager->registerHydrator('my_hydrator', new Doctrine_Hydrator_MyHydrator());

      1. DC-813_test.diff
        2 kB
        Lukas Kahwe
      2. DC-813.diff
        3 kB
        Lukas Kahwe

        Activity

        Hide
        Lukas Kahwe added a comment -

        patch with tests is in the works

        Show
        Lukas Kahwe added a comment - patch with tests is in the works
        Hide
        Lukas Kahwe added a comment -

        patch

        Show
        Lukas Kahwe added a comment - patch
        Hide
        Lukas Kahwe added a comment -

        tests

        Show
        Lukas Kahwe added a comment - tests
        Hide
        Guilherme Blanco added a comment -

        Fixed

        Show
        Guilherme Blanco added a comment - Fixed

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Lukas Kahwe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: