<?php
/**
- * A general Node state class
+ * A general node state class
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
// Call parent constructor
parent::__construct($className);
}
+
+ /**
+ * Validates wether the state is 'active' or throws an exception if
+ * it is every other state.
+ *
+ * @return void
+ * @throws InvalidStateException If the state is not 'active'
+ */
+ public function validateNodeStateIsActive () {
+ // Just compare it...
+ if (!$this instanceof NodeActiveState) {
+ // Throw the exception
+ throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+ } // END - if
+ }
}
// [EOF]