1 | <?php |
||
11 | class GetSEPAAccounts extends Response |
||
12 | { |
||
13 | const SEG_ACCOUNT_INFORMATION = 'HISPA'; |
||
14 | |||
15 | /** @var array */ |
||
16 | protected $accounts = array(); |
||
17 | |||
18 | /** |
||
19 | * Creates SEPA Account array list with SEPAAccount models. |
||
20 | * |
||
21 | * @return SEPAAccount[] |
||
22 | */ |
||
23 | public function getSEPAAccountsArray() |
||
24 | { |
||
25 | $accounts = $this->findSegment(static::SEG_ACCOUNT_INFORMATION); |
||
26 | |||
27 | if (is_string($accounts)) { |
||
28 | $accounts = $this->splitSegment($accounts); |
||
29 | array_shift($accounts); |
||
30 | foreach ($accounts as $account) { |
||
31 | $array = $this->splitDeg($account); |
||
32 | $this->accounts[] = $this->createModelFromArray($array); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | return $this->accounts; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Creates a SEPAAccount model from array. |
||
41 | * |
||
42 | * @param array $array |
||
43 | * @return SEPAAccount |
||
44 | */ |
||
45 | protected function createModelFromArray(array $array) |
||
56 | } |
||
57 |