From 2bd7fcf2cb5fd7001379008168443d4dfea05a69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 30 May 2012 21:26:47 +0000 Subject: [PATCH] Added search (criteria) instance to updateNodeByMessageData() to make updates possible --- .../hub/interfaces/wrapper/class_NodeListWrapper.php | 3 ++- .../database/wrapper/node/class_NodeListDatabaseWrapper.php | 6 +++++- .../main/handler/message-types/class_BaseMessageHandler.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/application/hub/interfaces/wrapper/class_NodeListWrapper.php b/application/hub/interfaces/wrapper/class_NodeListWrapper.php index 702ff0d03..3bfc020c8 100644 --- a/application/hub/interfaces/wrapper/class_NodeListWrapper.php +++ b/application/hub/interfaces/wrapper/class_NodeListWrapper.php @@ -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] diff --git a/application/hub/main/database/wrapper/node/class_NodeListDatabaseWrapper.php b/application/hub/main/database/wrapper/node/class_NodeListDatabaseWrapper.php index 541bde12f..5d1239485 100644 --- a/application/hub/main/database/wrapper/node/class_NodeListDatabaseWrapper.php +++ b/application/hub/main/database/wrapper/node/class_NodeListDatabaseWrapper.php @@ -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); diff --git a/application/hub/main/handler/message-types/class_BaseMessageHandler.php b/application/hub/main/handler/message-types/class_BaseMessageHandler.php index 4c8f30fc5..d4adb4a58 100644 --- a/application/hub/main/handler/message-types/class_BaseMessageHandler.php +++ b/application/hub/main/handler/message-types/class_BaseMessageHandler.php @@ -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); -- 2.39.5