original_string: protected function cloneCart(array $order, array $cart)
      {
          foreach ($cart['items'] as $item) {
              $cart_id = $item['cart_id'];
              unset($item['cart_id']);
              $item['user_id'] = $order['user_id'];
              $item['order_id'] = $order['order_id'];
              $this->cart->add($item);
              $this->cart->delete($cart_id);
          }
      }
code: protected function cloneCart(array $order, array $cart)
      {
          foreach ($cart['items'] as $item) {
              $cart_id = $item['cart_id'];
              unset($item['cart_id']);
              $item['user_id'] = $order['user_id'];
              $item['order_id'] = $order['order_id'];
              $this->cart->add($item);
              $this->cart->delete($cart_id);
          }
      }
code_tokens: protected function cloneCart ( array $ order , array $ cart ) { foreach ( $ cart [ 'items' ] as $ item ) { $ cart_id = $ item [ 'cart_id' ] ; unset ( $ item [ 'cart_id' ] ) ; $ item [ 'user_id' ] = $ order [ 'user_id' ] ; $ item [ 'order_id' ] = $ order [ 'order_id' ] ; $ this -> cart -> add ( $ item ) ; $ this -> cart -> delete ( $ cart_id ) ; } }
docstring: Clone an order
  @param array $order
  @param array $cart
docstring_tokens: Clone an order