public function delivery_time() { $delivery_times = $this->groups->as_array(NULL, 'delivery_time'); if (!$delivery_times) { return NULL; } return Jam_Range::merge(array_filter($delivery_times), 'Model_Shipping::format_shipping_time'); }
/** * Get the merge of all total_delivery_time ranges from the items * By getting the maximum min and max amounts. * @return Jam_Range */ public function total_delivery_time() { $times = array_map(function ($item) { return $item->total_delivery_time(); }, $this->items->as_array()); return Jam_Range::merge($times, 'Model_Shipping::format_shipping_time'); }
public function add(Jam_Range $addition) { return Jam_Range::sum(array($this, $addition), $this->format()); }
/** * @covers Jam_Range::unserialize */ public function test_unserialize() { $range = new Jam_Range(); $range->unserialize('4|5'); $this->assertSame('4', $range->min()); $this->assertSame('5', $range->max()); }