title: How to access Quickbooks Invoice Line Items using php api
body: <p>am trying to access the line items of the invoice in quickbooks using php api,</p>
  
  <p>so that i could do some manipulations on it.....</p>
  
  <p>am able to get the invoice data when i do this...</p>
  
  <pre><code>&lt;?php
  $Invoice = $InvoiceService-&gt;findById($Context, $realmID, $InvoiceID);
  pr($Invoice);
  ?&gt;
  </code></pre>
  
  <p>the result is obtained as follows</p>
  
  <pre><code>QuickBooks_IPP_Object_Invoice Object
  (
      [_data:protected] =&gt; Array
          (
              [Id] =&gt; Array
                  (
                      [0] =&gt; {QBO-52}
                  )
  
              [SyncToken] =&gt; Array
                  (
                      [0] =&gt; 13
                  )
  
              [MetaData] =&gt; Array
                  (
                      [0] =&gt; QuickBooks_IPP_Object_MetaData Object
                          (
                              [_data:protected] =&gt; Array
                                  (
                                      [CreateTime] =&gt; Array
                                          (
                                              [0] =&gt; 2013-04-02T02:55:30-07:00
                                          )
  
                                      [LastUpdatedTime] =&gt; Array
                                          (
                                              [0] =&gt; 2013-04-03T04:15:53-07:00
                                          )
  
                                  )
  
                          )
  
                  )
  
              [Header] =&gt; Array
                  (
                      [0] =&gt; QuickBooks_IPP_Object_Header Object
                          (
                              [_data:protected] =&gt; Array
                                  (
                                      [TxnDate] =&gt; Array
                                          (
                                              [0] =&gt; 2013-03-31-07:00
                                          )
  
                                      [Msg] =&gt; Array
                                          (
                                              [0] =&gt; Customer Message update via QB++
                                          )
  
                                      [CustomerId] =&gt; Array
                                          (
                                              [0] =&gt; {QBO-35}
                                          )
  
                                      [SubTotalAmt] =&gt; Array
                                          (
                                              [0] =&gt; 15.00
                                          )
  
                                      [TotalAmt] =&gt; Array
                                          (
                                              [0] =&gt; 15.00
                                          )
  
                                      [ToBePrinted] =&gt; Array
                                          (
                                              [0] =&gt; false
                                          )
  
                                      [ToBeEmailed] =&gt; Array
                                          (
                                              [0] =&gt; false
                                          )
  
                                      [DueDate] =&gt; Array
                                          (
                                              [0] =&gt; 2013-04-29-07:00
                                          )
  
                                      [BillAddr] =&gt; Array
                                          (
                                              [0] =&gt; QuickBooks_IPP_Object_BillAddr Object
                                                  (
                                                      [_data:protected] =&gt; Array
                                                          (
                                                              [Line1] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Jeffery
                                                                  )
  
                                                              [Line2] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Ads India
                                                                  )
  
                                                              [Line3] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Jeffery trading Co Ltd
                                                                  )
  
                                                              [Line4] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Cochin
                                                                  )
  
                                                              [Line5] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Kerala
  India
                                                                  )
  
                                                              [GeoCode] =&gt; Array
                                                                  (
                                                                      [0] =&gt; INVALID
                                                                  )
  
                                                          )
  
                                                  )
  
                                          )
  
                                      [ShipAddr] =&gt; Array
                                          (
                                              [0] =&gt; QuickBooks_IPP_Object_ShipAddr Object
                                                  (
                                                      [_data:protected] =&gt; Array
                                                          (
                                                              [Line1] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Jeffery
                                                                  )
  
                                                              [Line2] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Jeffery trading Co Ltd\\nJeffery traders\\nCochin\\nIndia
                                                                  )
  
                                                              [Line3] =&gt; Array
                                                                  (
                                                                      [0] =&gt; Jeffery
                                                                  )
  
                                                              [Line4] =&gt; Array
                                                                  (
                                                                      [0] =&gt; 0484232425
                                                                  )
  
                                                              [PostalCode] =&gt; Array
                                                                  (
                                                                      [0] =&gt; 0
                                                                  )
  
                                                              [GeoCode] =&gt; Array
                                                                  (
                                                                      [0] =&gt; INVALID
                                                                  )
  
                                                              [Tag] =&gt; Array
                                                                  (
                                                                      [0] =&gt; CUSTOMER
                                                                  )
  
                                                          )
  
                                                  )
  
                                          )
  
                                      [ShipMethodId] =&gt; Array
                                          (
                                              [0] =&gt; {QBO-}
                                          )
  
                                      [Balance] =&gt; Array
                                          (
                                              [0] =&gt; 15.00
                                          )
  
                                      [DiscountTaxable] =&gt; Array
                                          (
                                              [0] =&gt; true
                                          )
  
                                  )
  
                          )
  
                  )
  
              [Line] =&gt; Array
                  (
                      [0] =&gt; QuickBooks_IPP_Object_Line Object
                          (
                              [_data:protected] =&gt; Array
                                  (
                                      [Desc] =&gt; Array
                                          (
                                              [0] =&gt; TES15++
                                          )
  
                                      [Amount] =&gt; Array
                                          (
                                              [0] =&gt; 15.00
                                          )
  
                                      [Taxable] =&gt; Array
                                          (
                                              [0] =&gt; false
                                          )
  
                                      [ItemId] =&gt; Array
                                          (
                                              [0] =&gt; {QBO-30}
                                          )
  
                                  )
  
                          )
  
                      [1] =&gt; QuickBooks_IPP_Object_Line Object
                          (
                              [_data:protected] =&gt; Array
                                  (
                                      [Amount] =&gt; Array
                                          (
                                              [0] =&gt; 0.00
                                          )
  
                                      [Taxable] =&gt; Array
                                          (
                                              [0] =&gt; false
                                          )
  
                                      [ItemId] =&gt; Array
                                          (
                                              [0] =&gt; {QBO-21}
                                          )
  
                                  )
  
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I can get invoice Id, customer Id respectivly as follows</p>
  
  <pre><code>&lt;?php
  
  pr($Invoice-&gt;getId());
  
  pr($Invoice-&gt;getHeader()-&gt;getCustomerId());
  
  ?&gt;
  </code></pre>
  
  <p><strong>My question is how do i get the count of Line items and extract it to a normal array</strong></p>
  
  <p>I tired <code>pr($Invoice-&gt;getLine());</code> it doesnt give me the whole array but just the 1st item in that array...</p>
  
  <p>am finding it difficult to achieve this ....</p>