\AdamRocska\ShippingTier\Entity\RuntimeShippingMethod

Represents a runtime `ShippingMethod` entity.

Summary

Methods
Properties
Constants
__construct()
getCarrier()
setCarrier()
getLabel()
getIdentifier()
getBranches()
hasCarrier()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$carrier
$label
$identifier
$branches
N/A

Properties

$label

$label : string

a human friendly / human readable label identifying the shipping method.

Type

string

$identifier

$identifier : string

Returns a computer program intended identifier identifying the shipping method.

Type

string

Methods

__construct()

__construct(string  $label, string  $identifier, array<mixed,\AdamRocska\ShippingTier\Entity\ShippingMethodBranch>  $branches) 

ShippingMethod constructor.

Parameters

string $label

A human friendly / human readable label identifying the shipping method.

string $identifier

A computer program intended identifier identifying the shipping method.

array<mixed,\AdamRocska\ShippingTier\Entity\ShippingMethodBranch> $branches

A list of shipping method branches encapsulated by the current shipping method.

getCarrier()

getCarrier() : \AdamRocska\ShippingTier\Entity\Carrier

Returns the `Carrier` to which this shipping method belongs to.

Carriers are lazily injected into this instance, therefore in order to avoid runtime type related failures, make sure to test / assert / validate a tier's presence via hasCarrier.

Returns

\AdamRocska\ShippingTier\Entity\Carrier

getLabel()

getLabel() : string

Returns a human friendly / human readable label identifying the shipping method.

Returns

string

getIdentifier()

getIdentifier() : string

Returns a computer program intended identifier identifying the shipping method.

Returns

string

hasCarrier()

hasCarrier() : boolean

Tells whether the current instance has a `Carrier` injected into it.

HINT : For its dependents it's useful for catch-able, or debug assertions.

Returns

boolean