X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fpoints%2Fclass_UserPoints.php;h=2673f05515180d04f52ceb070728eeb00051fb91;hp=f4dbad4d5cb57280a2d94ae915b47b4f17d56096;hb=2aa1e932d56ada938159b6955a27eed0b59bd9cd;hpb=afc9d5686bbf81324095f687ec007c1818c7dc21 diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index f4dbad4d..2673f055 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -63,6 +63,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo // Get result back $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance); + // Advance to first entry by default + $resultInstance->next(); + // Set it in this instance $pointsInstance->setResultInstance($resultInstance); @@ -103,6 +106,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo // Get the required points entry $requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points'); + // Rewind always + $this->getResultInstance()->rewind(); + // Do we have an entry? if ($this->getResultInstance()->next()) { // Get the entry @@ -123,6 +129,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo * @return void */ function bookPointsDirectly ($amount) { + // Rewind always + $this->getResultInstance()->rewind(); + // Do we have an entry? if ($this->getResultInstance()->next()) { // Get the entry