From f21b04b01fec7385b2ae4a3d07b6306b64c82082 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 8 Feb 2014 22:56:37 +0100 Subject: [PATCH] Added missing methods to interface and BaseDht class. Signed-off-by: Roland Haeder --- .../distributable/class_Distributable.php | 15 ++++++++++++ application/hub/main/dht/class_BaseDht.php | 23 +++++++++++++++++++ 2 files changed, 38 insertions(+) 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] -- 2.39.5