public function invoiceItemsByType($type)
    {
        $lineItems = [];

        if (isset($this->lines->data)) {
            foreach ($this->lines->data as $line) {
                if ($line->type == $type) {
                    $lineItems[] = new InvoiceItem($this->user, $line);
                }
            }
        }

        return $lineItems;
    }
public function invoiceItemsByType($type)
    {
        $lineItems = [];

        if (isset($this->lines->data)) {
            foreach ($this->lines->data as $line) {
                if ($line->type == $type) {
                    $lineItems[] = new InvoiceItem($this->user, $line);
                }
            }
        }

        return $lineItems;
    }
public function invoiceItemsByType ( $ type ) { $ lineItems = [ ] ; if ( isset ( $ this -> lines -> data ) ) { foreach ( $ this -> lines -> data as $ line ) { if ( $ line -> type == $ type ) { $ lineItems [ ] = new InvoiceItem ( $ this -> user , $ line ) ; } } } return $ lineItems ; }
Get all of the invoie items by a given type.

@param  string $type

@return array
Get all of the invoie items by a given type .