From: Roland Häder Date: Fri, 22 Feb 2013 00:59:32 +0000 (+0000) Subject: Remember searchInstance here X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=43ffe9ff7730d835d627c9121a878d490cf4e478;p=hub.git Remember searchInstance here --- diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index 3a70b2959..1819c95bb 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -313,6 +313,9 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $searchInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_TYPE, $this->getRequestInstance()->getRequestElement('mode')); $searchInstance->setLimit(1); + // Remember it for later usage + $this->setSearchInstance($searchInstance); + // Get a random string $randomString = $this->generateRamdomString(255); @@ -344,7 +347,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * "tables". This allows a smooth update for the underlaying * database table. */ - $this->generatePrivateKeyAndHash($searchInstance); + $this->generatePrivateKeyAndHash($this->getSearchInstance()); } else { // Get the node id from result and set it $this->setPrivateKey(base64_decode($this->getField(NodeInformationDatabaseWrapper::DB_COLUMN_PRIVATE_KEY))); @@ -358,7 +361,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * Generate it in a private method (no confusion with 'private * method access' and 'private key' here! ;-)). */ - $this->generatePrivateKeyAndHash($searchInstance); + $this->generatePrivateKeyAndHash($this->getSearchInstance()); } }