How to write this SQL query in Doctrine 2.0 (and fetch results)?
(SELECT \'group\' AS type,
CONCAT(u.firstname, \" \", u.surname) as fullname,
g.na
Well, I found maybe the best solution:
/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"group" = "NotificationGroup", "event" = "NotificationEvent"})
*/
class Notification {
// ...
}
And then two classes (NotificationGroup and NotificationEvent) extending Notification:
/**
* @Entity
*/
class NotificationGroup extends Notification {
//...
}
/**
* @Entity
*/
class NotificationEvent extends Notification {
//...
}