Lots of new code for Spectre import.

This commit is contained in:
James Cole
2018-01-03 19:17:30 +01:00
parent 4e0319bacc
commit 5177619301
17 changed files with 911 additions and 114 deletions

View File

@@ -96,6 +96,14 @@ class Login extends SpectreObject
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Attempt
*/
@@ -104,5 +112,35 @@ class Login extends SpectreObject
return $this->lastAttempt;
}
/**
* @return array
*/
public function toArray(): array
{
$array = [
'consent_given_at' => $this->consentGivenAt->toIso8601String(),
'consent_types' => $this->consentTypes,
'country_code' => $this->countryCode,
'created_at' => $this->createdAt->toIso8601String(),
'updated_at' => $this->updatedAt->toIso8601String(),
'customer_id' => $this->customerId,
'daily_refresh' => $this->dailyRefresh,
'holder_info' => $this->holderInfo->toArray(),
'id' => $this->id,
'last_attempt' => $this->lastAttempt->toArray(),
'last_success_at' => $this->lastSuccessAt->toIso8601String(),
'next_refresh_possible_at' => $this->nextRefreshPossibleAt,
'provider_code' => $this->providerCode,
'provider_id' => $this->providerId,
'provider_name' => $this->providerName,
'show_consent_confirmation' => $this->showConsentConfirmation,
'status' => $this->status,
'store_credentials' => $this->storeCredentials,
];
return $array;
}
}