$latest =
new \
DateTimeImmutable($latest->
format(Defaults::STORAGE_DATE_TIME_FORMAT
));
$this->earliest =
$earliest->
setTime(16, 0
);
$this->latest =
$latest->
setTime(16, 0
);
} public static function createFromDeliveryTime(DeliveryTime
$deliveryTime): self
{ return match ($deliveryTime->
getUnit()) { DeliveryTimeEntity::DELIVERY_TIME_HOUR =>
new self( self::
create('PT' .
$deliveryTime->
getMin() . 'H'
),
self::
create('PT' .
$deliveryTime->
getMax() . 'H'
) ),
DeliveryTimeEntity::DELIVERY_TIME_DAY =>
new self( self::
create('P' .
$deliveryTime->
getMin() . 'D'
),
self::
create('P' .
$deliveryTime->
getMax() . 'D'
) ),
DeliveryTimeEntity::DELIVERY_TIME_WEEK =>
new self( self::
create('P' .
$deliveryTime->
getMin() . 'W'
),
self::
create('P' .
$deliveryTime->
getMax() . 'W'
) ),
DeliveryTimeEntity::DELIVERY_TIME_MONTH =>
new self( self::
create('P' .
$deliveryTime->
getMin() . 'M'
),