public function setCart(ShoppingCart $cart)
    {
        $curr = $this->getOwner()->getCart();
        $contact = $this->getOwner()->Contact();

        if (isset($curr) && $curr->ID != $cart->ID) {
            $curr->delete();
        }

        $cart->CustomerID = $contact->ID;

        return $this;
    }
public function setCart(ShoppingCart $cart)
    {
        $curr = $this->getOwner()->getCart();
        $contact = $this->getOwner()->Contact();

        if (isset($curr) && $curr->ID != $cart->ID) {
            $curr->delete();
        }

        $cart->CustomerID = $contact->ID;

        return $this;
    }
public function setCart ( ShoppingCart $ cart ) { $ curr = $ this -> getOwner ( ) -> getCart ( ) ; $ contact = $ this -> getOwner ( ) -> Contact ( ) ; if ( isset ( $ curr ) && $ curr -> ID != $ cart -> ID ) { $ curr -> delete ( ) ; } $ cart -> CustomerID = $ contact -> ID ; return $ this ; }
Update the current cart. Also make sure no more than one is
set at any one time.

@return self
Update the current cart . Also make sure no more than one is set at any one time .