Skip to content

Commit

Permalink
Added Items, Journal and ManualJournal
Browse files Browse the repository at this point in the history
  • Loading branch information
unifonenz committed Feb 17, 2011
1 parent ad75df1 commit f17c5a0
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions xero.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,23 @@ public function __construct($key = false, $secret = false, $public_cert = false,

public function __call($name, $arguments) {
$name = strtolower($name);
$valid_methods = array('accounts','contacts','creditnotes','currencies','invoices','organisation','payments','taxrates','trackingcategories');
$valid_post_methods = array('contacts','creditnotes','invoices');
$valid_put_methods = array('payments');
$valid_get_methods = array('contacts','creditnotes','invoices','accounts','currencies','organisation','taxrates','trackingcategories');
$methods_map = array(
'accounts' => 'Accounts',
'contacts' => 'Contacts',
'creditnotes' => 'CreditNotes',
'currencies' => 'Currencies',
'invoices' => 'Invoices',
'organisation' => 'Organisation',
'payments' => 'Payments',
'taxrates' => 'TaxRates',
'trackingcategories' => 'TrackingCategories'
$valid_methods = array('accounts', 'contacts', 'creditnotes', 'currencies', 'invoices', 'organisation', 'payments', 'taxrates', 'trackingcategories', 'items', 'journals', 'manualjournals');
$valid_post_methods = array('contacts', 'creditnotes', 'invoices', 'items' . 'manualjournals');
$valid_put_methods = array('payments', 'items', 'manualjournals');
$valid_get_methods = array('contacts', 'creditnotes', 'invoices', 'accounts', 'currencies', 'organisation', 'taxrates', 'trackingcategories', 'items', 'journals', 'manualjournals');
$methods_map = array(
'accounts' => 'Accounts',
'contacts' => 'Contacts',
'creditnotes' => 'CreditNotes',
'currencies' => 'Currencies',
'invoices' => 'Invoices',
'organisation' => 'Organisation',
'payments' => 'Payments',
'taxrates' => 'TaxRates',
'trackingcategories' => 'TrackingCategories',
'items' => 'Items',
'journals' => 'Journals',
'manualjournals' => 'ManualJournals'
);
if ( !in_array($name,$valid_methods) ) {
return false;
Expand Down

1 comment on commit f17c5a0

@frankmullenger
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a minor type line 193 with a period between items and manualjournals instead of a comma:
$valid_post_methods = array('contacts', 'creditnotes', 'invoices', 'items' . 'manualjournals');
should probably be
$valid_post_methods = array('contacts', 'creditnotes', 'invoices', 'items', 'manualjournals');

Please sign in to comment.