Invoice

 Methods

Construct a new invoice

__construct(array $data, \Moneybird\Contact $contact) 

Parameters

$data

array

Proxy to disclose method

__get(String $key) : mixed
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::__get()

Parameters

$key

String

Returns

mixed

Magic set method Do not allow set

__set(string $name, mixed $value) 
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::__set()

Parameters

$name

string

$value

mixed

Exceptions

\Moneybird\Domainmodel_Exception

Deletes an invoice

delete(\Moneybird\Service $service) 

Parameters

Discloses all values of the object that should be visible in the view layer.

disclose(mixed $key) : mixed
Inherited

access public
inherited_from \Moneybird\Domainmodel_Abstract::disclose()

Parameters

$key

mixed

Returns

mixed

Return the objects id or null

getId() : int
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::getId()

Returns

int

Get the raw PDF content

getPdf(\Moneybird\Service $service) : string

Parameters

Exceptions

\Moneybird\InvalidStateException

Returns

string

Mark the invoice as sent

markAsSent(\Moneybird\Invoice_Service $service) : \Moneybird\self

Parameters

Returns

\Moneybird\self

Register a payment for the invoice

registerPayment(\Moneybird\Service $service, \Moneybird\Payment_Abstract $payment) : \Moneybird\self

Parameters

Exceptions

\Moneybird\InvalidStateException

Returns

\Moneybird\self

Send a reminder for the invoice

remind(\Moneybird\Invoice_Service $service, string $method, \Moneybird\type $email, \Moneybird\type $message) : \Moneybird\self

Parameters

$method

string

Send method (email|hand|post); default: email

$email

\Moneybird\type

Address to send to; default: contact e-mail

$message

\Moneybird\type

Exceptions

\Moneybird\InvalidStateException

Returns

\Moneybird\self

Updates or inserts an invoice

save(\Moneybird\Service $service) : \Moneybird\self

Parameters

Exceptions

\Moneybird\NotValidException

Returns

\Moneybird\self

Send the invoice

send(\Moneybird\Service $service, string $method, \Moneybird\type $email, \Moneybird\type $message) : \Moneybird\self

Parameters

$method

string

Send method (email|hand|post); default: email

$email

\Moneybird\type

Address to send to; default: contact e-mail

$message

\Moneybird\type

Returns

\Moneybird\self

Copy info from contact to invoice

setContact(\Moneybird\Contact $contact) : \Moneybird\self

access public

Parameters

Returns

\Moneybird\self

Sets data

setData(array $data) 
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::setData()

Parameters

$data

array

Get array representation of Subject

toArray() : Array
Inherited

inherited_from \Moneybird\Mapper_Mapable::toArray()

Returns

Array

Create disclosedAttributes array

_initDisclosedAttributes() 
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::_initDisclosedAttributes()

Initialize vars

_initVars() 

Extract will take an array and try to automatically map the array values to properties in this object

extract(array $values, Array $filter) 
Inherited

access protected
inherited_from \Moneybird\Domainmodel_Abstract::extract()

Parameters

$values

Array

$filter

Array

Initialize

init() 
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::init()

Adopt the data from $self

reload(\Moneybird\Domainmodel_Abstract $self) : \Moneybird\self
Inherited

inherited_from \Moneybird\Domainmodel_Abstract::reload()

Parameters

Returns

\Moneybird\self

Returns an array representation of this object

selfToArray(array $filter) : array
Inherited

access protected
inherited_from \Moneybird\Domainmodel_Abstract::selfToArray()

Parameters

$filter

Returns

array

Set details

setDetailsAttr(\Moneybird\Invoice_Detail_Array $value) 

Set history

setHistoryAttr(\Moneybird\Invoice_History_Array $value) 

Set Id

setIdAttr(int $value) 

Parameters

$value

int

Exceptions

\Moneybird\InvalidIdException

Set payments

setPaymentsAttr(\Moneybird\Invoice_Payment_Array $value) 

Set url

setUrlAttr(string $value) 

Parameters

$value

string

Validate object

validate() : bool

Returns

bool

 Properties

 

Array containing attributes to disclose

$_discloseAttr : array
Inherited

access protected
inherited_from \Moneybird\Domainmodel_Abstract::$$_discloseAttr
 

Disclosure

$_disclosure : \Moneybird\Disclosure
Inherited

access protected
inherited_from \Moneybird\Domainmodel_Abstract::$$_disclosure
 

Array of attributes that can't be modified

$_readonlyAttr : Array

 

Array of attributes that are required

$_requiredAttr : Array

 

$address1

$address1 

 

$address2

$address2 

 

$attention

$attention 

 

$city

$city 

 

$companyName

$companyName 

 

$conceptId

$conceptId 

 

$contactId

$contactId 

 

$contactName

$contactName 

 

$country

$country 

 

$createdAt

$createdAt 

 

$currency

$currency 

 

$customerId

$customerId 

 

$daysOpen

$daysOpen 

 

$description

$description 

 

$details

$details 

 

$discount

$discount 

 

$dueDateInterval

$dueDateInterval 

 

$email

$email 

 

$firstname

$firstname 

 

$history

$history 

 

$id

$id 

 

$invoiceDate

$invoiceDate 

 

$invoiceEmail

$invoiceEmail 

 

$invoiceEmailReminder

$invoiceEmailReminder 

 

$invoiceHash

$invoiceHash 

 

$invoiceId

$invoiceId 

 

$invoiceProfileId

$invoiceProfileId 

 

$invoiceProfileVersionId

$invoiceProfileVersionId 

 

$language

$language 

 

$lastname

$lastname 

 

$name

$name 

 

$originalEstimateId

$originalEstimateId 

 

$originalInvoiceId

$originalInvoiceId 

 

$payUrl

$payUrl 

 

$payments

$payments 

 

$pdfUrl

$pdfUrl 

 

$poNumber

$poNumber 

 

$recurringTemplateId

$recurringTemplateId 

 

$revision

$revision 

 

$sendMethod

$sendMethod 

 

$showCustomerId

$showCustomerId 

 

$showTax

$showTax 

 

$showTaxNumber

$showTaxNumber 

 

$state

$state 

 

$taxNumber

$taxNumber 

 

$totalPaid

$totalPaid 

 

$totalPriceExclTax

$totalPriceExclTax 

 

$totalPriceInclTax

$totalPriceInclTax 

 

$totalTax

$totalTax 

 

$totalUnpaid

$totalUnpaid 

 

$updatedAt

$updatedAt 

 

$url

$url 

 

$zipcode

$zipcode