* 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 NodeListDatabaseWrapper extends BaseDatabaseWrapper implements Registerable {
+class NodeListDatabaseWrapper extends BaseDatabaseWrapper implements NodeListWrapper Registerable {
// Table names
const DB_TABLE_NODE_LIST = 'node_list';
// Run the "INSERT" query
$this->queryInsertDataSet($dataSetInstance);
}
+
+ /**
+ * Updates an existing entry in node list
+ *
+ * @param $messageData An array of all message data
+ * @param $handlerInstance An instance of a HandleableMessage class
+ * @return void
+ */
+ public function updateNodeByMessageData (array $messageData, HandleableMessage $handlerInstance) {
+ // Get a data set instance
+ $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_LIST));
+
+ // Set primary key (session id)
+ $dataSetInstance->setUniqueKey('node_' . XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID);
+
+ // Add all array elements
+ $handlerInstance->addArrayToDataSet($dataSetInstance, $messageData);
+
+ // Run the "UPDATE" query
+ $this->queryUpdateDataSet($dataSetInstance);
+ }
}
// [EOF]