public function getItemWeight(): int
    {
        if ($this->itemWeight !== null) {
            return $this->itemWeight;
        }

        $this->itemWeight = 0;
        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $this->itemWeight += $item->getItem()->getWeight();
        }

        return $this->itemWeight;
    }
public function getItemWeight(): int
    {
        if ($this->itemWeight !== null) {
            return $this->itemWeight;
        }

        $this->itemWeight = 0;
        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $this->itemWeight += $item->getItem()->getWeight();
        }

        return $this->itemWeight;
    }
public function getItemWeight ( ) : int { if ( $ this -> itemWeight !== null ) { return $ this -> itemWeight ; } $ this -> itemWeight = 0 ; /** @var PackedItem $item */ foreach ( $ this -> items as $ item ) { $ this -> itemWeight += $ item -> getItem ( ) -> getWeight ( ) ; } return $ this -> itemWeight ; }
Get packed weight of the items only.

@return int weight in grams
Get packed weight of the items only .