UserDataHashService
Methods
public __construct($dataBase, $templateConfigService)
UserDataHashService constructor.
Type |
Name |
Description |
|
||
|
public find($hash, $contactId = null, $plentyId = null):UserDataHash
Get entry by hash if exists
Type |
Name |
Description |
|
The hash to search an entry for |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |
public findHash($type, $contactId = null, $plentyId = null):string
Get the hash of a specific type if exists and is not expired.
Type |
Name |
Description |
|
The type to get the hash for |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |
public getData($hash, $contactId = null, $plentyId = null):mixed
Get the decoded data assigned to a hash
Type |
Name |
Description |
|
The hash to search an entry for |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |
public create($data, $type, $ttl = null, $contactId = null, $plentyId = null):UserDataHash
Create a new entry and assign data to the hash for later usage.
Type |
Name |
Description |
|
The data to assign to the generated hash entry |
|
|
The type of the entry |
|
|
Lifetime of the hash entry in hours. Will get the value from config if not defined. |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |
public delete($hash, $contactId = null, $plentyId = null):bool
Remove a hash entry if exists.
Type |
Name |
Description |
|
The hash to search an entry for |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |
public deleteAll($type = null, $contactId = null, $plentyId = null):bool
Delete all entries
Type |
Name |
Description |
|
Optional delete only entries for a specific type |
|
|
Optionally restrict results to a contact id. Otherwise use logged in contact |
|
|
Use a specific plentyId. Otherwise use id of current client. |