class KlaviyoFacade (View source)

The Klaviyo API service container, model, and api wrapper.

Methods

__construct(Container $container, string $api_key)

The service container constructor.

static KlaviyoServiceContainer
create(string $api_key)

Factory method to create a new service continer.

getContainer()

Retrieve the container.

service(string $service_name)

Retrieve a service from the service container.

ModelInterface
model(array $configuration = array(), string $type = '')

The model factory wrapper method.

ModelInterface
modelFromJson(string $json = '', string $type = '')

The create from json model factory wrapper method.

getModelClass($type)

Retrieve the model class of the specified model.

Details

at line line 24
__construct(Container $container, string $api_key)

The service container constructor.

Parameters

Container $container A the service continer to attach the Klaviyo service provider.
string $api_key The Klaviyo API key to use when creating the Klaviyo api service.

at line line 38
static KlaviyoServiceContainer create(string $api_key)

Factory method to create a new service continer.

Parameters

string $api_key The Klaviyo API key to use when creating the Klaviyo api service.

Return Value

KlaviyoServiceContainer An instance of the a new service container.

at line line 48
getContainer()

Retrieve the container.

at line line 61
ServiceInterface service(string $service_name)

Retrieve a service from the service container.

Parameters

string $service_name The name of the service to retrieve.

Return Value

ServiceInterface The service.

at line line 83
ModelInterface model(array $configuration = array(), string $type = '')

The model factory wrapper method.

Parameters

array $configuration The key, value pair array to use for populating the data model.
string $type The type of the data model to create.

Return Value

ModelInterface A data model representing the specified data type.

at line line 103
ModelInterface modelFromJson(string $json = '', string $type = '')

The create from json model factory wrapper method.

Parameters

string $json The JSON encoded key, value pair array to use for populating the data model.
string $type The type of the data model to create.

Return Value

ModelInterface A data model representing the specified data type.

at line line 114
getModelClass($type)

Retrieve the model class of the specified model.

Parameters

$type