forked from AppStateESS/InternshipInventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorkflowState.php
43 lines (34 loc) · 908 Bytes
/
WorkflowState.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Intern;
abstract class WorkflowState {
const friendlyName = '';
const sortIndex = 5;
/**
* Returns an array of the valid WorkflowTransitions for this State.
* @return Array<WorkflowTransition>
*/
public function getTransitions(Internship $i)
{
return WorkflowTransitionFactory::getTransitionsFromState($this, $i);
}
public function getName(){
return get_called_class();
}
/**
* Returns the class name *without* the namespace
*/
public function getClassName()
{
preg_match('/\w*$/', get_called_class(), $matches);
return $matches[0];
}
public function getFriendlyName(){
$class = $this->getName();
return $class::friendlyName;
}
public function getSortIndex()
{
$class = get_called_class();
return $class::sortIndex;
}
}