public function Weight()
    {
        if ($this->weight) {
            return $this->weight;
        }
        $weight = 0;
        $order = $this->Order();
        if ($order && $orderItems = $order->Items()) {
            foreach ($orderItems as $orderItem) {
                if ($product = $orderItem->Product()) {
                    $weight = $weight + ($product->Weight * $orderItem->Quantity);
                }
            }
        }
        return $this->weight = $weight;
    }
public function Weight()
    {
        if ($this->weight) {
            return $this->weight;
        }
        $weight = 0;
        $order = $this->Order();
        if ($order && $orderItems = $order->Items()) {
            foreach ($orderItems as $orderItem) {
                if ($product = $orderItem->Product()) {
                    $weight = $weight + ($product->Weight * $orderItem->Quantity);
                }
            }
        }
        return $this->weight = $weight;
    }
public function Weight ( ) { if ( $ this -> weight ) { return $ this -> weight ; } $ weight = 0 ; $ order = $ this -> Order ( ) ; if ( $ order && $ orderItems = $ order -> Items ( ) ) { foreach ( $ orderItems as $ orderItem ) { if ( $ product = $ orderItem -> Product ( ) ) { $ weight = $ weight + ( $ product -> Weight * $ orderItem -> Quantity ) ; } } } return $ this -> weight = $ weight ; }
Calculate the total weight of the order

@return number
Calculate the total weight of the order