The Appointments parser must cast the ID values into integers.

This commit is contained in:
Alex Tselegidis 2016-07-10 10:37:30 +02:00
parent f99d729830
commit 94d805f68a

View file

@ -16,16 +16,16 @@ namespace EA\Engine\Api\V1\Parsers;
class Appointments implements ParsersInterface { class Appointments implements ParsersInterface {
public function encode(array &$response) { public function encode(array &$response) {
$encodedResponse = [ $encodedResponse = [
'id' => $response['id'], 'id' => $response['id'] !== null ? (int)$response['id'] : null,
'book' => $response['book_datetime'], 'book' => $response['book_datetime'],
'start' => $response['start_datetime'], 'start' => $response['start_datetime'],
'end' => $response['end_datetime'], 'end' => $response['end_datetime'],
'hash' => $response['hash'], 'hash' => $response['hash'],
'notes' => $response['notes'], 'notes' => $response['notes'],
'customerId' => $response['id_users_customer'], 'customerId' => $response['id_users_customer'] !== null ? (int)$response['id_users_customer'] : null,
'providerId' => $response['id_users_provider'], 'providerId' => $response['id_users_provider'] !== null ? (int)$response['id_users_provider'] : null,
'serviceId' => $response['id_services'], 'serviceId' => $response['id_services'] !== null ? (int)$response['id_services'] : null,
'googleCalendarId' => $response['id_google_calendar'] 'googleCalendarId' => $response['id_google_calendar'] !== null ? (int)$response['id_google_calendar'] : null
]; ];
$response = $encodedResponse; $response = $encodedResponse;