ApiKeyEventListener
extends DefaultEventListener
in package
EventListener for ApiKeys
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getComponent() : SystemComponentController
- Get a component controller object
- onEvent() : mixed
- prePersist() : mixed
- Prevent duplicate API keys from being stored
- preUpdate() : mixed
- Prevent duplicate API keys from being stored
- isAlreadyAnEntryWithThisKey() : bool
- Check if an API key already exists with the given key
Properties
$cx
protected
Cx
$cx
Methods
__construct()
public
__construct(Cx $cx) : mixed
Parameters
- $cx : Cx
getComponent()
Get a component controller object
public
getComponent(string $name) : SystemComponentController
Parameters
- $name : string
-
component name
Return values
SystemComponentController —The requested component controller or null if no such component exists
onEvent()
public
onEvent(mixed $eventName, array<string|int, mixed> $eventArgs) : mixed
Parameters
- $eventName : mixed
- $eventArgs : array<string|int, mixed>
prePersist()
Prevent duplicate API keys from being stored
public
prePersist(LifecycleEventArgs $args) : mixed
Parameters
- $args : LifecycleEventArgs
-
contains the entity
Tags
preUpdate()
Prevent duplicate API keys from being stored
public
preUpdate(LifecycleEventArgs $args) : mixed
Parameters
- $args : LifecycleEventArgs
-
contains the entity
Tags
isAlreadyAnEntryWithThisKey()
Check if an API key already exists with the given key
protected
isAlreadyAnEntryWithThisKey(string $apiKey) : bool
Parameters
- $apiKey : string
-
check if entity with this API key already exists
Return values
bool —if an API key exists