Order Fulfillment Deadline

Calculator
in package
implements CalculatorInterface

FinalYes

Order fulfillment deadline calculator interface.

Tags
author

Jakub Jabůrek jaburek.jakub@gmail.com

Table of Contents

Interfaces

CalculatorInterface
Order fulfillment deadline calculator interface.

Properties

$serviceHoursProvider  : ProviderInterface
Order processing hours provider.

Methods

__construct()  : mixed
Calculator constructor.
calculate()  : DateTimeInterface|null
Calculates order fulfillment deadline.
compareTime()  : int
Compares given timestamps.
duplicateDateTime()  : DateTime
Returns a mutable copy of the given timestamp.
secondsToTime()  : array<string|int, int>
Converts seconds to hours, minutes and seconds.

Properties

Methods

calculate()

Calculates order fulfillment deadline.

public calculate(Input $input) : DateTimeInterface|null
Parameters
$input : Input

calculation input data

Tags
inheritdoc
Return values
DateTimeInterface|null

fulfillment deadline or null if N/A or unknown

compareTime()

Compares given timestamps.

private static compareTime(DateTimeInterface $a, int $b) : int
Parameters
$a : DateTimeInterface

timestamp

$b : int

seconds since midnight

Return values
int

zero if times are equal, negative if $a is lesser, positive if $b is lesser

duplicateDateTime()

Returns a mutable copy of the given timestamp.

private duplicateDateTime(DateTimeInterface $dateTime) : DateTime
Parameters
$dateTime : DateTimeInterface

timestamp to copy

Return values
DateTime

copy

secondsToTime()

Converts seconds to hours, minutes and seconds.

private static secondsToTime(int $timestamp) : array<string|int, int>
Parameters
$timestamp : int

seconds

Tags
throws
InvalidArgumentException

in case the timestamp is negative

Return values
array<string|int, int>

array with keys hours, minutes and seconds


        
On this page

Search results