original_string: private function storeOrderItems($order, $data)
      {
          $cart = isset($data['num_cart_items']);
          $numItems = (isset($data['num_cart_items'])) ? $data['num_cart_items'] : 1;
  
          for ($i = 0; $i < $numItems; $i++) {
  
              $suffix = ($numItems > 1 || $cart) ? ($i + 1) : '';
              $suffixUnderscore = ($numItems > 1 || $cart) ? '_' . $suffix : $suffix;
  
              $item = new IpnOrderItem();
              if (isset($data['item_name' . $suffix]))
                  $item->item_name = $data['item_name' . $suffix];
              if (isset($data['item_number' . $suffix]))
                  $item->item_number = $data['item_number' . $suffix];
              if (isset($data['quantity' . $suffix]))
                  $item->quantity = $data['quantity' . $suffix];
              if (isset($data['mc_gross' . $suffixUnderscore]))
                  $item->mc_gross = $data['mc_gross' . $suffixUnderscore];
              if (isset($data['mc_handling' . $suffix]))
                  $item->mc_handling = $data['mc_handling' . $suffix];
              if (isset($data['mc_shipping' . $suffix]))
                  $item->mc_shipping = $data['mc_shipping' . $suffix];
              if (isset($data['tax' . $suffix]))
                  $item->tax = $data['tax' . $suffix];
  
              $order->items()->save($item);
  
              // Set the order item options if any
              // $count = 7 because PayPal allows you to set a maximum of 7 options per item
              // Reference: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
              for ($ii = 1, $count = 7; $ii < $count; $ii++) {
                  if (isset($data['option_name' . $ii . '_' . $suffix])) {
                      $option = new IpnOrderItemOption();
                      $option->option_name = $data['option_name' . $ii . '_' . $suffix];
                      if (isset($data['option_selection' . $ii . '_' . $suffix])) {
                          $option->option_selection = $data['option_selection' . $ii . '_' . $suffix];
                      }
                      $item->options()->save($option);
                  }
              }
          }
      }
code: private function storeOrderItems($order, $data)
      {
          $cart = isset($data['num_cart_items']);
          $numItems = (isset($data['num_cart_items'])) ? $data['num_cart_items'] : 1;
  
          for ($i = 0; $i < $numItems; $i++) {
  
              $suffix = ($numItems > 1 || $cart) ? ($i + 1) : '';
              $suffixUnderscore = ($numItems > 1 || $cart) ? '_' . $suffix : $suffix;
  
              $item = new IpnOrderItem();
              if (isset($data['item_name' . $suffix]))
                  $item->item_name = $data['item_name' . $suffix];
              if (isset($data['item_number' . $suffix]))
                  $item->item_number = $data['item_number' . $suffix];
              if (isset($data['quantity' . $suffix]))
                  $item->quantity = $data['quantity' . $suffix];
              if (isset($data['mc_gross' . $suffixUnderscore]))
                  $item->mc_gross = $data['mc_gross' . $suffixUnderscore];
              if (isset($data['mc_handling' . $suffix]))
                  $item->mc_handling = $data['mc_handling' . $suffix];
              if (isset($data['mc_shipping' . $suffix]))
                  $item->mc_shipping = $data['mc_shipping' . $suffix];
              if (isset($data['tax' . $suffix]))
                  $item->tax = $data['tax' . $suffix];
  
              $order->items()->save($item);
  
              // Set the order item options if any
              // $count = 7 because PayPal allows you to set a maximum of 7 options per item
              // Reference: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
              for ($ii = 1, $count = 7; $ii < $count; $ii++) {
                  if (isset($data['option_name' . $ii . '_' . $suffix])) {
                      $option = new IpnOrderItemOption();
                      $option->option_name = $data['option_name' . $ii . '_' . $suffix];
                      if (isset($data['option_selection' . $ii . '_' . $suffix])) {
                          $option->option_selection = $data['option_selection' . $ii . '_' . $suffix];
                      }
                      $item->options()->save($option);
                  }
              }
          }
      }
code_tokens: private function storeOrderItems ( $ order , $ data ) { $ cart = isset ( $ data [ 'num_cart_items' ] ) ; $ numItems = ( isset ( $ data [ 'num_cart_items' ] ) ) ? $ data [ 'num_cart_items' ] : 1 ; for ( $ i = 0 ; $ i < $ numItems ; $ i ++ ) { $ suffix = ( $ numItems > 1 || $ cart ) ? ( $ i + 1 ) : '' ; $ suffixUnderscore = ( $ numItems > 1 || $ cart ) ? '_' . $ suffix : $ suffix ; $ item = new IpnOrderItem ( ) ; if ( isset ( $ data [ 'item_name' . $ suffix ] ) ) $ item -> item_name = $ data [ 'item_name' . $ suffix ] ; if ( isset ( $ data [ 'item_number' . $ suffix ] ) ) $ item -> item_number = $ data [ 'item_number' . $ suffix ] ; if ( isset ( $ data [ 'quantity' . $ suffix ] ) ) $ item -> quantity = $ data [ 'quantity' . $ suffix ] ; if ( isset ( $ data [ 'mc_gross' . $ suffixUnderscore ] ) ) $ item -> mc_gross = $ data [ 'mc_gross' . $ suffixUnderscore ] ; if ( isset ( $ data [ 'mc_handling' . $ suffix ] ) ) $ item -> mc_handling = $ data [ 'mc_handling' . $ suffix ] ; if ( isset ( $ data [ 'mc_shipping' . $ suffix ] ) ) $ item -> mc_shipping = $ data [ 'mc_shipping' . $ suffix ] ; if ( isset ( $ data [ 'tax' . $ suffix ] ) ) $ item -> tax = $ data [ 'tax' . $ suffix ] ; $ order -> items ( ) -> save ( $ item ) ; // Set the order item options if any // $count = 7 because PayPal allows you to set a maximum of 7 options per item // Reference: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables for ( $ ii = 1 , $ count = 7 ; $ ii < $ count ; $ ii ++ ) { if ( isset ( $ data [ 'option_name' . $ ii . '_' . $ suffix ] ) ) { $ option = new IpnOrderItemOption ( ) ; $ option -> option_name = $ data [ 'option_name' . $ ii . '_' . $ suffix ] ; if ( isset ( $ data [ 'option_selection' . $ ii . '_' . $ suffix ] ) ) { $ option -> option_selection = $ data [ 'option_selection' . $ ii . '_' . $ suffix ] ; } $ item -> options ( ) -> save ( $ option ) ; } } } }
docstring: Stores the order items from the IPN contents.
  
  @param IpnOrder $order
  @param array $data
docstring_tokens: Stores the order items from the IPN contents .