Not finding field in polymorphic association with Doctrine2
Posted
by
dimirc
on Stack Overflow
See other posts from Stack Overflow
or by dimirc
Published on 2012-03-23T06:06:35Z
Indexed on
2012/03/23
11:29 UTC
Read the original article
Hit count: 504
I have a polymorphic association (Class Table Inheritance) and I need use DQL to query entities of a specific child class wich can be done using "x INSTANCE OF Entity" in WHERE clause. Now I need to put conditions specific for that child class but I get this error:
"Class Person has no association named student_field_1"
Person = Parent Class
Employee = Child class
Student = Child class
is there any way yo cast of somehow tell Doctrine that the Person is actually a Student and to allow me to put Student fields in the WHERE?
© Stack Overflow or respective owner