Service for connecting with Moneybird

 Methods

Create a service object

__construct(string $clientName, \Moneybird\Transport $transport, \Moneybird\Mapper $mapper) 

access public

Parameters

$clientName

string

Moneybird client name (.moneybird.nl)

Exceptions

\Moneybird\NotLoggedInException

Autoloader

autoload(string $classname) 

static

Parameters

$classname

string

Delete object

delete(\Moneybird\Storable $model) : \Moneybird\self

Parameters

Exceptions

\Moneybird\ForbiddenException

Returns

\Moneybird\self

Get all objects

getAll(string $classname, string | integer $filter, \Moneybird\Domainmodel_Abstract $parent) : \Moneybird\ArrayObject

Parameters

$classname

string

$filter

stringinteger

Filter name or id (advanced filters)

Exceptions

\Moneybird\InvalidFilterException

Returns

Get object by id

getById(string $classname, int $id) : \Moneybird\Domainmodel_Abstract

Parameters

$classname

string

$id

int

Returns

Get objects by ids (array)

getByIds(string $classname, array $ids) : \Moneybird\ArrayObject

Parameters

$classname

string

$ids

Array

Returns

Get an object by it's named id (customer_id, invoice_id)

getByNamedId(string $classname, string $name, string $id) : \Moneybird\Domainmodel_Abstract

Parameters

$classname

string

$name

string

$id

string

Exceptions

\Moneybird\InvalidNamedIdExeption
\Moneybird\InvalidIdException

Returns

Get current session

getCurrentSession() : \Moneybird\CurrentSession

Return the last errors

getErrors() : \Moneybird\Error_Array

access public

Returns

Get raw PDF content

getPdf(\Moneybird\PdfDocument $model, \Moneybird\Domainmodel_Abstract $parent) : string

Parameters

Returns

string

Build a service object for contacts, invoices, etc

getService(string $type) : Object

Parameters

$type

string

Returns

Object

Get sync status

getSyncList(string $classname) : \Moneybird\ArrayObject

Parameters

$classname

string

Returns

Register payment

registerPayment(\Moneybird\Payable $invoice, \Moneybird\Payment_Abstract $payment) : \Moneybird\Payable

access public

Parameters

$invoice

\Moneybird\Payable

invoice to register payment for

$payment

\Moneybird\Payment_Abstract

payment to register

Returns

Send reminder

remind(\Moneybird\Invoice $invoice, \Moneybird\Invoice_Envelope $envelope) : \Moneybird\ApiConnector

Number of requests left (max 350/h)

requestsLeft() : int

Returns

int

Save object

save(\Moneybird\Storable $model) : \Moneybird\Storable

Parameters

Returns

Send invoice or estimate

send(\Moneybird\Sendable $model, \Moneybird\Envelope_Abstract $envelope) : \Moneybird\Sendable

Build the url for the request

buildUrl(\Moneybird\Domainmodel_Abstract $subject, \Moneybird\Domainmodel_Abstract $parent, string $appendUrl, string $docType) : string

Parameters

$appendUrl

string

Filter url

$docType

string

(pdf|xml|json)

Returns

string

Callback to rewrite classname to url-part

classnameToUrlpartCallback(Array $match) : string

access protected

Parameters

$match

Array

Returns

string

Determine the type of $model

getType(\Moneybird\Domainmodel_Abstract $model) : string

Parameters

Returns

string

Maps object to an url-part

mapTypeName(\Moneybird\Domainmodel_Abstract $model) : string

access protected

Parameters

Returns

string

Send request to Moneybird

request(string $url, string $method, string $data) : string

access protected

Parameters

$url

string

$method

string

(GET|POST|PUT|DELETE)

$data

string

Returns

string

Login

testLogin() : \Moneybird\self

access protected

Exceptions

\Moneybird\NotLoggedInException

Returns

\Moneybird\self

 Properties

 

Show debug information

$debug : bool

static
 

First part of Url to connect to

$baseUri : string

access protected
 

$currentSession

$currentSession : \Moneybird\CurrentSession

access protected
 

Last error messages

$errors : Array

 

Array of available filters

$filters : Array

 

Array for mapping named id's to objects

$namedId : Array

 

Array of created service objects

$services : Array

 

HttpRequest object

$transport : \Moneybird\Transport

access protected

 Constants

 

Version number of api

API_VERSION