| @@ 86-110 (lines=25) @@ | ||
| 83 | /** |
|
| 84 | * @return array of Merchants |
|
| 85 | */ |
|
| 86 | public function getMerchants() : array |
|
| 87 | { |
|
| 88 | if (!$this->checkLogin()) { |
|
| 89 | return array(); |
|
| 90 | } |
|
| 91 | $arrResult = array(); |
|
| 92 | $merchantList = $this->_network->getMerchantList(); |
|
| 93 | foreach($merchantList as $merchant) { |
|
| 94 | $Merchant = Merchant::createInstance(); |
|
| 95 | $Merchant->merchant_ID = $merchant['cid']; |
|
| 96 | $Merchant->name = $merchant['name']; |
|
| 97 | $Merchant->status = $merchant['status']; |
|
| 98 | if (!empty($merchant['launch_date'])) { |
|
| 99 | $date = new \DateTime($merchant['launch_date']); |
|
| 100 | $Merchant->launch_date = $date; |
|
| 101 | } |
|
| 102 | if (!empty($merchant['application_date'])) { |
|
| 103 | $date = new \DateTime($merchant['application_date']); |
|
| 104 | $Merchant->application_date = $date; |
|
| 105 | } |
|
| 106 | $arrResult[] = $Merchant; |
|
| 107 | } |
|
| 108 | ||
| 109 | return $arrResult; |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @param int|null $merchantID |
|
| @@ 86-110 (lines=25) @@ | ||
| 83 | /** |
|
| 84 | * @return array of Merchants |
|
| 85 | */ |
|
| 86 | public function getMerchants() : array |
|
| 87 | { |
|
| 88 | if (!$this->checkLogin()) { |
|
| 89 | return array(); |
|
| 90 | } |
|
| 91 | $arrResult = array(); |
|
| 92 | $merchantList = $this->_network->getMerchantList(); |
|
| 93 | foreach($merchantList as $merchant) { |
|
| 94 | $Merchant = Merchant::createInstance(); |
|
| 95 | $Merchant->merchant_ID = $merchant['cid']; |
|
| 96 | $Merchant->name = $merchant['name']; |
|
| 97 | $Merchant->status = $merchant['status']; |
|
| 98 | if (!empty($merchant['launch_date'])) { |
|
| 99 | $date = new \DateTime($merchant['launch_date']); |
|
| 100 | $Merchant->launch_date = $date; |
|
| 101 | } |
|
| 102 | if (!empty($merchant['application_date'])) { |
|
| 103 | $date = new \DateTime($merchant['application_date']); |
|
| 104 | $Merchant->application_date = $date; |
|
| 105 | } |
|
| 106 | $arrResult[] = $Merchant; |
|
| 107 | } |
|
| 108 | ||
| 109 | return $arrResult; |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @param int|null $merchantID |
|