1: | <?php |
2: | namespace Hyperwallet\Model; |
3: | |
4: | /** |
5: | * Represents a V4 Status Transition |
6: | * |
7: | * @property string $token The status transition token |
8: | * @property \DateTime $createdOn The status transition creation date |
9: | * |
10: | * @property string $transition The status transition |
11: | * |
12: | * @property string $fromStatus The old status |
13: | * @property string $toStatus The new status |
14: | * @property string $notes The status transition notes |
15: | * |
16: | * @package Hyperwallet\Model |
17: | */ |
18: | abstract class StatusTransition extends BaseModel { |
19: | |
20: | /** |
21: | * @internal |
22: | * |
23: | * Read only fields |
24: | * |
25: | * @var string[] |
26: | */ |
27: | protected static $READ_ONLY_FIELDS = array('token', 'createdOn', 'fromStatus', 'toStatus'); |
28: | |
29: | public static function FILTERS_ARRAY() { |
30: | return array('transition', 'createdBefore', 'createdAfter', 'sortBy', 'limit'); |
31: | } |
32: | |
33: | /** |
34: | * Creates a instance of StatusTransition |
35: | * |
36: | * @param string[] $properties The default properties |
37: | */ |
38: | public function __construct(array $properties = array()) { |
39: | parent::__construct(self::$READ_ONLY_FIELDS, $properties); |
40: | } |
41: | |
42: | /** |
43: | * Get the status transition token |
44: | * |
45: | * @return string |
46: | */ |
47: | public function getToken() { |
48: | return $this->token; |
49: | } |
50: | |
51: | /** |
52: | * Set the status transition token |
53: | * |
54: | * @param string $token |
55: | * @return StatusTransition |
56: | */ |
57: | public function setToken($token) { |
58: | $this->token = $token; |
59: | return $this; |
60: | } |
61: | |
62: | /** |
63: | * Get the status transition creation date |
64: | * |
65: | * @return \DateTime |
66: | */ |
67: | public function getCreatedOn() { |
68: | return $this->createdOn ? new \DateTime($this->createdOn) : null; |
69: | } |
70: | |
71: | /** |
72: | * Get the status transition |
73: | * |
74: | * @return string |
75: | */ |
76: | public function getTransition() { |
77: | return $this->transition; |
78: | } |
79: | |
80: | /** |
81: | * Set the status transition |
82: | * |
83: | * @param string $transition |
84: | * @return StatusTransition |
85: | */ |
86: | public function setTransition($transition) { |
87: | $this->transition = $transition; |
88: | return $this; |
89: | } |
90: | |
91: | /** |
92: | * Get the old status |
93: | * |
94: | * @return string |
95: | */ |
96: | public function getFromStatus() { |
97: | return $this->fromStatus; |
98: | } |
99: | |
100: | /** |
101: | * Get the new status |
102: | * |
103: | * @return string |
104: | */ |
105: | public function getToStatus() { |
106: | return $this->toStatus; |
107: | } |
108: | |
109: | /** |
110: | * Get the status transition notes |
111: | * |
112: | * @return string |
113: | */ |
114: | public function getNotes() { |
115: | return $this->notes; |
116: | } |
117: | |
118: | /** |
119: | * Set the status transition notes |
120: | * |
121: | * @param string $notes |
122: | * @return StatusTransition |
123: | */ |
124: | public function setNotes($notes) { |
125: | $this->notes = $notes; |
126: | return $this; |
127: | } |
128: | |
129: | } |
130: |