Methods
Create a service object
__construct(string $clientName, \Moneybird\Transport $transport, \Moneybird\Mapper $mapper)
Parameters
$clientName
string
Moneybird client name (.moneybird.nl)
Exceptions
Autoloader
autoload(string $classname)
Parameters
$classname
string
Delete object
delete(\Moneybird\Storable $model) : \Moneybird\self
Parameters
Exceptions
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
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
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
Register payment
registerPayment(\Moneybird\Payable $invoice, \Moneybird\Payment_Abstract $payment) : \Moneybird\Payable
Number of requests left (max 350/h)
requestsLeft() : int
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
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
Parameters
Returns
string
Send request to Moneybird
request(string $url, string $method, string $data) : string
Parameters
$url
string
$method
string
(GET|POST|PUT|DELETE)
$data
string
Returns
string
Login
testLogin() : \Moneybird\self
Exceptions
Returns
\Moneybird\self
Properties
Show debug information
$debug : bool
First part of Url to connect to
$baseUri : string
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
Constants
Version number of api
API_VERSION