class DeviceCodeRepository implements DeviceCodeRepositoryInterface

Traits

Methods

void
saveToken(Model $token)

Save a credential or fail when a model observer cancels persistence.

DeviceCodeEntityInterface
getNewDeviceCode()

Create a new device code entity.

void
persistDeviceCode(DeviceCodeEntityInterface $deviceCodeEntity)

Persist a device code, approval or poll timestamp.

void
persistNewDeviceCode(DeviceCode $code)

Persist a device code, translating collisions that League can retry.

bool
isDeviceCodeCollision(DeviceCode $code, UniqueConstraintViolationException $exception)

Determine whether the failed insert collided on a regenerated device identifier.

DeviceCodeEntityInterface|null
getDeviceCodeEntityByDeviceCode(string $deviceCode)

Retrieve a device code entity by its identifier.

DeviceCodeEntityInterface|null
getDeviceCodeEntityByUserCode(string $userCode)

Get the device code entity by the given user code.

DeviceCode|null
findByUserCode(string $userCode)

Find a live device code awaiting a user's decision.

void
revokeDeviceCode(string $codeId)

Revoke a device code.

bool
isDeviceCodeRevoked(string $codeId)

Determine whether a device code has been revoked.

DeviceCodeEntityInterface
fromDeviceCodeModel(DeviceCode $model)

Create a new device code entity from the given device code model instance.

Details

in PersistsTokens at line 15
protected void saveToken(Model $token)

Save a credential or fail when a model observer cancels persistence.

Parameters

Model $token

Return Value

void

at line 26
DeviceCodeEntityInterface getNewDeviceCode()

Create a new device code entity.

{@inheritdoc}

Return Value

DeviceCodeEntityInterface

at line 36
void persistDeviceCode(DeviceCodeEntityInterface $deviceCodeEntity)

Persist a device code, approval or poll timestamp.

{@inheritdoc}

Parameters

DeviceCodeEntityInterface $deviceCodeEntity

Return Value

void

at line 87
protected void persistNewDeviceCode(DeviceCode $code)

Persist a device code, translating collisions that League can retry.

Parameters

DeviceCode $code

Return Value

void

at line 103
protected bool isDeviceCodeCollision(DeviceCode $code, UniqueConstraintViolationException $exception)

Determine whether the failed insert collided on a regenerated device identifier.

Parameters

DeviceCode $code
UniqueConstraintViolationException $exception

Return Value

bool

at line 136
DeviceCodeEntityInterface|null getDeviceCodeEntityByDeviceCode(string $deviceCode)

Retrieve a device code entity by its identifier.

{@inheritdoc}

Parameters

string $deviceCode

Return Value

DeviceCodeEntityInterface|null

at line 154
DeviceCodeEntityInterface|null getDeviceCodeEntityByUserCode(string $userCode)

Get the device code entity by the given user code.

Parameters

string $userCode

Return Value

DeviceCodeEntityInterface|null

at line 164
DeviceCode|null findByUserCode(string $userCode)

Find a live device code awaiting a user's decision.

Parameters

string $userCode

Return Value

DeviceCode|null

at line 180
void revokeDeviceCode(string $codeId)

Revoke a device code.

{@inheritdoc}

Parameters

string $codeId

Return Value

void

at line 194
bool isDeviceCodeRevoked(string $codeId)

Determine whether a device code has been revoked.

{@inheritdoc}

Parameters

string $codeId

Return Value

bool

at line 208
protected DeviceCodeEntityInterface fromDeviceCodeModel(DeviceCode $model)

Create a new device code entity from the given device code model instance.

Parameters

DeviceCode $model

Return Value

DeviceCodeEntityInterface