]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/points/class_UserPoints.php
Continued:
[core.git] / framework / main / classes / points / class_UserPoints.php
index e26856ad240f0b512a3c3930c6943f9c2d59e6a2..5370599b1d9d7aabcef5f83f4492ba7588c8917a 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\User\Points;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
-use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
+use Org\Mxchange\CoreFramework\Factory\Database\Frontend\DatabaseFrontendFactory;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -72,14 +72,14 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Add search criteria
-               $searchInstance->addCriteria(UserPointsDatabaseWrapper::DB_COLUMN_POINTS_UID, $userInstance->getUserId());
+               $searchInstance->addCriteria(UserPointsDatabaseFrontend::DB_COLUMN_POINTS_UID, $userInstance->getUserId());
                $searchInstance->setLimit(1);
 
-               // Get a wrapper instance
-               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('user_points_db_wrapper_class');
+               // Get a frontend instance
+               $frontendInstance = DatabaseFrontendFactory::createFrontendByConfiguredName('user_points_db_frontend_class');
 
                // Get result back
-               $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
+               $resultInstance = $frontendInstance->doSelectByCriteria($searchInstance);
 
                // Advance to first entry by default
                $resultInstance->next();
@@ -156,19 +156,19 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                        $currentEntry = $this->getResultInstance()->current();
 
                        // Add the points
-                       $amount += $currentEntry[UserPointsDatabaseWrapper::DB_COLUMN_POINTS];
+                       $amount += $currentEntry[UserPointsDatabaseFrontend::DB_COLUMN_POINTS];
 
                        // Now get another criteria
                        $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
 
                        // And add our both entries
-                       $updateInstance->addCriteria(UserPointsDatabaseWrapper::DB_COLUMN_POINTS, $amount);
+                       $updateInstance->addCriteria(UserPointsDatabaseFrontend::DB_COLUMN_POINTS, $amount);
 
                        // Add the search criteria for searching for the right entry
                        $updateInstance->setSearchInstance($searchInstance);
 
-                       // Set wrapper class name
-                       $updateInstance->setWrapperConfigEntry('user_points_db_wrapper_class');
+                       // Set frontend class name
+                       $updateInstance->setFrontendConfigEntry('user_points_db_frontend_class');
 
                        // Remember the update in database result
                        $this->getResultInstance()->add2UpdateQueue($updateInstance);
@@ -177,7 +177,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                        $this->setAmount($amount);
 
                        // Create the new entry
-                       $wrapperInstance->insertUserPoints($this);
+                       $frontendInstance->insertUserPoints($this);
                }
        }
 
@@ -190,10 +190,10 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
         */
        public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
                // Add user id
-               $criteriaInstance->addCriteria(UserPointsDatabaseWrapper::DB_COLUMN_POINTS_UID, $this->getUserInstance()->getUserId());
+               $criteriaInstance->addCriteria(UserPointsDatabaseFrontend::DB_COLUMN_POINTS_UID, $this->getUserInstance()->getUserId());
 
                // Add amount
-               $criteriaInstance->addCriteria(UserPointsDatabaseWrapper::DB_COLUMN_POINTS, $this->getAmount());
+               $criteriaInstance->addCriteria(UserPointsDatabaseFrontend::DB_COLUMN_POINTS, $this->getAmount());
        }
 
 }