src/Twisto/Invoice.php
public function splitItems($items)
    {
        $data = array(
            'items' => array_map(function(ItemSplit $item) {
                return $item->serialize();
            }, $items)
        );

        $data = $this->twisto->requestJson('POST', 'invoice/' . urlencode($this->invoice_id) . '/split/', $data);
        $split_invoice = new Invoice($this->twisto, null);
        $split_invoice->deserialize($data);
        $this->get();

        return $split_invoice;
    }
public function splitItems($items)
    {
        $data = array(
            'items' => array_map(function(ItemSplit $item) {
                return $item->serialize();
            }, $items)
        );

        $data = $this->twisto->requestJson('POST', 'invoice/' . urlencode($this->invoice_id) . '/split/', $data);
        $split_invoice = new Invoice($this->twisto, null);
        $split_invoice->deserialize($data);
        $this->get();

        return $split_invoice;
    }
public function splitItems ( $ items ) { $ data = array ( 'items' => array_map ( function ( ItemSplit $ item ) { return $ item -> serialize ( ) ; } , $ items ) ) ; $ data = $ this -> twisto -> requestJson ( 'POST' , 'invoice/' . urlencode ( $ this -> invoice_id ) . '/split/' , $ data ) ; $ split_invoice = new Invoice ( $ this -> twisto , null ) ; $ split_invoice -> deserialize ( $ data ) ; $ this -> get ( ) ; return $ split_invoice ; }
Split invoice to new one
@param ItemSplit[] $items
@return JSON response with new invoice
Split invoice to new one