__construct() public method

public __construct ( )
示例#1
0
 /**
  * @param object           $subject
  * @param ProcessInterface $process
  * @param string           $stateName
  */
 public function __construct($subject, ProcessInterface $process, $stateName = null, TransitionSelectorInterface $transitonSelector = null)
 {
     parent::__construct();
     $this->subject = $subject;
     if ($stateName) {
         $this->currentState = $process->getState($stateName);
     } else {
         $this->currentState = $process->getInitialState();
     }
     if ($transitonSelector) {
         $this->transitonSelector = $transitonSelector;
     } else {
         $this->transitonSelector = new OneOrNoneActiveTransition();
     }
 }
示例#2
0
 /**
  * @param string $name
  */
 public function __construct($name)
 {
     parent::__construct();
     $this->name = $name;
     $this->metadata = new Nullable();
 }