]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/states/node/class_BaseNodeState.php
Moved setter/getter and attribute itself 'packageTags' to a more generic class BaseHu...
[hub.git] / application / hub / main / states / node / class_BaseNodeState.php
index 2109465ebb63e6c339174d5d1234587dcae15657..5c615e33c709b5e758f942c1876bcbe99d1316b9 100644 (file)
@@ -77,6 +77,21 @@ class BaseNodeState extends BaseState {
                        throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
                } // END - if
        }
+
+       /**
+        * Validates if the state is 'announcement_completed' or throws an
+        * exception if it is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'active' and not 'announced'
+        */
+       public function validateNodeStateIsAnnouncementCompleted () {
+               // Just compare it...
+               if (!$this instanceof NodeAnnouncementCompletedState) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
 }
 
 // [EOF]