$identifier
$identifier : string
The machine identifier of the tier.
Represents a set of shipping method branches sorted in the same tier / category.
$shippingMethodBranches : array<mixed,\AdamRocska\ShippingTier\Entity\ShippingMethodBranch>
The set of shipping method branches encapsulated by this tier.
getFastestShippingMethodBranchForCountry(\AdamRocska\ShippingTier\Entity\Country $country) : \AdamRocska\ShippingTier\Entity\ShippingMethodBranch
Returns the fastest shipping method branch within the tier, that contains the provided country.
\AdamRocska\ShippingTier\Entity\Country | $country |
Throws a
NoShippingMethodBranchesBound
exception when there are no
shipping method branches bound to
the tier at all.
Throws a
NoShippingMethodBranchForCountry
exception when there is no
shipping method branch found
for the provided country.
addShippingMethodBranch(\AdamRocska\ShippingTier\Entity\ShippingMethodBranch $branch)
Adds the provided shipping method branch to the instance.
\AdamRocska\ShippingTier\Entity\ShippingMethodBranch | $branch |
setShippingMethodBranches(\AdamRocska\ShippingTier\Entity\Runtime\iterable $branches)
Sets the provided shipping method branches.
It overrides the existing set of shipping methods bound to this instance.
\AdamRocska\ShippingTier\Entity\Runtime\iterable | $branches |
isCurrentTimeFasterThanBest(\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime $current, \AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime $best) : boolean
Compares the received `DoorToDoorTransitTime` against the received "best" / fastest `DoorToDoorTransitTime`, and tells whether the new one is considered to be faster, than the current best.
The decision logic finds the one, that's most likely to arrive sooner.
\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime | $current | The |
\AdamRocska\ShippingTier\Entity\DoorToDoorTransitTime | $best | The |