ShipSimuBaseUser.ifUserHasRequiredPoints ( action  )  [inherited]

Checks wether the user has the required amount of points left for the specified action.

Parameters:
$action The action or configuration entry plus prefix the user wants to perform
Returns:
$hasRequired Wether the user has the required points

Definition at line 69 of file class_ShipSimuBaseUser.php.

References ObjectFactory.createObjectByConfiguredName(), and Registry.getRegistry().

00069                                                           {
00070                 // Default is that everyone is poor... ;-)
00071                 $hasRequired = false;
00072 
00073                 // Get a points instance from registry
00074                 $pointsInstance = Registry::getRegistry()->getInstance('points');
00075 
00076                 // Is there an instance?
00077                 if (is_null($pointsInstance)) {
00078                         // Then create one
00079                         $pointsInstance = ObjectFactory::createObjectByConfiguredName('user_ppints_class', array($this));
00080 
00081                         // And store it in registry
00082                         Registry::getRegistry()->addInstance('points', $pointsInstance);
00083                 } // END - if
00084 
00085                 // Just forward this request to the user points class
00086                 $hasRequired = $pointsInstance->ifUserHasRequiredPoints($action);
00087 
00088                 // Return the result
00089                 return $hasRequired;
00090         }

Here is the call graph for this function:


Generated on Mon Dec 8 01:18:27 2008 for Ship-Simulator by  doxygen 1.5.6