\AdamRocska\ShippingTier\Entity\RuntimeShippingMethodBranch

Represents a branch of a shipping method.

A branch is a cluster of countries with a common door to door transit times, and belonging to a common tier.

Summary

Methods
Properties
Constants
__construct()
getDoorToDoorTransitTime()
getTier()
setTier()
getCountries()
hasCountry()
getShippingMethod()
hasTier()
setShippingMethod()
hasShippingMethod()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$doorToDoorTransitTime
$countries
$tier
$shippingMethod
N/A

Properties

$countries

$countries : array<mixed,\AdamRocska\ShippingTier\Entity\Country>

The list of countries encapsulated by this shipping method branch.

Type

array<mixed,\AdamRocska\ShippingTier\Entity\Country>

Methods

__construct()

__construct(\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime  $doorToDoorTransitTime, array<mixed,\AdamRocska\ShippingTier\Entity\Country>  $countries) 

ShippingMethodBranch constructor.

Parameters

\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime $doorToDoorTransitTime

The DoorToDoorTransitionTime of the current shipping method branch.

array<mixed,\AdamRocska\ShippingTier\Entity\Country> $countries

The list of countries handled by the current shipping method branch.

getDoorToDoorTransitTime()

getDoorToDoorTransitTime() : \AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime

Returns the current shipping method branch's door to door transition time for its encapsulated countries.

Returns

\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime

getTier()

getTier() : \AdamRocska\ShippingTier\Entity\Tier

Returns the `Tier` to which this shipping method branch belongs to.

Tiers 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 hasTier.

Returns

\AdamRocska\ShippingTier\Entity\Tier

setTier()

setTier(\AdamRocska\ShippingTier\Entity\Tier  $tier) 

Sets the tier to which this shipping method branch belongs to.

Parameters

\AdamRocska\ShippingTier\Entity\Tier $tier

getCountries()

getCountries() : array<mixed,\AdamRocska\ShippingTier\Entity\Country>

Returns the list of countries encapsulated by this shipping method branch.

Returns

array<mixed,\AdamRocska\ShippingTier\Entity\Country>

hasCountry()

hasCountry(\AdamRocska\ShippingTier\Entity\Country  $country) : boolean

Tells whether the encapsulated list of countries contains the received country. It does equality comparison based on the encapsulated ISO Code.

Comparison is done based on the encapsulated countries' and the provided country's ISO codes.

Parameters

\AdamRocska\ShippingTier\Entity\Country $country

Returns

boolean

hasTier()

hasTier() : boolean

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

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

Returns

boolean

hasShippingMethod()

hasShippingMethod() : boolean

Tells whether the current instance has a `ShippingMethod` injected.

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

Returns

boolean