Finite\StateMachine\StateMachine::__construct PHP Method

__construct() public method

public __construct ( object $object = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null, Finite\State\Accessor\StateAccessorInterface $stateAccessor = null )
$object object
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$stateAccessor Finite\State\Accessor\StateAccessorInterface
    public function __construct($object = null, EventDispatcherInterface $dispatcher = null, StateAccessorInterface $stateAccessor = null)
    {
        $this->object = $object;
        $this->dispatcher = $dispatcher ?: new EventDispatcher();
        $this->stateAccessor = $stateAccessor ?: new PropertyPathStateAccessor();
    }

Usage Example

Esempio n. 1
0
 /**
  * Loads a issue state machine.
  *
  * @param \Kreta\Component\Issue\Model\Interfaces\IssueInterface                 $issue       The issue
  * @param \Kreta\Component\Workflow\Model\Interfaces\StatusInterface[]           $statuses    A collection of
  *                                                                                            statuses
  * @param \Kreta\Component\Workflow\Model\Interfaces\StatusTransitionInterface[] $transitions A collection of
  *                                                                                            transitions
  *
  * @return $this self Object
  */
 public function load(IssueInterface $issue, $statuses, $transitions)
 {
     $this->statuses = $statuses;
     $this->transitions = $transitions;
     parent::__construct($issue, null);
     $this->createLoader()->load($this);
     $this->initialize();
     return $this;
 }
All Usage Examples Of Finite\StateMachine\StateMachine::__construct