Doctrine 1
  1. Doctrine 1
  2. DC-619

preHydrate/postHydrate events do not use proper sub-class component

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0, 1.2.1, 1.2.2
    • Fix Version/s: None
    • Component/s: Inheritance, Record
    • Labels:
      None
    • Environment:
      PHP 5.2.11 (cli), Doctrine 1.2 (Revision: 7537)

      Description

      I am trying to use preHydrate/postHydrate with my models that use inheritance. The problem is that when using the parent table is used to query the records, the preHydrate/postHydrate events are passed to the parent record class instead of the proper sub-class for the current record.

      Using the example schema below, if I do a findAll() on the Person table and it contained two Student records and one Professor record... preHydrate would get called on Person instead of Student and Professor. This also applies for any listeners that are registered on Student/Professor and not Person.

      Person:
      columns:
      name:

      { type: string(50) }

      Student:
      inheritance:
      extends: Person
      type: column_aggregation
      keyField: type
      keyType: 1

      Professor:
      inheritance:
      extends: Person
      type: column_aggregation
      keyField: type
      keyValue: 2

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Matt Lehner
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: