Esempio n. 1
0
 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');
 }
Esempio n. 2
0
 /**
  * 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');
 }
Esempio n. 3
0
File: Range.php Progetto: Konro1/pms
 public function add(Jam_Range $addition)
 {
     return Jam_Range::sum(array($this, $addition), $this->format());
 }
Esempio n. 4
0
 /**
  * @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());
 }