Checks wether the user has the required amount of points left for the specified action.
Definition at line 63 of file class_UserPoints.php. References BaseFrameworkSystem.$resultInstance, ObjectFactory.createObjectByConfiguredName(), BaseFrameworkSystem.getConfigInstance(), BaseFrameworkSystem.getUserInstance(), and BaseFrameworkSystem.partialStub(). 00063 { 00064 // Default is that everyone is poor... ;-) 00065 $hasRequired = false; 00066 00067 // Get the required points entry 00068 $requiredPoints = $this->getConfigInstance()->readConfig($action . '_action_points'); 00069 00070 // Get a wrapper instance 00071 $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_points_db_wrapper_class'); 00072 00073 // Now get a search criteria and set the user's name as criteria 00074 $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); 00075 $criteriaInstance->addCriteria("points_uid", $this->getUserInstance()->getUserName()); 00076 $criteriaInstance->setLimit(1); 00077 00078 // Get result back 00079 $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance); 00080 00081 // Do we have an entry? 00082 if ($resultInstance->next()) { 00083 // @TODO Load points here 00084 $this->partialStub("Load points here for comparison."); 00085 } // END - if 00086 00087 // Return the result 00088 return $hasRequired; 00089 }
Here is the call graph for this function:
![]()
|
1.5.6