phpDocumentor

AbstractAddonValueStorage
in package

Class AbstractAddonValueStorage

Tags
category

System

Table of Contents

$db  : CI_DB_query_builder
$externalFields  : array<string|int, mixed>
__construct()  : mixed
AbstractAddonValueStorage Constructor
deleteValuesByContainerId()  : AbstractAddonValueStorage
Remove addon values by the given source id.
getValuesByContainerId()  : KeyValueCollection
Get the addon values by the given container ID.
setValues()  : AbstractAddonValueStorage
Sets addon values to the database.
_getContainerType()  : string
Get the container class type.
_getExternalFieldsArray()  : array<string|int, mixed>
Should return a multidimensional array of database tables with corresponding primary keys and the column names with the corresponding key used in the KeyValueCollection which are relevant for addon values and not stored in the addon_values_storage table.
_getExternalValuesByContainerId()  : array<string|int, mixed>
Selects the fields specified in the external fields array $this->externalFields by the given container ID and returns the associative array which will be merged with the associative array with values from the addon_values_storage table.
_setExternalValues()  : mixed
Updates the fields specified in the external fields array $this->externalFields with the corresponding values from the provided KeyValueCollection and removes the elements from the collection before the called method writes into the addon_values_storage table.

Properties

Methods

__construct()

AbstractAddonValueStorage Constructor

public __construct(CI_DB_query_builder $db) : mixed
Parameters
$db : CI_DB_query_builder
Return values
mixed

_getExternalFieldsArray()

Should return a multidimensional array of database tables with corresponding primary keys and the column names with the corresponding key used in the KeyValueCollection which are relevant for addon values and not stored in the addon_values_storage table.

protected abstract _getExternalFieldsArray() : array<string|int, mixed>

Example: $externalFields = array(); $externalFields['orders']['primary_key'] = 'orders_id'; $externalFields['orders']['fields'] = array( 'customers_ip' => 'customerIp', 'abandonment_download' => 'downloadAbandonmentStatus', 'abandonment_service' => 'serviceAbandonmentStatus', 'cc_type' => 'ccType', 'cc_owner' => 'ccOwner', 'cc_number' => 'ccNumber', 'cc_expires' => 'ccExpires', 'cc_start' => 'ccStart', 'cc_issue' => 'ccIssue', 'cc_cvv' => 'ccCvv' );

return $externalFields;

Return values
array<string|int, mixed>

_getExternalValuesByContainerId()

Selects the fields specified in the external fields array $this->externalFields by the given container ID and returns the associative array which will be merged with the associative array with values from the addon_values_storage table.

protected _getExternalValuesByContainerId(IdType $containerId) : array<string|int, mixed>
Parameters
$containerId : IdType
Return values
array<string|int, mixed>

Associative array of

_setExternalValues()

Updates the fields specified in the external fields array $this->externalFields with the corresponding values from the provided KeyValueCollection and removes the elements from the collection before the called method writes into the addon_values_storage table.

protected _setExternalValues(IdType $containerId, KeyValueCollection $values) : mixed
Parameters
$containerId : IdType
$values : KeyValueCollection
Return values
mixed

Search results