Jinya CMS

KnownDevice
in package
implements Creatable, Deletable Uses DeletableEntityTrait, CreatableEntityTrait, EntityTrait

This class contains a known device, known devices are used to remove the need for a two-factor code. It is up to the API consumer whether they want to use them or not.

Tags

Interfaces, Classes, Traits and Enums

Creatable
Deletable

Table of Contents

$deviceKey  : string
$id  : int
$remoteAddress  : string
$userAgent  : string
$userId  : int
__construct()  : mixed
findByArtist()  : Iterator<string|int, KnownDevice>
Gets all known devices for the given artist
findByCode()  : KnownDevice|null
Gets a known device by code
format()  : array<string, string>
Formats the known device into an array

Properties

$deviceKey

public string $deviceKey

The key of the known device

Tags

$remoteAddress

public string $remoteAddress = ''

The remote address of the API consumer this known device was issued for

Tags

$userAgent

public string $userAgent = ''

The user agent of the browser or API client this known device was issued for

Tags

$userId

public int $userId

The ID of the artist this known device belongs to

Tags

Methods

__construct()

public __construct() : mixed
Tags
throws
RandomException
Return values
mixed

findByArtist()

Gets all known devices for the given artist

public static findByArtist(int $artistId) : Iterator<string|int, KnownDevice>
Parameters
$artistId : int
Tags
Return values
Iterator<string|int, KnownDevice>

findByCode()

Gets a known device by code

public static findByCode(string $knownDeviceCode) : KnownDevice|null
Parameters
$knownDeviceCode : string
Tags
Return values
KnownDevice|null

format()

Formats the known device into an array

public format() : array<string, string>
Tags
Return values
array<string, string>

Search results