Details
-
Type:
Bug
-
Status:
Open
-
Priority:
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:
Student:
inheritance:
extends: Person
type: column_aggregation
keyField: type
keyType: 1
Professor:
inheritance:
extends: Person
type: column_aggregation
keyField: type
keyValue: 2