Daursu / xero

An elegant Laravel 4 wrapper for the official Xero API.
MIT License
2 stars 8 forks source link

Add a way to perform batch inserts #9

Open ExplodingCabbage opened 9 years ago

ExplodingCabbage commented 9 years ago

The Xero API allows batch inserts by doing a PUT or POST request with a body like

<?xml version='1.0'?>
<FooBars>
    <FooBar>
        <Stuff>bla</Stuff>
    <FooBar>
    <FooBar>
        <Stuff>moo</Stuff>
    <FooBar>
</FooBars>

These batch uploads are important for lots of people (me included) to work around the API limits.

As far as I can tell, there's no (non-hacky) way to perform them with this library at present.

ExplodingCabbage commented 9 years ago

Perhaps collections should offer a ->save() method?

Daursu commented 9 years ago

Yes a save() method on the collection should do the trick. I will have a look at implementing it.