상속: implements State
예제 #1
0
 public function __construct()
 {
     // 默认为stateA
     $this->_state = ConcreteStateA::getInstance();
 }
예제 #2
0
 public function handle(Context $context)
 {
     printf("Concrete State B handle method\n");
     $context->setState(ConcreteStateA::getInstance());
 }