protected function isValidCart(Cart $cart)
    {
        $customer = $this->getCustomerUser();

        return (null !== $customer && $cart->getCustomerId() == $customer->getId())
            ||
        (null === $customer && $cart->getCustomerId() === null);
    }
protected function isValidCart(Cart $cart)
    {
        $customer = $this->getCustomerUser();

        return (null !== $customer && $cart->getCustomerId() == $customer->getId())
            ||
        (null === $customer && $cart->getCustomerId() === null);
    }
protected function isValidCart ( Cart $ cart ) { $ customer = $ this -> getCustomerUser ( ) ; return ( null !== $ customer && $ cart -> getCustomerId ( ) == $ customer -> getId ( ) ) || ( null === $ customer && $ cart -> getCustomerId ( ) === null ) ; }
A cart is valid if its customer ID is the same as the current logged in user

@param Cart $cart The cart to check

@return bool true if the cart is valid, false otherwise
A cart is valid if its customer ID is the same as the current logged in user