initial commit
[namibia] / module / Dispute / src / Dispute / Workflow.php
1 <?php
2 namespace Dispute;
3
4
5
6 /**
7  * A workflow.
8  * @author andre.fourie
9  */
10 class Workflow extends \Workspace\Workflow
11 {
12
13         /**
14          * @var string
15          */
16         protected $namespace = __NAMESPACE__;
17         /**
18          * @var string
19          */
20         protected $parentFeature = 'Auction';
21         /**
22          * @var string
23          */
24         protected $rootEntity    = 'Dispute';
25         /**
26          * @var string
27          */
28         protected $rootIdField   = 'dispute';
29         /**
30          * @var string
31          */
32         protected $initState     = 'Active';
33         /**
34          * @var string
35          */
36         protected $initTrigger   = false;
37         /**
38          * @var string
39          */
40         protected $primaryEntity = 'Dispute';
41         /**
42          * @var array
43          */
44         protected $entityMap = array(
45                         'Dispute'                       => '\Dispute\Entity\Dispute',
46                         'Auction'                       => '\Auction\Entity\Auction',
47                         'FromCompany'           => '\Company\Entity\Company',
48                         'AgainstCompany'        => '\Company\Entity\Company',
49                         'CreatedBy'             => '\User\Entity\Profile'
50         );
51         /**
52          * @var array
53          */
54         protected $linkMap = array();
55         /**
56          * @var array
57          */
58         protected $listen = array();
59         /**
60          * @var array
61          */
62         protected $reclaim = array();
63         /**
64          * @var array
65          */
66         protected $stateLabel = array(
67                 'PendingPayment' => 'Pending Payment',
68                 'InProgress'     => 'In Progress'
69         );
70         /**
71          * @var array
72          */
73         protected $stateMap = array(
74                         'Global' => array(
75                                 'Actions' => array(
76                                         'Dispute.Grid'                  => array(),
77           'Dispute.GridDef'             => array(),
78                                         'Dispute.AdminGrid'             => array(),
79                                         'Dispute.Create'                        => array()
80                                 )
81                         ),
82                         'Pending Payment' => array(
83                                 'Actions' => array(
84                                         'Dispute.View'              => array(),
85                                         'Dispute.Update'            => array()
86                                 ),
87                                 'Routes' => array(
88                                         'Workflow.MoveToNew'  => array(
89                                                         'Destination' => 'This.New'
90                                         ),
91                                         'Workflow.MoveToInProgress' => array(
92                                                         'Destination' => 'This.InProgress'
93                                         ),
94                                         'Workflow.Resolve'    => array(
95                                                         'Destination' => 'This.Resolved'
96                                         )
97                                 )
98                         ),
99                         'New' => array(
100                                 'Actions' => array(
101                                         'Dispute.View'              => array(),
102                                         'Dispute.Update'            => array()
103                                 ),
104                                 'Routes' => array(
105                                         'Workflow.MoveToInProgress' => array(
106                                                         'Destination' => 'This.InProgress'
107                                         ),
108                                         'Workflow.Resolve'    => array(
109                                                         'Destination' => 'This.Resolved'
110                                         )
111                                 )
112                         ),
113                         'In Progress' => array(
114                                 'Actions' => array(
115                                         'Dispute.View'              => array(),
116                                         'Dispute.Update'            => array()
117                                 ),
118                                 'Routes' => array(
119                                         'Workflow.Resolve'    => array(
120                                                         'Destination' => 'This.Resolved'
121                                         )
122                                 )
123                         ),
124                         'Resolved' => array(
125                                 'Actions' => array(
126                                         'Dispute.View'                          => array(),
127                                         'Dispute.Update'            => array()
128                                 )
129                         )
130         );
131
132
133 }