From: Roland Haeder Date: Sat, 8 Feb 2014 21:56:37 +0000 (+0100) Subject: Added missing methods to interface and BaseDht class. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;ds=inline;h=f21b04b01fec7385b2ae4a3d07b6306b64c82082;p=hub.git Added missing methods to interface and BaseDht class. Signed-off-by: Roland Haeder --- diff --git a/application/hub/interfaces/distributable/class_Distributable.php b/application/hub/interfaces/distributable/class_Distributable.php index f3aadbea3..43e7bd85d 100644 --- a/application/hub/interfaces/distributable/class_Distributable.php +++ b/application/hub/interfaces/distributable/class_Distributable.php @@ -120,6 +120,21 @@ interface Distributable extends FrameworkInterface { * @return void */ function initEntryPublication (); + + /** + * Checks whether there are entries pending publication + * + * @return $isPending Whether there are entries pending publication + */ + function hasEntriesPendingPublication (); + + /** + * Publishes next entry found in stack. This method shall also update the + * corresponding dabase entry. + * + * @return void + */ + function publishEntry (); } // [EOF] diff --git a/application/hub/main/dht/class_BaseDht.php b/application/hub/main/dht/class_BaseDht.php index 9f5cb4c79..ad09de3e6 100644 --- a/application/hub/main/dht/class_BaseDht.php +++ b/application/hub/main/dht/class_BaseDht.php @@ -162,6 +162,29 @@ abstract class BaseDht extends BaseHubSystem { $this->getStackerInstance()->pushNamed(self::STACKER_NAME_PENDING_PUBLISHING, $current); } // END - while } + + /** + * Checks whether there are entries pending publication + * + * @return $isPending Whether there are entries pending publication + */ + public function hasEntriesPendingPublication () { + // Determine it if it is not empty + $isPending = ($this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_PENDING_PUBLISHING) === FALSE); + + // Return status + return $isPending; + } + + /** + * Publishes next entry found in stack. This method shall also update the + * corresponding dabase entry. + * + * @return void + */ + public function publishEntry () { + $this->partialStub('Unimplemented method.'); + } } // [EOF]