original_string: public function toWishlist($cart_id)
      {
          $result = null;
          $this->hook->attach('cart.move.wishlist.before', $cart_id, $result, $this);
  
          if (isset($result)) {
              return (array) $result;
          }
  
          $cart = $this->cart->get($cart_id);
  
          if (empty($cart) || !$this->cart->delete($cart_id)) {
              return $this->getResultError();
          }
  
          $result = $this->addToWishlist($cart);
  
          gplcart_static_clear();
  
          $this->hook->attach('cart.move.wishlist.after', $data, $result, $this);
          return (array) $result;
      }
code: public function toWishlist($cart_id)
      {
          $result = null;
          $this->hook->attach('cart.move.wishlist.before', $cart_id, $result, $this);
  
          if (isset($result)) {
              return (array) $result;
          }
  
          $cart = $this->cart->get($cart_id);
  
          if (empty($cart) || !$this->cart->delete($cart_id)) {
              return $this->getResultError();
          }
  
          $result = $this->addToWishlist($cart);
  
          gplcart_static_clear();
  
          $this->hook->attach('cart.move.wishlist.after', $data, $result, $this);
          return (array) $result;
      }
code_tokens: public function toWishlist ( $ cart_id ) { $ result = null ; $ this -> hook -> attach ( 'cart.move.wishlist.before' , $ cart_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( array ) $ result ; } $ cart = $ this -> cart -> get ( $ cart_id ) ; if ( empty ( $ cart ) || ! $ this -> cart -> delete ( $ cart_id ) ) { return $ this -> getResultError ( ) ; } $ result = $ this -> addToWishlist ( $ cart ) ; gplcart_static_clear ( ) ; $ this -> hook -> attach ( 'cart.move.wishlist.after' , $ data , $ result , $ this ) ; return ( array ) $ result ; }
docstring: Moves a cart item to a wishlist
  @param int $cart_id
  @return array
docstring_tokens: Moves a cart item to a wishlist