Suppose you declare a simple "license" table in a doctrine schema, consisting say of 3 fields, name, licenseNumber, expirationDate
.
You can create a simple query to instantiate the collection of license objects. But what if you wanted to add a "virtual" field to it, for example,select *, (now() > expirationDate) as expired from license
(in DQL, I'm using SQL as shorthand here).
Is there any way to get doctrine to make the "expired" calculated field retrievable as an attribute of the object? This is a trivial example to illustrate the point, but it could be quite helpful for more complicated calculated queries, or else I'm misunderstanding something.