LocalDataSource
extends AbstractDataSource
in package
Retrieve templates directly from a configured JSON or `AbstractTemplate` instances.
Table of Contents
Properties
- $consumer : mixed
- $createdDefaults : mixed
- $data : mixed
- $templates : array<string|int, AbstractTemplate>
- Templates.
Methods
- __construct() : mixed
- C'tor.
- add() : mixed
- Add template to this data source.
- clearData() : mixed
- Clear all available data.
- createDefaults() : mixed
- Overwrite this function which adds defaults to the local data source.
- getConsumer() : mixed
- Getter.
- getData() : mixed
- Getter.
- retrieve() : array<string|int, AbstractTemplate>
- Retrieve all templates from data source (e.g. request to service cloud).
- setData() : mixed
- Set data which could be reused by middlewares.
Properties
$consumer
private
mixed
$consumer
$createdDefaults
private
mixed
$createdDefaults
= false
$data
private
mixed
$data
$templates
Templates.
private
array<string|int, AbstractTemplate>
$templates
= []
Methods
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
add()
Add template to this data source.
public
add(AbstractTemplate $template) : mixed
Parameters
- $template : AbstractTemplate
clearData()
Clear all available data.
public
clearData() : mixed
Tags
createDefaults()
Overwrite this function which adds defaults to the local data source.
public
createDefaults() : mixed
getConsumer()
Getter.
public
getConsumer() : mixed
Tags
getData()
Getter.
public
getData(string $key) : mixed
Parameters
- $key : string
Tags
retrieve()
Retrieve all templates from data source (e.g. request to service cloud).
public
retrieve() : array<string|int, AbstractTemplate>
Return values
array<string|int, AbstractTemplate>setData()
Set data which could be reused by middlewares.
public
setData(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed