Closed MantisSTS closed 11 years ago
theres already one in there if you look, thing is, theres a fair few of em that cant be done like that, cause of the way we set it up, eg DBO & TPL, but the rest of em can use coreObj::getInstance()
Then why do we keep adding in seperate functions for each individual new class?
consistency i suppose
Imo we should still be using something like the above, so we keep everything consistant and clean.
There is no reason why you cant write a function which has all that in there, even if it is a case of having switch/cases in there rather than separate functions
I guess this is out of disccusion so closing it.
Why is it out of discussion? If you can create a PoC and get it working, then go for it.
Fixed - https://github.com/cybershade/CSCMS/blob/master/core/classes/class.coreobj.php#L372 Used __callStatic() to determine if we are wanting a get*() method, if that comes back as true && ( classExists && no method exists in coreObj for it ){ then init the obj & call to the method with the args }
I propose we add a new method of object instantiation, rather than having multiple methods to instantiate the object required, we have 1 method which does it. Ie:
That was just a quick mock up, but you get the point.
The reason I propose this is to clean up the coreObj class, as atm its a mess.