1 | <?php |
||
5 | trait ResponseFieldsTrait |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * Get a POST data item, or null if not present. |
||
10 | * |
||
11 | * @param string $name The key for the field. |
||
12 | * @param mixed $default The value to return if the data item is not found at all, or is null. |
||
13 | * |
||
14 | * @return mixed The value of the field, often a string, but could be case to anything.. |
||
15 | */ |
||
16 | protected function getDataItem($name, $default = null) |
||
20 | |||
21 | public function getLabel() |
||
25 | |||
26 | public function getAccount() |
||
30 | |||
31 | public function getTransactionId() |
||
35 | |||
36 | public function getTransactionReference() |
||
40 | |||
41 | public function getOperationId() |
||
45 | |||
46 | public function getAmount() |
||
50 | |||
51 | public function getWithdrawAmount() |
||
55 | |||
56 | public function getCurrency() |
||
60 | |||
61 | public function getNotificationType() |
||
65 | |||
66 | public function getBillId() |
||
70 | |||
71 | public function getCodePro() |
||
75 | |||
76 | public function getUnaccepted() |
||
80 | |||
81 | public function getDatetime() |
||
85 | |||
86 | public function getSender() |
||
90 | |||
91 | public function getSha1Hash() |
||
95 | |||
96 | public function getOperationLabel() |
||
100 | |||
101 | public function getTestMode() |
||
105 | |||
106 | public function getLastName() |
||
110 | |||
111 | public function getFirstname() |
||
115 | |||
116 | public function getFathersname() |
||
120 | |||
121 | public function getEmail() |
||
125 | |||
126 | public function getPhone() |
||
130 | |||
131 | public function getCity() |
||
135 | |||
136 | public function getStreet() |
||
140 | |||
141 | public function getBuilding() |
||
145 | |||
146 | public function getSuite() |
||
150 | |||
151 | public function getFlat() |
||
155 | |||
156 | public function getZip() |
||
160 | |||
161 | } |
||
162 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: