class ApiService implements ApiServiceInterface

Main services related to API

Constants

DELAY

Used to define the delay (2 hours) to allow password reset

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private EntityManagerInterface $em Stores EntityManagerInterface
private Keychain $keychain Stores Keychain
private UserPasswordEncoderInterface $passwordEncoder Stores UserPasswordEncoderInterface
private RouterInterface $router Stores RouterInterface
private Sha512 $signer Stores Sha512
private UserServiceInterface $userService Stores UserServiceInterface

Methods

__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, RouterInterface $router, UserPasswordEncoderInterface $passwordEncoder, UserServiceInterface $userService)

No description

changePassword($user, $parameters)

Allows user to change its password by submitting a new one

create($user, ParameterBag $parameters)

Creates the user using the API

delete($user)

Deletes the user

array
findAll()

Returns the list of all users in the array format

array
findAllSearch(string $term)

Searches the term in the User collection

string
getToken($user, Request $request)

Encodes the JSON Web Token

hydrate($user, $parameters)

Hydrates the user with given parameters

modify($user, $parameters)

Modifies the user

resetPassword($user)

Allows user to reset its password by setting a token to call the reset confirm Route

resetPasswordConfirm($user, $parameters)

Reset and change the user password

array|null
validateToken(string $token)

Validates the JWToken

Details

at line 83
__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, RouterInterface $router, UserPasswordEncoderInterface $passwordEncoder, UserServiceInterface $userService)

Parameters

ConfigServiceInterface $configService
EntityManagerInterface $em
RouterInterface $router
UserPasswordEncoderInterface $passwordEncoder
UserServiceInterface $userService

at line 103
changePassword($user, $parameters)

Allows user to change its password by submitting a new one

Parameters

$user
$parameters

at line 125
create($user, ParameterBag $parameters)

Creates the user using the API

Parameters

$user
ParameterBag $parameters

at line 148
delete($user)

Deletes the user

Parameters

$user

at line 162
array findAll()

Returns the list of all users in the array format

Return Value

array

at line 174
array findAllSearch(string $term)

Searches the term in the User collection

Parameters

string $term

Return Value

array

at line 185
string getToken($user, Request $request)

Encodes the JSON Web Token

Parameters

$user
Request $request

Return Value

string

at line 212
hydrate($user, $parameters)

Hydrates the user with given parameters

Parameters

$user
$parameters

at line 225
modify($user, $parameters)

Modifies the user

Parameters

$user
$parameters

at line 236
resetPassword($user)

Allows user to reset its password by setting a token to call the reset confirm Route

Parameters

$user

at line 269
resetPasswordConfirm($user, $parameters)

Reset and change the user password

Parameters

$user
$parameters

at line 299
array|null validateToken(string $token)

Validates the JWToken

Parameters

string $token

Return Value

array|null