I am replacing my old database layer by a new PDO based version.
However i have run into a problem:
When fetching objects using fetchObject
i can pass arguments for the object constructor.
However i am now porting over a class which has several subclasses, all stored in the same table, and i want to use FETCH_CLASSTYPE
. This means that i have to use the regular fetch()
method to which i cant pass constructor arguments.
Is there another way to do this?
I could rename the constructor to something else and call it manually but i would like a clean solution.