/** * @param Account $account * @param bool $convertForSearch * * @return array */ public function convertAccountToRequest(Account $account, $convertForSearch = false) { $common = ['legal_entity_type' => $account->getLegalEntityType(), 'account_name' => $account->getAccountName(), 'your_reference' => $account->getYourReference(), 'status' => $account->getStatus(), 'street' => $account->getStreet(), 'city' => $account->getCity(), 'state_or_province' => $account->getStateOrProvince(), 'postal_code' => $account->getPostalCode(), 'country' => $account->getCountry(), 'brand' => $account->getBrand()]; if ($convertForSearch) { return $common; } return $common + ['spread_table' => $account->getSpreadTable(), 'identification_type' => $account->getIdentificationType(), 'identification_value' => $account->getIdentificationValue()]; }