AbstractAddonValueStorage

Class AbstractAddonValueStorage

category

System

package

AddonValue

Methods

AbstractAddonValueStorage Constructor

__construct(\CI_DB_query_builder $db) 

Arguments

$db

\CI_DB_query_builder

Get the container class type.

_getContainerType() : string
abstract

Response

string

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.

_getExternalFieldsArray() : array
abstract

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;

Response

array

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.

_getExternalValuesByContainerId(\IdType $containerId) : array

Arguments

$containerId

\IdType

Response

array

Associative array of

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.

_setExternalValues(\IdType $containerId, \KeyValueCollection $values) 

Arguments

$containerId

\IdType

Remove addon values by the given source id.

deleteValuesByContainerId(\IdType $containerId) : \AbstractAddonValueStorage

Arguments

$containerId

\IdType

Id of expected source.

Response

\AbstractAddonValueStorage

Returns the class instance.

Get the addon values by the given container ID.

getValuesByContainerId(\IdType $containerId) : \KeyValueCollection

Arguments

$containerId

\IdType

Container database ID.

Response

\KeyValueCollection

Sets addon values to the database.

setValues(\IdType $containerId, \KeyValueCollection $values) : \AbstractAddonValueStorage

Arguments

$containerId

\IdType

Container database ID.

$values

\KeyValueCollection

KeyValueCollection which should set.

Response

\AbstractAddonValueStorage

Returns the class instance.

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Multidimensional array of database tables with corresponding primary keys and the fields which are relevant for addon values which are not stored in the addon_values_storage table.

externalFields : array
var

Multidimensional array of database tables with corresponding primary keys and the fields which are relevant for addon values which are not stored in the addon_values_storage table.

Type(s)

array