]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/dht/class_DhtRecipientDiscovery.php
Continued with hub development:
[hub.git] / application / hub / main / discovery / dht / class_DhtRecipientDiscovery.php
index 3ca916f909549eb201e2114fddc311a23b81b0e6..f9c2a46304dd7726dd8e7c5a4d4d911ef42a2f09 100644 (file)
@@ -41,6 +41,12 @@ class DhtRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableDht
                // Get an instance of this class
                $discoveryInstance = new DhtRecipientDiscovery();
 
+               // Get a DHT instance
+               $dhtInstance = DhtObjectFactory::createDhtObjectInstance('node');
+
+               // Set it here
+               $discoveryInstance->setDhtInstance($dhtInstance);
+
                // Return the prepared instance
                return $discoveryInstance;
        }
@@ -50,10 +56,13 @@ class DhtRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableDht
         *
         * @param       $packageData    Valid package data array
         * @return      $recipients             An indexed array with DHT recipients
-        * @todo        0% done
         */
        public function resolveRecipientsByPackageData (array $packageData) {
-               $this->partialStub('Please implement this method. packageData[]=' . print_r($packageData, TRUE));
+               // Use facade to get recipients back
+               $recipients = $this->getDhtInstance()->findRecipientsByPackageData($packageData);
+
+               // Return it
+               return $recipients;
        }
 }