]> git.mxchange.org Git - hub.git/commitdiff
Also include accepted node types from own node
authorRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2013 04:16:20 +0000 (04:16 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2013 04:16:20 +0000 (04:16 +0000)
application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php

index 83c5ec4e424d67f2c3ebf60ce6de4e4ed2d63d1a..f9d74bdad5d6074d7950a70adf2187646c889e75 100644 (file)
@@ -33,6 +33,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
        const DB_COLUMN_PRIVATE_KEY      = 'private_key';
        const DB_COLUMN_PRIVATE_KEY_HASH = 'private_key_hash';
        const DB_COLUMN_NODE_MODE        = 'node_mode';
+       const DB_COLUMN_ACCEPTED_OBJECTS = 'accepted_object_types';
 
        /**
         * Protected constructor
@@ -84,6 +85,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Make sure both is valid
                assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
 
+               // Get an array of all accepted object types
+               $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
+
                // Add public node data
                $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE       , $requestInstance->getRequestElement('mode'));
                $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP     , $ipPort[0]);
@@ -91,6 +95,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $nodeInstance->getNodeId());
                $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $nodeInstance->getSessionId());
                $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $nodeInstance->getPrivateKeyHash());
+               $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
 
                // Return it
                return $dataSetInstance;