* Returns a singleton login instance for given request instance.
*
* @param $requestInstance An instance of a Requestable class
- * @return $wrapperInstance A database wrapper instance
+ * @return $loginInstance An instance of a login helper (@TODO Use actual interface name)
*/
public static final function createLoginObjectByRequest (Requestable $requestInstance) {
// Get registry instance
// Do we have an instance in the registry?
if ($registryInstance->instanceExists('login_helper')) {
// Then use this instance
- $userInstance = $registryInstance->getInstance('login_helper');
+ $loginInstance = $registryInstance->getInstance('login_helper');
} else {
// Probe on member instance
try {
// Get class name
- $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('user_class');
+ $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('user_login_class');
// Try to instance it
- $userInstance = call_user_func_array(array($className, 'createMemberByRequest'), array($requestInstance));
+ $loginInstance = call_user_func_array(array($className, 'createMemberByRequest'), array($requestInstance));
} catch (UnexpectedGuestAccountException $e) {
// Then try it with guest account
- $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('guest_class');
+ $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('guest_login_class');
// Try to instance it
- $userInstance = call_user_func_array(array($className, 'createGuestByRequest'), array($requestInstance));
+ $loginInstance = call_user_func_array(array($className, 'createGuestByRequest'), array($requestInstance));
}
// Set the instance in registry for further use
- $registryInstance->addInstance('login_helper', $userInstance);
+ $registryInstance->addInstance('login_helper', $loginInstance);
}
// Return the instance
- return $userInstance;
+ return $loginInstance;
}
}