Hi,

nearly every class is a child of oxSuperCfg.

It can be confusing anyway. Here is a example:

<snip>
$oOrder = oxNew('oxorder');

$oOrder->load($oxid); // just for example, imagine that we have retrieved the orders oxid from somewhere

$orderUser = $oOrder->getUser();
</snip>

What is returned by getUser()?

It's not the user which made the order - like a lot of people would expect - its the active user.

Which makes no sense on this object.

In general, all methods in oxSuperCfg are completly redundant:

- getConfig(): returns result of singleton oxConfig::getInstance()

- getSession(): returns result of oxSession::getInstance()

- getUser(): returns oxUser::loadActiveUser which could be implemented as static method on user object

- isAdmin(): the result is defined as global function in oxfunctions, and it's a config parameter named "blAdmin" anyway.

the unit test functionality of these methods could be implemented in this singletons or static functions. there is no need to have oxSuperCfg, also because it's no "cfg" or "config" anyway.

In addition, not every object needs those methods, but every object has those methods, at the moment.
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to