]> git.mxchange.org Git - city.git/blobdiff - application/city/main/states/city/class_BaseCityState.php
Renamed exception (in 'core') + updated 'core'.
[city.git] / application / city / main / states / city / class_BaseCityState.php
index fb05751dc55f51d4a6360bfbcaf7c88d4d2b6527..00a43b6403ed3db941b8a3aecd2741a17c879a11 100644 (file)
@@ -38,13 +38,28 @@ class BaseCityState extends BaseState {
         * it is every other state.
         *
         * @return      void
-        * @throws      InvalidStateException   If the state is not 'active'
+        * @throws      UnexpectedStateException        If the state is not 'active'
         */
        public function validateCityStateIsActive () {
                // Just compare it...
                if (!$this instanceof CityActiveState) {
                        // Throw the exception
-                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+                       throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
+
+       /**
+        * Validates whether the state is 'virgin' or throws an exception if
+        * it is every other state.
+        *
+        * @return      void
+        * @throws      UnexpectedStateException        If the state is not 'virgin'
+        */
+       public function validateCityStateIsVirgin () {
+               // Just compare it...
+               if (!$this instanceof CityVirginState) {
+                       // Throw the exception
+                       throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE);
                } // END - if
        }
 }