Overview

Namespaces

  • Mothership
    • Exception
      • StateMachine
    • StateMachine

Classes

  • Mothership\StateMachine\StateMachineAbstract
  • Mothership\StateMachine\Status
  • Mothership\StateMachine\Transition
  • Mothership\StateMachine\WorkflowAbstract

Interfaces

  • Mothership\StateMachine\StateMachineInterface
  • Mothership\StateMachine\StatusInterface
  • Mothership\StateMachine\TransitionInterface
  • Mothership\StateMachine\WorkflowInterface

Exceptions

  • Mothership\Exception\ExceptionAbstract
  • Mothership\Exception\StateMachine\StateMachineAdapterException
  • Mothership\Exception\StateMachine\StateMachineException
  • Mothership\Exception\StateMachine\StatusException
  • Mothership\Exception\StateMachine\TransitionException
  • Mothership\Exception\StateMachine\WorkflowException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: /**
 3:  * Magento
 4:  *
 5:  * NOTICE OF LICENSE
 6:  *
 7:  * This source file is subject to the Open Software License (OSL 3.0)
 8:  * that is bundled with this package in the file LICENSE.txt.
 9:  * It is also available through the world-wide-web at this URL:
10:  * http://opensource.org/licenses/osl-3.0.php
11:  * If you did not receive a copy of the license and are unable to
12:  * obtain it through the world-wide-web, please send an email
13:  * to license@magentocommerce.com so we can send you a copy immediately.
14:  *
15:  * DISCLAIMER
16:  *
17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
18:  * versions in the future. If you wish to customize Magento for your
19:  * needs please refer to http://www.magentocommerce.com for more information.
20:  *
21:  * @category  Mothership
22:  * @package   Mothership_StateMachine
23:  * @author    Maurizio Brioschi <brioschi@mothership.de>
24:  * @copyright Copyright (c) 2015 Mothership GmbH
25:  * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
26:  * @link      http://www.mothership.de/
27:  */
28: 
29: 
30: namespace Mothership\StateMachine;
31: 
32: use Mothership\StateMachine\StatusInterface;
33: use Mothership\StateMachine\TransictionInterface;
34: 
35: interface WorkflowInterface
36: {
37:     /**
38:      * Set the inizial state of the workflow
39:      * @return mixed
40:      */
41:     function setInitialState();
42: 
43:     /**
44:      * execute the workflow
45:      * @return mixed
46:      */
47:     function run();
48: 
49:     /**
50:      * Return the current status of the workflow
51:      * @return \Mothership\StateMachine\StatusInterface $status
52:      */
53:     function getCurrentStatus();
54: 
55:     /**
56:      * Set the status of the workflow
57:      * @param \Mothership\StateMachine\StatusInterface $status
58:      * @return mixed
59:      */
60:     function setState(StatusInterface $status);
61: 
62:     /**
63:      * Get the status of the workflow by its name
64:      * @param $name
65:      * @return mixed
66:      */
67:     function getStatus($name);
68: }
69: 
API documentation generated by ApiGen