]> git.mxchange.org Git - core.git/commitdiff
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 56b1cbfa36bd25465069feb27892b74181983c29..4205170200d1e544d6e3dfe34aa55a21350f6222 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 80a2a8ef460a55893b7060c54f9587e87842fbb6..328a0e295d775ac568c078ed541d9c27ab5d1bb1 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 485d8d2f5dfb97f09139b851879f471c3b3ffcd5..6e50f07e012e3f7edc337c707cbcac34dd214973 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 16bce71df661321461c5b0dd70e8d66c7107c99d..263a0e878aed412b11749cc2ece172693c4fa876 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 2431b9f91a126d29663c13af0392d630a4adfd36..18eef5b985da175d453ca3af2acfb7f418e12605 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 3484bc83c0d34beb6884f5e21ee7f89c2e8a318e..9785bef4e5eb9b99d79e78c447e3713f42872e4c 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 b28e2948bf879509ed84e12413ebdb88c805621b..428868d80ff28b50f697b4da1696113436d4ef68 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 9f5cc8e5a1088ce40397a35b06413510f59a9a06..1aa4b61543c7361b819ce14d92b60db6074dbb45 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 8ff4a9b424a121cd7baf6ceb34e3d534ade9de85..953548284ab05e8300f53cc2efd68a84ef45a9d2 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');