OrderItemAddonValueStorage
extends AbstractAddonValueStorage
in package
Class OrderItemAddonValueStorage
Tags
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>
- Returns a multidimensional array with the primary key of the orders_products table and the required column names with the corresponding key used in the KeyValueCollection.
- _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
$db
protected
CI_DB_query_builder
$db
$externalFields
protected
array<string|int, mixed>
$externalFields
= []
Methods
__construct()
AbstractAddonValueStorage Constructor
public
__construct(CI_DB_query_builder $db) : mixed
Parameters
- $db : CI_DB_query_builder
Return values
mixed —deleteValuesByContainerId()
Remove addon values by the given source id.
public
deleteValuesByContainerId(IdType $containerId) : AbstractAddonValueStorage
Parameters
- $containerId : IdType
-
Id of expected source.
Return values
AbstractAddonValueStorage —Returns the class instance.
getValuesByContainerId()
Get the addon values by the given container ID.
public
getValuesByContainerId(IdType $containerId) : KeyValueCollection
Parameters
- $containerId : IdType
-
Container database ID.
Return values
KeyValueCollection —setValues()
Sets addon values to the database.
public
setValues(IdType $containerId, KeyValueCollection $values) : AbstractAddonValueStorage
Parameters
- $containerId : IdType
-
Container database ID.
- $values : KeyValueCollection
-
KeyValueCollection which should set.
Return values
AbstractAddonValueStorage —Returns the class instance.
_getContainerType()
Get the container class type.
protected
_getContainerType() : string
Return values
string —_getExternalFieldsArray()
Returns a multidimensional array with the primary key of the orders_products table and the required column names with the corresponding key used in the KeyValueCollection.
protected
_getExternalFieldsArray() : array<string|int, mixed>
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