\CodeFareith\CfGoogleAuthenticator\Domain\MapperGoogleAuthenticatorSettingsMapper

Mapper for Google Authenticator settings

In some places, the user-specific settings for two-factor authentication can only be obtained in the form of an associative array. The mapper class maps this array to a specific type of object: a Struct. Thus, we benefit from a clean interface and code completion.

Summary

Methods
Properties
Constants
hasRequiredFields()
getMissingFields()
createStructFromArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

hasRequiredFields()

hasRequiredFields(array  data) : 

Check if the given array has all fields/keys defined in static::requiredFields.

Parameters

array data

Returns

getMissingFields()

getMissingFields(array  data) : mixed||string|int

Get all fields/keys defined in static::requiredFields, but missing in the given array

Parameters

array data

Returns

mixed||string|int

createStructFromArray()

createStructFromArray(array  data) : 

Create a struct using data from the given array.

Any child class has to initialize static::requiredFields - otherwise an exception is thrown.

Parameters

array data

Throws

\CodeFareith\CfGoogleAuthenticator\Domain\Mapper\MissingRequiredField
\CodeFareith\CfGoogleAuthenticator\Domain\Mapper\PropertyNotInitialized

Returns