I have a class that returns an array of instances of itself.
so my class is item, and I have a function called getallitems, which gives me all items in the database. To do this, I create an array of itself and push instances on the end.
I have to create a new instance on each loop. Is there a way to do this without knowing my class name?
foreach ($multipleresultsfromdb as $item_single)
$tmpNewInstance = new CategoryClass;
$arrayToReturn = $tmpNewInstance->setfromdbrow($item_single);
I want to do this without knowing that CategoryClass is the class name.