Mage_Sales_Model_Order_Invoice
extends Mage_Sales_Model_Abstract
in package
Sales abstract model Provide date processing functionality
Table of Contents
Constants
- CAPTURE_OFFLINE : mixed = 'offline'
- CAPTURE_ONLINE : mixed = 'online'
- HISTORY_ENTITY_NAME : mixed = 'invoice'
- Identifier for order history item
- NOT_CAPTURE : mixed = 'not_capture'
- REPORT_DATE_TYPE_INVOICE_CREATED : mixed = 'invoice_created'
- REPORT_DATE_TYPE_ORDER_CREATED : mixed = 'order_created'
- STATE_CANCELED : mixed = 3
- STATE_OPEN : mixed = 1
- Invoice states
- STATE_PAID : mixed = 2
- XML_PATH_EMAIL_ATTACH_PDF : mixed = 'sales_email/invoice/attach_pdf'
- XML_PATH_EMAIL_COPY_METHOD : mixed = 'sales_email/invoice/copy_method'
- XML_PATH_EMAIL_COPY_TO : mixed = 'sales_email/invoice/copy_to'
- XML_PATH_EMAIL_ENABLED : mixed = 'sales_email/invoice/enabled'
- XML_PATH_EMAIL_GUEST_TEMPLATE : mixed = 'sales_email/invoice/guest_template'
- XML_PATH_EMAIL_IDENTITY : mixed = 'sales_email/invoice/identity'
- XML_PATH_EMAIL_TEMPLATE : mixed = 'sales_email/invoice/template'
- XML_PATH_UPDATE_EMAIL_COPY_METHOD : mixed = 'sales_email/invoice_comment/copy_method'
- XML_PATH_UPDATE_EMAIL_COPY_TO : mixed = 'sales_email/invoice_comment/copy_to'
- XML_PATH_UPDATE_EMAIL_ENABLED : mixed = 'sales_email/invoice_comment/enabled'
- XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE : mixed = 'sales_email/invoice_comment/guest_template'
- XML_PATH_UPDATE_EMAIL_IDENTITY : mixed = 'sales_email/invoice_comment/identity'
- XML_PATH_UPDATE_EMAIL_TEMPLATE : mixed = 'sales_email/invoice_comment/template'
Properties
- $_cacheTag : string|bool|array<string|int, mixed>
- Model cache tag for clear cache in after save and after delete
- $_comments : Mage_Sales_Model_Resource_Order_Invoice_Comment_Collection|array<string|int, Mage_Sales_Model_Order_Invoice_Comment>|null
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dataSaveAllowed : bool
- Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
- $_dirty : array<string|int, mixed>
- $_eventObject : mixed
- $_eventPrefix : mixed
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isDeleted : bool
- Object delete flag
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_items : Mage_Sales_Model_Resource_Order_Invoice_Item_Collection|array<string|int, Mage_Sales_Model_Order_Invoice_Item>|null
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_order : Mage_Sales_Model_Order|null
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_resource : Mage_Core_Model_Resource_Db_Abstract
- Resource model instance
- $_resourceCollectionName : string
- Name of the resource collection model
- $_resourceName : string
- Name of the resource model
- $_rounders : array<string|int, mixed>
- Calculator instances for delta rounding of prices
- $_saveBeforeDestruct : mixed
- $_states : mixed
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
- $_wasPayCalled : bool
- Whether the pay() was called
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- _getResource() : Mage_Sales_Model_Resource_Order_Invoice
- Get resource instance
- addComment() : $this
- Adds comment to invoice with additional possibility to send it to customer via email and show it in customer account
- addData() : $this
- Add data to the object.
- addItem() : $this
- afterCommitCallback() : Mage_Core_Model_Abstract
- Processing object after save data Updates relevant grid table records.
- afterLoad() : $this
- Object after load processing. Implemented as public interface for supporting objects after load in collections
- canCancel() : bool
- Check invoice cancel action availability
- canCapture() : bool
- Check invice capture action availability
- cancel() : $this
- Cancel invoice action
- canRefund() : bool
- Check invoice refund action availability
- canVoid() : bool
- Check invice void action availability
- capture() : $this
- Capture invoice
- cleanModelCache() : $this
- Remove model object related cache
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- collectTotals() : $this
- Invoice totals collecting
- dataHasChangedFor() : bool
- Compare object data with original data
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- delete() : $this
- Delete object from database
- destruct() : mixed
- Uploader clean on shutdown
- flagDirty() : $this
- getAllItems() : array<string|int, Mage_Sales_Model_Order_Invoice_Item>
- getBackUrl() : string|null
- getBaseCost() : float|null
- getBaseCurrencyCode() : string|null
- getBaseDiscountAmount() : float|null
- getBaseGrandTotal() : float|null
- getBaseHiddenTaxAmount() : float|null
- getBaseShippingAmount() : float|null
- getBaseShippingHiddenTaxAmount() : float|null
- getBaseShippingInclTax() : float|null
- getBaseShippingTaxAmount() : float|null
- getBaseSubtotal() : float|null
- getBaseSubtotalInclTax() : float|null
- getBaseTaxAmount() : float|null
- getBaseToGlobalRate() : float|null
- getBaseToOrderRate() : float|null
- getBaseTotalRefunded() : float|null
- getBillingAddress() : Mage_Sales_Model_Order_Address|null
- Retrieve billing address
- getBillingAddressId() : int|null
- getCacheIdTags() : array<string|int, mixed>|false
- Get cache tags associated with object id
- getCacheTags() : array<string|int, mixed>|false
- Get list of cache tags applied to model object.
- getCanVoidFlag() : bool|null
- getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
- getCommentsCollection() : Mage_Sales_Model_Resource_Order_Comment_Collection_Abstract
- getConfig() : Mage_Sales_Model_Order_Invoice_Config
- Retrieve invoice configuration model
- getCreatedAt() : string|null
- getCreatedAtDate() : DateTimeImmutable
- Get object created at date affected current active store timezone
- getCreatedAtStoreDate() : DateTimeImmutable
- Get object created at date affected with object store timezone
- getCybersourceToken() : string|null
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getDiscountAmount() : float|null
- Get discount amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
- getEmailSent() : bool|null
- getEntityId() : int
- getForceUpdateGridRecords() : bool|null
- getGlobalCurrencyCode() : string|null
- getGrandTotal() : float|null
- getHiddenTaxAmount() : float|null
- getId() : int|string|null
- Retrieve model object identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getIncrementId() : string|null
- getIsPaid() : bool|null
- getIsUsedForRefund() : bool|null
- getItemById() : false|Mage_Sales_Model_Order_Invoice_Item
- getItemsCollection() : Mage_Sales_Model_Resource_Order_Invoice_Item_Collection
- Get invoice items collection
- getOrder() : Mage_Sales_Model_Order
- Retrieve the order the invoice for created for
- getOrderCurrencyCode() : string|null
- getOrderId() : int|null
- getOrderIncrementId() : string
- Retrieve the increment_id of the order
- getOrigData() : mixed
- Get object loaded data (original data)
- getRequestedCaptureCase() : string|null
- getResource() : Mage_Sales_Model_Resource_Order_Invoice
- Retrieve model resource
- getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getShippingAddress() : Mage_Sales_Model_Order_Address|null
- Retrieve shipping address
- getShippingAddressId() : int|null
- getShippingAmount() : float|null
- Get shipping amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
- getShippingHiddenTaxAmount() : float|null
- getShippingInclTax() : float|null
- getShippingTaxAmount() : float|null
- getState() : int|null
- getStateName() : string
- Retrieve invoice state name by state identifier
- getStates() : array<string|int, mixed>
- Retrieve invoice states array
- getStore() : Mage_Core_Model_Store
- Retrieve store model instance
- getStoreCurrencyCode() : string|null
- getStoreId() : int|null
- getStoreToBaseRate() : float|null
- getStoreToOrderRate() : float|null
- getSubtotal() : float|null
- getSubtotalInclTax() : float|null
- getTaxAmount() : float|null
- getTotalQty() : float|null
- Get total quantity with proper float casting DBAL returns DECIMAL as string, so we cast to float
- getUpdatedAt() : string|null
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- hasErrors() : bool
- isCanceled() : bool
- Check invoice cancel state
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isLast() : bool
- Checking if the invoice is last
- isModuleEnabled() : bool
- isObjectNew() : bool
- Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadByIncrementId() : $this
- Load invoice by increment id
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- pay() : $this
- Pay invoice
- register() : $this
- Register invoice
- reset() : $this
- Reset invoice object
- roundPrice() : float
- Round price considering delta
- save() : $this
- Save object data
- sendEmail() : $this
- Send email with invoice data
- sendUpdateEmail() : $this
- Send email with invoice update information
- serialize() : string
- serialize object attributes
- setAttribute() : $this
- setBaseCost() : static
- setBaseCurrencyCode() : static
- setBaseDiscountAmount() : static
- setBaseGrandTotal() : static
- setBaseHiddenTaxAmount() : static
- setBaseShippingAmount() : static
- setBaseShippingHiddenTaxAmount() : static
- setBaseShippingInclTax() : static
- setBaseShippingTaxAmount() : static
- setBaseSubtotal() : static
- setBaseSubtotalInclTax() : static
- setBaseTaxAmount() : static
- setBaseToGlobalRate() : static
- setBaseToOrderRate() : static
- setBaseTotalRefunded() : static
- setBillingAddressId() : static
- setCanVoidFlag() : static
- setCreatedAt() : static
- setCustomerId() : static
- setCybersourceToken() : static
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setDiscountAmount() : static
- setEmailSent() : static
- setGlobalCurrencyCode() : static
- setGrandTotal() : static
- setHiddenTaxAmount() : static
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setIncrementId() : static
- setIsPaid() : static
- setIsUsedForRefund() : static
- setOrder() : $this
- Declare order for invoice
- setOrderCurrencyCode() : static
- setOrderId() : static
- setOrigData() : $this
- Initialize object original data
- setShippingAddressId() : static
- setShippingAmount() : static
- setShippingHiddenTaxAmount() : static
- setShippingInclTax() : static
- setShippingTaxAmount() : static
- setState() : static
- setStoreCurrencyCode() : static
- setStoreId() : static
- setStoreToBaseRate() : static
- setStoreToOrderRate() : static
- setSubtotal() : static
- setSubtotalInclTax() : static
- setTaxAmount() : static
- setTotalQty() : static
- setTransactionId() : static
- setUpdatedAt() : static
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- void() : $this
- Void invoice
- wasPayCalled() : bool
- Whether pay() method was called (whether order and payment totals were updated)
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addFullNames() : mixed
- _addPdfAttachment() : void
- Attach a PDF copy of this document to the given email info, if it has a PDF form
- _afterDelete() : $this
- Processing object after delete data
- _afterDeleteCommit() : $this
- Processing manipulation after main transaction commit
- _afterLoad() : $this
- Processing object after load data
- _afterSave() : $this
- Processing object after save data
- _beforeDelete() : Mage_Sales_Model_Abstract
- Processing object before delete data
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Before object save manipulations
- _camelize() : string
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Initialize invoice resource model
- _getData() : mixed
- Get value from _data array without parse key
- _getEmails() : array<string|int, mixed>|bool
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _getPdfAttachmentInfo() : array{source_model: string, entity_model: string, filename_prefix: string}|null
- Descriptor for attaching this document as a PDF to an email, or null when the document has no printable PDF form. Overridden by invoice/shipment/creditmemo.
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : $this
- Init mapping array of short fields to its full names
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
Constants
CAPTURE_OFFLINE
public
mixed
CAPTURE_OFFLINE
= 'offline'
CAPTURE_ONLINE
public
mixed
CAPTURE_ONLINE
= 'online'
HISTORY_ENTITY_NAME
Identifier for order history item
public
mixed
HISTORY_ENTITY_NAME
= 'invoice'
NOT_CAPTURE
public
mixed
NOT_CAPTURE
= 'not_capture'
REPORT_DATE_TYPE_INVOICE_CREATED
public
mixed
REPORT_DATE_TYPE_INVOICE_CREATED
= 'invoice_created'
REPORT_DATE_TYPE_ORDER_CREATED
public
mixed
REPORT_DATE_TYPE_ORDER_CREATED
= 'order_created'
STATE_CANCELED
public
mixed
STATE_CANCELED
= 3
STATE_OPEN
Invoice states
public
mixed
STATE_OPEN
= 1
STATE_PAID
public
mixed
STATE_PAID
= 2
XML_PATH_EMAIL_ATTACH_PDF
public
mixed
XML_PATH_EMAIL_ATTACH_PDF
= 'sales_email/invoice/attach_pdf'
XML_PATH_EMAIL_COPY_METHOD
public
mixed
XML_PATH_EMAIL_COPY_METHOD
= 'sales_email/invoice/copy_method'
XML_PATH_EMAIL_COPY_TO
public
mixed
XML_PATH_EMAIL_COPY_TO
= 'sales_email/invoice/copy_to'
XML_PATH_EMAIL_ENABLED
public
mixed
XML_PATH_EMAIL_ENABLED
= 'sales_email/invoice/enabled'
XML_PATH_EMAIL_GUEST_TEMPLATE
public
mixed
XML_PATH_EMAIL_GUEST_TEMPLATE
= 'sales_email/invoice/guest_template'
XML_PATH_EMAIL_IDENTITY
public
mixed
XML_PATH_EMAIL_IDENTITY
= 'sales_email/invoice/identity'
XML_PATH_EMAIL_TEMPLATE
public
mixed
XML_PATH_EMAIL_TEMPLATE
= 'sales_email/invoice/template'
XML_PATH_UPDATE_EMAIL_COPY_METHOD
public
mixed
XML_PATH_UPDATE_EMAIL_COPY_METHOD
= 'sales_email/invoice_comment/copy_method'
XML_PATH_UPDATE_EMAIL_COPY_TO
public
mixed
XML_PATH_UPDATE_EMAIL_COPY_TO
= 'sales_email/invoice_comment/copy_to'
XML_PATH_UPDATE_EMAIL_ENABLED
public
mixed
XML_PATH_UPDATE_EMAIL_ENABLED
= 'sales_email/invoice_comment/enabled'
XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE
public
mixed
XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE
= 'sales_email/invoice_comment/guest_template'
XML_PATH_UPDATE_EMAIL_IDENTITY
public
mixed
XML_PATH_UPDATE_EMAIL_IDENTITY
= 'sales_email/invoice_comment/identity'
XML_PATH_UPDATE_EMAIL_TEMPLATE
public
mixed
XML_PATH_UPDATE_EMAIL_TEMPLATE
= 'sales_email/invoice_comment/template'
Properties
$_cacheTag
Model cache tag for clear cache in after save and after delete
protected
string|bool|array<string|int, mixed>
$_cacheTag
= \false
When you use true - all cache will be clean
$_comments
protected
Mage_Sales_Model_Resource_Order_Invoice_Comment_Collection|array<string|int, Mage_Sales_Model_Order_Invoice_Comment>|null
$_comments
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dataSaveAllowed
Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
protected
bool
$_dataSaveAllowed
= \true
$_dirty
protected
array<string|int, mixed>
$_dirty
$_eventObject
protected
mixed
$_eventObject
= 'invoice'
Attributes
- #[Override]
$_eventPrefix
protected
mixed
$_eventPrefix
= 'sales_order_invoice'
Attributes
- #[Override]
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_items
protected
Mage_Sales_Model_Resource_Order_Invoice_Item_Collection|array<string|int, Mage_Sales_Model_Order_Invoice_Item>|null
$_items
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_order
protected
Mage_Sales_Model_Order|null
$_order
$_origData
Original data that was loaded
protected
array<string|int, mixed>|null
$_origData
$_resource
Resource model instance
protected
Mage_Core_Model_Resource_Db_Abstract
$_resource
$_resourceCollectionName
Name of the resource collection model
protected
string
$_resourceCollectionName
$_resourceName
Name of the resource model
protected
string
$_resourceName
$_rounders
Calculator instances for delta rounding of prices
protected
array<string|int, mixed>
$_rounders
= []
$_saveBeforeDestruct
protected
mixed
$_saveBeforeDestruct
= \false
$_states
protected
static mixed
$_states
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
$_wasPayCalled
Whether the pay() was called
protected
bool
$_wasPayCalled
= \false
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>_getResource()
Get resource instance
public
_getResource() : Mage_Sales_Model_Resource_Order_Invoice
Return values
Mage_Sales_Model_Resource_Order_InvoiceaddComment()
Adds comment to invoice with additional possibility to send it to customer via email and show it in customer account
public
addComment(Mage_Sales_Model_Order_Invoice_Comment|string $comment[, bool $notify = false ][, bool $visibleOnFront = false ]) : $this
Parameters
- $comment : Mage_Sales_Model_Order_Invoice_Comment|string
- $notify : bool = false
- $visibleOnFront : bool = false
Return values
$thisaddData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisaddItem()
public
addItem(Mage_Sales_Model_Order_Invoice_Item $item) : $this
Parameters
Tags
Return values
$thisafterCommitCallback()
Processing object after save data Updates relevant grid table records.
public
afterCommitCallback() : Mage_Core_Model_Abstract
Attributes
- #[Override]
Return values
Mage_Core_Model_AbstractafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thiscanCancel()
Check invoice cancel action availability
public
canCancel() : bool
Return values
boolcanCapture()
Check invice capture action availability
public
canCapture() : bool
Return values
boolcancel()
Cancel invoice action
public
cancel() : $this
Return values
$thiscanRefund()
Check invoice refund action availability
public
canRefund() : bool
Return values
boolcanVoid()
Check invice void action availability
public
canVoid() : bool
Return values
boolcapture()
Capture invoice
public
capture() : $this
Return values
$thiscleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thisclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thiscollectTotals()
Invoice totals collecting
public
collectTotals() : $this
Return values
$thisdataHasChangedFor()
Compare object data with original data
public
dataHasChangedFor(string $field) : bool
Parameters
- $field : string
Return values
booldebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>delete()
Delete object from database
public
delete() : $this
Tags
Return values
$thisdestruct()
Uploader clean on shutdown
public
destruct() : mixed
flagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetAllItems()
public
getAllItems() : array<string|int, Mage_Sales_Model_Order_Invoice_Item>
Return values
array<string|int, Mage_Sales_Model_Order_Invoice_Item>getBackUrl()
public
getBackUrl() : string|null
Return values
string|nullgetBaseCost()
public
getBaseCost() : float|null
Return values
float|nullgetBaseCurrencyCode()
public
getBaseCurrencyCode() : string|null
Return values
string|nullgetBaseDiscountAmount()
public
getBaseDiscountAmount() : float|null
Return values
float|nullgetBaseGrandTotal()
public
getBaseGrandTotal() : float|null
Return values
float|nullgetBaseHiddenTaxAmount()
public
getBaseHiddenTaxAmount() : float|null
Return values
float|nullgetBaseShippingAmount()
public
getBaseShippingAmount() : float|null
Return values
float|nullgetBaseShippingHiddenTaxAmount()
public
getBaseShippingHiddenTaxAmount() : float|null
Return values
float|nullgetBaseShippingInclTax()
public
getBaseShippingInclTax() : float|null
Return values
float|nullgetBaseShippingTaxAmount()
public
getBaseShippingTaxAmount() : float|null
Return values
float|nullgetBaseSubtotal()
public
getBaseSubtotal() : float|null
Return values
float|nullgetBaseSubtotalInclTax()
public
getBaseSubtotalInclTax() : float|null
Return values
float|nullgetBaseTaxAmount()
public
getBaseTaxAmount() : float|null
Return values
float|nullgetBaseToGlobalRate()
public
getBaseToGlobalRate() : float|null
Return values
float|nullgetBaseToOrderRate()
public
getBaseToOrderRate() : float|null
Return values
float|nullgetBaseTotalRefunded()
public
getBaseTotalRefunded() : float|null
Return values
float|nullgetBillingAddress()
Retrieve billing address
public
getBillingAddress() : Mage_Sales_Model_Order_Address|null
Attributes
- #[Override]
Return values
Mage_Sales_Model_Order_Address|nullgetBillingAddressId()
public
getBillingAddressId() : int|null
Return values
int|nullgetCacheIdTags()
Get cache tags associated with object id
public
getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetCacheTags()
Get list of cache tags applied to model object.
public
getCacheTags() : array<string|int, mixed>|false
Return false if cache tags are not supported by model
Return values
array<string|int, mixed>|falsegetCanVoidFlag()
public
getCanVoidFlag() : bool|null
Return values
bool|nullgetCollection()
public
getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_Abstract|falsegetCommentsCollection()
public
getCommentsCollection([bool $reload = false ]) : Mage_Sales_Model_Resource_Order_Comment_Collection_Abstract
Parameters
- $reload : bool = false
Return values
Mage_Sales_Model_Resource_Order_Comment_Collection_AbstractgetConfig()
Retrieve invoice configuration model
public
getConfig() : Mage_Sales_Model_Order_Invoice_Config
Return values
Mage_Sales_Model_Order_Invoice_ConfiggetCreatedAt()
public
getCreatedAt() : string|null
Return values
string|nullgetCreatedAtDate()
Get object created at date affected current active store timezone
public
getCreatedAtDate() : DateTimeImmutable
Return values
DateTimeImmutablegetCreatedAtStoreDate()
Get object created at date affected with object store timezone
public
getCreatedAtStoreDate() : DateTimeImmutable
Return values
DateTimeImmutablegetCybersourceToken()
public
getCybersourceToken() : string|null
Return values
string|nullgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getDiscountAmount()
Get discount amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
public
getDiscountAmount() : float|null
Return values
float|nullgetEmailSent()
public
getEmailSent() : bool|null
Return values
bool|nullgetEntityId()
public
getEntityId() : int
Return values
intgetForceUpdateGridRecords()
public
getForceUpdateGridRecords() : bool|null
Return values
bool|nullgetGlobalCurrencyCode()
public
getGlobalCurrencyCode() : string|null
Return values
string|nullgetGrandTotal()
public
getGrandTotal() : float|null
Return values
float|nullgetHiddenTaxAmount()
public
getHiddenTaxAmount() : float|null
Return values
float|nullgetId()
Retrieve model object identifier
public
getId() : int|string|null
Attributes
- #[Override]
Return values
int|string|nullgetIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetIncrementId()
public
getIncrementId() : string|null
Return values
string|nullgetIsPaid()
public
getIsPaid() : bool|null
Return values
bool|nullgetIsUsedForRefund()
public
getIsUsedForRefund() : bool|null
Return values
bool|nullgetItemById()
public
getItemById(int|string $itemId) : false|Mage_Sales_Model_Order_Invoice_Item
Parameters
- $itemId : int|string
Return values
false|Mage_Sales_Model_Order_Invoice_ItemgetItemsCollection()
Get invoice items collection
public
getItemsCollection() : Mage_Sales_Model_Resource_Order_Invoice_Item_Collection
Return values
Mage_Sales_Model_Resource_Order_Invoice_Item_CollectiongetOrder()
Retrieve the order the invoice for created for
public
getOrder() : Mage_Sales_Model_Order
Return values
Mage_Sales_Model_OrdergetOrderCurrencyCode()
public
getOrderCurrencyCode() : string|null
Return values
string|nullgetOrderId()
public
getOrderId() : int|null
Return values
int|nullgetOrderIncrementId()
Retrieve the increment_id of the order
public
getOrderIncrementId() : string
Return values
stringgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getRequestedCaptureCase()
public
getRequestedCaptureCase() : string|null
Return values
string|nullgetResource()
Retrieve model resource
public
getResource() : Mage_Sales_Model_Resource_Order_Invoice
Return values
Mage_Sales_Model_Resource_Order_InvoicegetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_AbstractgetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetShippingAddress()
Retrieve shipping address
public
getShippingAddress() : Mage_Sales_Model_Order_Address|null
Attributes
- #[Override]
Return values
Mage_Sales_Model_Order_Address|nullgetShippingAddressId()
public
getShippingAddressId() : int|null
Return values
int|nullgetShippingAmount()
Get shipping amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
public
getShippingAmount() : float|null
Return values
float|nullgetShippingHiddenTaxAmount()
public
getShippingHiddenTaxAmount() : float|null
Return values
float|nullgetShippingInclTax()
public
getShippingInclTax() : float|null
Return values
float|nullgetShippingTaxAmount()
public
getShippingTaxAmount() : float|null
Return values
float|nullgetState()
public
getState() : int|null
Return values
int|nullgetStateName()
Retrieve invoice state name by state identifier
public
getStateName([int $stateId = null ]) : string
Parameters
- $stateId : int = null
Return values
stringgetStates()
Retrieve invoice states array
public
static getStates() : array<string|int, mixed>
Return values
array<string|int, mixed>getStore()
Retrieve store model instance
public
getStore() : Mage_Core_Model_Store
Attributes
- #[Override]
Return values
Mage_Core_Model_StoregetStoreCurrencyCode()
public
getStoreCurrencyCode() : string|null
Return values
string|nullgetStoreId()
public
getStoreId() : int|null
Return values
int|nullgetStoreToBaseRate()
public
getStoreToBaseRate() : float|null
Return values
float|nullgetStoreToOrderRate()
public
getStoreToOrderRate() : float|null
Return values
float|nullgetSubtotal()
public
getSubtotal() : float|null
Return values
float|nullgetSubtotalInclTax()
public
getSubtotalInclTax() : float|null
Return values
float|nullgetTaxAmount()
public
getTaxAmount() : float|null
Return values
float|nullgetTotalQty()
Get total quantity with proper float casting DBAL returns DECIMAL as string, so we cast to float
public
getTotalQty() : float|null
Return values
float|nullgetUpdatedAt()
public
getUpdatedAt() : string|null
Return values
string|nullhasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolisCanceled()
Check invoice cancel state
public
isCanceled() : bool
Return values
boolisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisLast()
Checking if the invoice is last
public
isLast() : bool
Return values
boolisModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
boolisObjectNew()
Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
public
isObjectNew([bool $flag = null ]) : bool
Parameters
- $flag : bool = null
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>load()
Load object data
public
load(string|null|int $id[, string|null $field = null ]) : $this
Parameters
- $id : string|null|int
- $field : string|null = null
Return values
$thisloadByIncrementId()
Load invoice by increment id
public
loadByIncrementId(string $incrementId) : $this
Parameters
- $incrementId : string
Return values
$thisoffsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
pay()
Pay invoice
public
pay() : $this
Return values
$thisregister()
Register invoice
public
register() : $this
Apply to order, order items etc.
Return values
$thisreset()
Reset invoice object
public
reset() : $this
Return values
$thisroundPrice()
Round price considering delta
public
roundPrice(float $price[, string $type = 'regular' ][, bool $negative = false ]) : float
Parameters
- $price : float
- $type : string = 'regular'
- $negative : bool = false
-
Indicates if we perform addition (true) or subtraction (false) of rounded value
Return values
floatsave()
Save object data
public
save() : $this
Tags
Return values
$thissendEmail()
Send email with invoice data
public
sendEmail([bool $notifyCustomer = true ][, string $comment = '' ]) : $this
Parameters
- $notifyCustomer : bool = true
- $comment : string = ''
Return values
$thissendUpdateEmail()
Send email with invoice update information
public
sendUpdateEmail([bool $notifyCustomer = true ][, string $comment = '' ]) : $this
Parameters
- $notifyCustomer : bool = true
- $comment : string = ''
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetBaseCost()
public
setBaseCost(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseCurrencyCode()
public
setBaseCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetBaseDiscountAmount()
public
setBaseDiscountAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseGrandTotal()
public
setBaseGrandTotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseHiddenTaxAmount()
public
setBaseHiddenTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseShippingAmount()
public
setBaseShippingAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseShippingHiddenTaxAmount()
public
setBaseShippingHiddenTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseShippingInclTax()
public
setBaseShippingInclTax(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseShippingTaxAmount()
public
setBaseShippingTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseSubtotal()
public
setBaseSubtotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseSubtotalInclTax()
public
setBaseSubtotalInclTax(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseTaxAmount()
public
setBaseTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseToGlobalRate()
public
setBaseToGlobalRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseToOrderRate()
public
setBaseToOrderRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseTotalRefunded()
public
setBaseTotalRefunded(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBillingAddressId()
public
setBillingAddressId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCanVoidFlag()
public
setCanVoidFlag([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetCreatedAt()
public
setCreatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerId()
public
setCustomerId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCybersourceToken()
public
setCybersourceToken(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetDiscountAmount()
public
setDiscountAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetEmailSent()
public
setEmailSent([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetGlobalCurrencyCode()
public
setGlobalCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetGrandTotal()
public
setGrandTotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetHiddenTaxAmount()
public
setHiddenTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetId()
Declare model object identifier value
public
setId(mixed $id) : $this
Parameters
- $id : mixed
Attributes
- #[Override]
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetIncrementId()
public
setIncrementId(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetIsPaid()
public
setIsPaid([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsUsedForRefund()
public
setIsUsedForRefund([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetOrder()
Declare order for invoice
public
setOrder(Mage_Sales_Model_Order $order) : $this
Parameters
- $order : Mage_Sales_Model_Order
Return values
$thissetOrderCurrencyCode()
public
setOrderCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetOrderId()
public
setOrderId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetOrigData()
Initialize object original data
public
setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
- $key : string = null
- $data : mixed = null
Return values
$thissetShippingAddressId()
public
setShippingAddressId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetShippingAmount()
public
setShippingAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetShippingHiddenTaxAmount()
public
setShippingHiddenTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetShippingInclTax()
public
setShippingInclTax(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetShippingTaxAmount()
public
setShippingTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetState()
public
setState(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetStoreCurrencyCode()
public
setStoreCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetStoreId()
public
setStoreId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetStoreToBaseRate()
public
setStoreToBaseRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetStoreToOrderRate()
public
setStoreToOrderRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetSubtotal()
public
setSubtotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetSubtotalInclTax()
public
setSubtotalInclTax(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetTaxAmount()
public
setTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetTotalQty()
public
setTotalQty(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetTransactionId()
public
setTransactionId(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetUpdatedAt()
public
setUpdatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
statictoArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisvoid()
Void invoice
public
void() : $this
Return values
$thiswasPayCalled()
Whether pay() method was called (whether order and payment totals were updated)
public
wasPayCalled() : bool
Return values
bool__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addFullNames()
protected
_addFullNames() : mixed
_addPdfAttachment()
Attach a PDF copy of this document to the given email info, if it has a PDF form
protected
_addPdfAttachment(Mage_Core_Model_Email_Info $emailInfo) : void
Parameters
- $emailInfo : Mage_Core_Model_Email_Info
_afterDelete()
Processing object after delete data
protected
_afterDelete() : $this
Return values
$this_afterDeleteCommit()
Processing manipulation after main transaction commit
protected
_afterDeleteCommit() : $this
Return values
$this_afterLoad()
Processing object after load data
protected
_afterLoad() : $this
Return values
$this_afterSave()
Processing object after save data
protected
_afterSave() : $this
Attributes
- #[Override]
Return values
$this_beforeDelete()
Processing object before delete data
protected
_beforeDelete() : Mage_Sales_Model_Abstract
Tags
Attributes
- #[Override]
Return values
Mage_Sales_Model_Abstract_beforeLoad()
Processing object before load data
protected
_beforeLoad(int $id[, string|null $field = null ]) : $this
Parameters
- $id : int
- $field : string|null = null
Return values
$this_beforeSave()
Before object save manipulations
protected
_beforeSave() : $this
Attributes
- #[Override]
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Initialize invoice resource model
protected
_construct() : void
Attributes
- #[Override]
_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_getEmails()
protected
_getEmails(string $configPath) : array<string|int, mixed>|bool
Parameters
- $configPath : string
Return values
array<string|int, mixed>|bool_getEventData()
Get array of objects transferred to default events processing
protected
_getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>_getPdfAttachmentInfo()
Descriptor for attaching this document as a PDF to an email, or null when the document has no printable PDF form. Overridden by invoice/shipment/creditmemo.
protected
_getPdfAttachmentInfo() : array{source_model: string, entity_model: string, filename_prefix: string}|null
Attributes
- #[Override]
Return values
array{source_model: string, entity_model: string, filename_prefix: string}|null_hasModelChanged()
Check whether model has changed data.
protected
_hasModelChanged() : bool
Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique
Return values
bool_init()
Standard model initialization
protected
_init(string $resourceModel) : mixed
Parameters
- $resourceModel : string
_initOldFieldsMap()
Init mapping array of short fields to its full names
protected
_initOldFieldsMap() : $this
Attributes
- #[Override]
Return values
$this_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_setResourceModel()
Set resource names
protected
_setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed
If collection name is omitted, resource name will be used with _collection appended
Parameters
- $resourceName : string
- $resourceCollectionName : string|null = null
_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string