Used more DatabaseWrapperFactory as one instance of each is fine.
authorRoland Haeder <roland@mxchange.org>
Fri, 3 Jul 2015 14:59:03 +0000 (16:59 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 3 Jul 2015 14:59:03 +0000 (16:59 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/database/frontend/class_NewsDatabaseWrapper.php
inc/classes/main/database/frontend/class_PaymentsDatabaseWrapper.php
inc/classes/main/database/frontend/class_UserDatabaseWrapper.php
inc/classes/main/database/frontend/class_UserPointsDatabaseWrapper.php
inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php
inc/classes/main/points/class_UserPoints.php
inc/classes/main/reader/class_ConsoleNewsReader.php
inc/classes/main/reader/class_DefaultNewsReader.php

index 56b1cbf..4205170 100644 (file)
@@ -2199,7 +2199,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $configEntry = $resultInstance->getUpdateInstance()->getWrapperConfigEntry();
 
                        // Create object instance
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
+                       $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName($configEntry);
 
                        // Yes, then send the whole result to the database layer
                        $wrapperInstance->doUpdateByResult($this->getResultInstance());
index 80a2a8e..328a0e2 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               Add missing own interface for public methods
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class NewsDatabaseWrapper extends BaseDatabaseWrapper {
+class NewsDatabaseWrapper extends BaseDatabaseWrapper implements Registerable {
        // Constants for database table names
        const DB_TABLE_NEWS = 'news';
 
index 485d8d2..6e50f07 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               Add missing own interface for public methods
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class PaymentsDatabaseWrapper extends BaseDatabaseWrapper {
+class PaymentsDatabaseWrapper extends BaseDatabaseWrapper implements Registerable {
        // Constants for exceptions
        const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180;
 
index 16bce71..263a0e8 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserDatabaseWrapper extends BaseDatabaseWrapper implements ManageableAccountWrapper {
+class UserDatabaseWrapper extends BaseDatabaseWrapper implements ManageableAccountWrapper, Registerable {
        // Constants for exceptions
        const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180;
 
index 2431b9f..18eef5b 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserPointsDatabaseWrapper extends BaseDatabaseWrapper implements BookablePointsWrapper {
+class UserPointsDatabaseWrapper extends BaseDatabaseWrapper implements BookablePointsWrapper, Registerable {
        /**
         * Constants for database table names
         */
index 3484bc8..9785bef 100644 (file)
@@ -65,7 +65,7 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis
                $criteriaInstance->setLimit(1);
 
                // Get a wrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('payment_db_wrapper_class');
+               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('payment_db_wrapper_class');
 
                // Get result back
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
index b28e294..428868d 100644 (file)
@@ -58,7 +58,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                $searchInstance->setLimit(1);
 
                // Get a wrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_points_db_wrapper_class');
+               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('user_points_db_wrapper_class');
 
                // Get result back
                $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
index 9f5cc8e..1aa4b61 100644 (file)
@@ -60,7 +60,7 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                $command = $this->getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
+               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('news_db_wrapper_class');
 
                // Next create a searchable criteria instance
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
index 8ff4a9b..9535482 100644 (file)
@@ -60,7 +60,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                $command = $this->getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
+               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('news_db_wrapper_class');
 
                // Next create a searchable criteria instance
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');