CodFeeTypeFactory
in package
implements
TypeFactory
Class CodFeeFactory
Interfaces, Classes and Traits
- TypeFactory
- Interface TypeFactory
Table of Contents
- $connection : Connection
- $textManager : TextManager
- __construct() : mixed
- CodFeeTypeFactory constructor.
- createType() : Type
- installedShippingModules() : array<string|int, mixed>
- Fetches installed shipping modules.
- parseFee() : array<string|int, mixed>
- Processes $feeValue to be formatted into an Options compatible format.
Properties
$connection
private
Connection
$connection
$textManager
private
TextManager
$textManager
Methods
__construct()
CodFeeTypeFactory constructor.
public
__construct(Connection $connection, TextManager $textManager) : mixed
Parameters
- $connection : Connection
- $textManager : TextManager
Return values
mixed —createType()
public
createType(array<string|int, mixed> $params) : Type
Parameters
- $params : array<string|int, mixed>
Tags
Return values
Type —installedShippingModules()
Fetches installed shipping modules.
private
installedShippingModules() : array<string|int, mixed>
This function fetches the installed shipping modules and returns the identifiers of them.
Return values
array<string|int, mixed> —parseFee()
Processes $feeValue to be formatted into an Options compatible format.
private
parseFee(string $feeValue, array<string|int, mixed> $shippingModules) : array<string|int, mixed>
This function parses the $feeValue into an "text"-, "value"-key array and filters not installed shipping modules from the final data set.
Parameters
- $feeValue : string
- $shippingModules : array<string|int, mixed>