예제 #1
0
 /**
  * Get packed weight
  * @return int weight in grams
  */
 public function getWeight()
 {
     if (!is_null($this->weight)) {
         return $this->weight;
     }
     $this->weight = $this->box->getEmptyWeight();
     $items = clone $this->items;
     foreach ($items as $item) {
         $this->weight += $item->getWeight();
     }
     return $this->weight;
 }