public function addState(__IFlowState &$state) { $this->_states[$state->getId()] =& $state; if ($state instanceof __StartFlowState) { if ($this->_start_state == null) { $this->_start_state =& $state; } else { throw __ExceptionFactory::getInstance()->createException('Multiple start states in flow ' . $this->_id); } } }