izzum\statemachine\Transition::getStateFrom PHP Метод

getStateFrom() публичный Метод

get the state this transition points from
public getStateFrom ( ) : State
Результат State
    public function getStateFrom()
    {
        return $this->state_from;
    }

Usage Example

Пример #1
0
 /**
  * add an outgoing transition from this state.
  *
  * TRICKY: this method should be package visibility only,
  * so don't use directly. it is used to set the bidirectional association
  * for State and Transition from a Transition instance on the state the transition will be allowed to 
  * run from ('state from').
  *
  * @param Transition $transition            
  * @return boolan yes in case the transition was not on the State already or in case of an invalid transition
  */
 public function addTransition(Transition $transition)
 {
     $output = false;
     // check all existing transitions.
     if (!$this->hasTransition($transition->getName()) && $transition->getStateFrom()->getName() == $this->getName() && !$this->isFinal() && !$this->isRegex()) {
         $output = true;
         $this->transitions[] = $transition;
     }
     return $output;
 }
All Usage Examples Of izzum\statemachine\Transition::getStateFrom