const DB_COLUMN_LISTEN_PORT = 'listen_port';
const DB_COLUMN_PRIVATE_KEY = 'private_key';
const DB_COLUMN_PRIVATE_KEY_HASH = 'private_key_hash';
- const DB_COLUMN_NODE_TYPE = 'node_type';
+ const DB_COLUMN_NODE_MODE = 'node_mode';
/**
* Protected constructor
assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
// Add public node data
- $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_TYPE , $requestInstance->getRequestElement('mode'));
+ $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE , $requestInstance->getRequestElement('mode'));
$dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP , $ipPort[0]);
$dataSetInstance->addCriteria(self::DB_COLUMN_LISTEN_PORT , $ipPort[1]);
$dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID , $nodeInstance->getNodeId());
const DB_COLUMN_SESSION_ID = 'session_id';
const DB_COLUMN_PRIVATE_KEY = 'private_key';
const DB_COLUMN_PRIVATE_KEY_HASH = 'private_key_hash';
- const DB_COLUMN_NODE_TYPE = 'node_type';
+ const DB_COLUMN_NODE_MODE = 'node_mode';
/**
* Protected constructor
$searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// Search for the node number one which is hard-coded the default
- $searchInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_NR, 1);
- $searchInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_TYPE, $nodeInstance->getRequestInstance()->getRequestElement('mode'));
+ $searchInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_NR , 1);
+ $searchInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_MODE, $nodeInstance->getRequestInstance()->getRequestElement('mode'));
$searchInstance->setLimit(1);
// Get a result back
// Get node list
$nodeList = array();
while ($resultInstance->next()) {
+ // Get current element (it should be an array, and have at least 1 entry)
+ $current = $resultInstance->current();
+ assert(is_array($current));
+ assert(count($current) > 0);
+
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: current()=' . $resultInstance->current());
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: current(' . count($current) . ')[' . gettype($current) . ']=' . print_r($current, TRUE));
// Add this entry
- array_push($nodeList, $resultInstance->current());
+ array_push($nodeList, $current);
} // END - while
// Save last exception