Estimate

 Methods

Construct a new estimate

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

Parameters

$data

array

$isDirty

bool

new data is dirty, defaults to true

Proxy to disclose method

__get(String $key) : mixed
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::__get()

Parameters

$key

String

Returns

mixed

Magic set method Do not allow set

__set(string $name, mixed $value) 
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::__set()

Parameters

$name

string

$value

mixed

Exceptions

\Moneybird\Domainmodel\Exception

Deletes an estimate

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\AbstractModel::disclose()

Parameters

$key

mixed

Returns

mixed

Returns an array representation of this object's dirty attributes

getDirtyAttributes() : array
Inherited

access public
inherited_from \Moneybird\Domainmodel\AbstractModel::getDirtyAttributes()

Returns

array

Return the objects id or null

getId() : int
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::getId()

Returns

int

Get the raw PDF content

getPdf(\Moneybird\Service $service) : string

Parameters

Exceptions

\Moneybird\InvalidStateException

Returns

string

Returns true if the object contains any dirty attributes

isDirty() : bool
Inherited

access public
inherited_from \Moneybird\Domainmodel\AbstractModel::isDirty()

Returns

bool

Mark the estimate as sent

markAsSent(\Moneybird\Estimate\Service $service) : \Moneybird\self

Parameters

Returns

\Moneybird\self

Updates or inserts an estimate

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

Parameters

Exceptions

\Moneybird\NotValidException

Returns

\Moneybird\self

Send the estimate

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 estimate

setContact(\Moneybird\Contact $contact, bool $isDirty) : \Moneybird\self

access public

Parameters

$isDirty

bool

new data is dirty, defaults to true

Returns

\Moneybird\self

Sets data

setData(array $data, bool $isDirty) 
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::setData()

Parameters

$data

array

$isDirty

bool

new data is dirty, defaults to true

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\AbstractModel::_initDisclosedAttributes()

Initialize vars

_initVars() 

Copy the object

copy(array $filter) : \Moneybird\Domainmodel\self
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::copy()

Parameters

$filter

Array

Attributes not to copy

Returns

\Moneybird\Domainmodel\self

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

extract(array $values, Array $filter, bool $isDirty) 
Inherited

access protected
inherited_from \Moneybird\Domainmodel\AbstractModel::extract()

Parameters

$values

Array

$filter

Array

$isDirty

bool

new data is dirty, defaults to true

Initialize

init() 
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::init()

Adopt the data from $self

reload(\Moneybird\Domainmodel\AbstractModel $self) : \Moneybird\Domainmodel\self
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::reload()

Parameters

Returns

\Moneybird\Domainmodel\self

Returns an array representation of this object

selfToArray(array $filter) : array
Inherited

access protected
inherited_from \Moneybird\Domainmodel\AbstractModel::selfToArray()

Parameters

$filter

Returns

array

Set dirty state to clean

setClean(string $attr) : \Moneybird\Domainmodel\self
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::setClean()

Parameters

$attr

string

Name of attribute, if null (default) set all attribures clean

Returns

\Moneybird\Domainmodel\self

Set details

setDetailsAttr(\Moneybird\Estimate\Detail\ArrayObject $value, bool $isDirty) 

Parameters

$isDirty

bool

new value is dirty, defaults to true

Set dirty state to dirty

setDirty(string $attr) : \Moneybird\Domainmodel\self
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::setDirty()

Parameters

$attr

string

Name of attribute, if null (default) set all attribures dirty

Returns

\Moneybird\Domainmodel\self

Set dirty state based on bool

setDirtyState(bool $isDirty, string $attr) : \Moneybird\Domainmodel\self
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::setDirtyState()

Parameters

$isDirty

bool

$attr

string

Name of attribute, if null (default) change state of all attribures

Returns

\Moneybird\Domainmodel\self

Set history

setHistoryAttr(\Moneybird\Estimate\History\ArrayObject $value, bool $isDirty) 

Parameters

$isDirty

bool

new value is dirty, defaults to true

Set Id

setIdAttr(int $value) 

Parameters

$value

int

Exceptions

\Moneybird\InvalidIdException

Set url

setUrlAttr(string $value) 

Parameters

$value

string

Validate object

validate() : bool

Returns

bool

 Properties

 

Array of attributes that are dirty

$_dirtyAttr : Array
Inherited

inherited_from \Moneybird\Domainmodel\AbstractModel::$$_dirtyAttr
 

Array containing attributes to disclose

$_discloseAttr : array
Inherited

access protected
inherited_from \Moneybird\Domainmodel\AbstractModel::$$_discloseAttr
 

Disclosure

$_disclosure : \Moneybird\Disclosure
Inherited

access protected
inherited_from \Moneybird\Domainmodel\AbstractModel::$$_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 

 

$country

$country 

 

$createdAt

$createdAt 

 

$currency

$currency 

 

$customerId

$customerId 

 

$daysOpen

$daysOpen 

 

$details

$details 

 

$discount

$discount 

 

$dueDateInterval

$dueDateInterval 

 

$estimateDate

$estimateDate 

 

$estimateHash

$estimateHash 

 

$estimateId

$estimateId 

 

$exchangeRate

$exchangeRate 

 

$firstname

$firstname 

 

$history

$history 

 

$id

$id 

 

$invoiceProfileId

$invoiceProfileId 

 

$invoiceProfileVersionId

$invoiceProfileVersionId 

 

$language

$language 

 

$lastname

$lastname 

 

$pdfUrl

$pdfUrl 

 

$poNumber

$poNumber 

 

$postText

$postText 

 

$preText

$preText 

 

$pricesAreInclTax

$pricesAreInclTax 

 

$revision

$revision 

 

$sendMethod

$sendMethod 

 

$showCustomerId

$showCustomerId 

 

$showTax

$showTax 

 

$signOnline

$signOnline 

 

$state

$state 

 

$totalPriceExclTax

$totalPriceExclTax 

 

$totalPriceExclTaxBase

$totalPriceExclTaxBase 

 

$totalPriceInclTax

$totalPriceInclTax 

 

$totalPriceInclTaxBase

$totalPriceInclTaxBase 

 

$updatedAt

$updatedAt 

 

$url

$url 

 

$zipcode

$zipcode