Added optional $requestInstance parameter
authorRoland Häder <roland@mxchange.org>
Fri, 8 Feb 2013 17:24:41 +0000 (17:24 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 8 Feb 2013 17:24:41 +0000 (17:24 +0000)
inc/classes/interfaces/criteria/extended/class_AddableCriteria.php
inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php
inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php
inc/classes/main/points/class_UserPoints.php
inc/classes/main/result/class_DatabaseResult.php

index fd6e685378b4fdca642d115dd69b60cc187630cd..c98cad3f4b958f4f30b7de749575329058ff10e0 100644 (file)
@@ -25,45 +25,11 @@ interface Addable extends FrameworkInterface {
        /**
         * Adds registration elements to a given dataset instance
         *
-        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @param       $criteriaInstance       An instance of a StoreableCriteria class
+        * @param       $requestInstance        An instance of a Requestable class
         * @return      void
         */
-       function addElementsToDataSet (StoreableCriteria $criteriaInstance);
-}
-
-// [EOF]
-?>
-<?php
-/**
- * An interface for classes which are allowed to add criteria
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface Addable extends FrameworkInterface {
-       /**
-        * Adds registration elements to a given dataset instance
-        *
-        * @param       $criteriaInstance       An instance of a storeable criteria
-        * @return      void
-        */
-       function addElementsToDataSet (StoreableCriteria $criteriaInstance);
+       function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL);
 }
 
 // [EOF]
index c306eecb43b74605873e4bd3445f540c6104bee1..322d5fdf8738c7d1f846e71f586a4304e9863afe 100644 (file)
@@ -75,7 +75,7 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper implements ManageableAccou
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_USERNAME);
 
                // Add registration elements to the dataset
-               $registrationInstance->addElementsToDataSet($dataSetInstance);
+               $registrationInstance->addElementsToDataSet($dataSetInstance, NULL);
 
                // "Insert" this request instance completely into the database
                $this->queryInsertDataSet($dataSetInstance);
@@ -123,7 +123,7 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper implements ManageableAccou
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_USERNAME);
 
                // Add all update criteria to the database set
-               $resultInstance->addElementsToDataSet($dataSetInstance);
+               $resultInstance->addElementsToDataSet($dataSetInstance, NULL);
 
                // "Update" this request with the database
                $this->getDatabaseInstance()->queryUpdateDataSet($dataSetInstance);
index eb2a985c57dc4cc9a975804020a776f8cd3b85ba..0af3866c081195e43050edfaa0ad6572fd5801a8 100644 (file)
@@ -77,7 +77,7 @@ class UserPointsDatabaseWrapper extends BaseDatabaseWrapper implements BookableP
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_POINTS_UID);
 
                // Add registration elements to the dataset
-               $pointsInstance->addElementsToDataSet($dataSetInstance);
+               $pointsInstance->addElementsToDataSet($dataSetInstance, NULL);
 
                // "Insert" this request instance completely into the database
                $this->queryInsertDataSet($dataSetInstance);
@@ -94,7 +94,7 @@ class UserPointsDatabaseWrapper extends BaseDatabaseWrapper implements BookableP
                $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_USER_POINTS));
 
                // Add all update criteria to the database set
-               $resultInstance->addElementsToDataSet($dataSetInstance);
+               $resultInstance->addElementsToDataSet($dataSetInstance, NULL);
 
                // Add seach criteria
                $dataSetInstance->setSearchInstance($resultInstance->getUpdateInstance()->getSearchInstance());
index b9f9d12595eeaaad2f38899a2fa5f5c7b8eab5f8..13b210eba54818d47fc5e6be4070f55ed785aaae 100644 (file)
@@ -166,10 +166,11 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
        /**
         * Adds registration elements to a given dataset instance
         *
-        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @param       $criteriaInstance       An instance of a StoreableCriteria class
+        * @param       $requestInstance        An instance of a Requestable class
         * @return      void
         */
-       public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
+       public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) {
                // Add user id
                $criteriaInstance->addCriteria(UserPointsDatabaseWrapper::DB_COLUMN_POINTS_UID, $this->getUserInstance()->getUserId());
 
index dd2159395a56f349c991c4aba409ed1ca2bf1ef5..f143a540b50999a8eda8b899f077ee3e4a49951b 100644 (file)
@@ -318,10 +318,11 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        /**
         * Adds registration elements to a given dataset instance
         *
-        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @param       $criteriaInstance       An instance of a StoreableCriteria class
+        * @param       $requestInstance        An instance of a Requestable class
         * @return      void
         */
-       public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
+       public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) {
                // Walk only through out-dated columns
                foreach ($this->outDated as $key => $dummy) {
                        // Does this key exist?