]> git.mxchange.org Git - hub.git/commitdiff
Added search (criteria) instance to updateNodeByMessageData() to make updates possible
authorRoland Häder <roland@mxchange.org>
Wed, 30 May 2012 21:26:47 +0000 (21:26 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 30 May 2012 21:26:47 +0000 (21:26 +0000)
application/hub/interfaces/wrapper/class_NodeListWrapper.php
application/hub/main/database/wrapper/node/class_NodeListDatabaseWrapper.php
application/hub/main/handler/message-types/class_BaseMessageHandler.php

index 702ff0d03ad1e716e0e0b6b5057cfdc007f5d0c8..3bfc020c8dff9ac6617c906a1440843d44e1e50f 100644 (file)
@@ -54,9 +54,10 @@ interface NodeListWrapper extends FrameworkInterface {
         *
         * @param       $messageData            An array of all message data
         * @param       $handlerInstance        An instance of a HandleableMessage class
+        * @param       $searchInstance         An instance of LocalSearchCriteria class
         * @return      void
         */
-       function updateNodeByMessageData (array $messageData, HandleableMessage $handlerInstance);
+       function updateNodeByMessageData (array $messageData, HandleableMessage $handlerInstance, LocalSearchCriteria $searchInstance);
 }
 
 // [EOF]
index 541bde12f8d017e2d25459d946ed0249f31d7f9c..5d123948566ec8243e061001c97be3258f752333 100644 (file)
@@ -189,12 +189,16 @@ class NodeListDatabaseWrapper extends BaseDatabaseWrapper implements NodeListWra
         *
         * @param       $messageData            An array of all message data
         * @param       $handlerInstance        An instance of a HandleableMessage class
+        * @param       $searchInstance         An instance of LocalSearchCriteria class
         * @return      void
         */
-       public function updateNodeByMessageData (array $messageData, HandleableMessage $handlerInstance) {
+       public function updateNodeByMessageData (array $messageData, HandleableMessage $handlerInstance, LocalSearchCriteria $searchInstance) {
                // Get a data set instance
                $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_LIST));
 
+               // Add search instance
+               $dataSetInstance->setSearchInstance($searchInstance);
+
                // Set primary key (session id)
                $dataSetInstance->setUniqueKey('node_' . XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID);
 
index 4c8f30fc5fe9cbd70a76bcb85a9a9fdd206f29e4..d4adb4a58d27a18d59181784962b8966cfd008a3 100644 (file)
@@ -129,7 +129,7 @@ abstract class BaseMessageHandler extends BaseHandler {
                // Is there already an entry?
                if ($resultInstance->next()) {
                        // Entry found, so update it
-                       $wrapperInstance->updateNodeByMessageData($messageData, $this);
+                       $wrapperInstance->updateNodeByMessageData($messageData, $this, $searchInstance);
                } else {
                        // Nothing found, so register it
                        $wrapperInstance->registerNodeByMessageData($messageData, $this);