Documentation

Mage_Sales_Model_Order_Item extends Mage_Core_Model_Abstract
in package

Table of Contents

Constants

STATUS_BACKORDERED  : mixed = 3
STATUS_CANCELED  : mixed = 5
STATUS_INVOICED  : mixed = 9
STATUS_MIXED  : mixed = 7
STATUS_PARTIAL  : mixed = 6
STATUS_PENDING  : mixed = 1
STATUS_REFUNDED  : mixed = 8
STATUS_RETURNED  : mixed = 4
STATUS_SHIPPED  : mixed = 2

Properties

$_cacheTag  : string|bool|array<string|int, mixed>
Model cache tag for clear cache in after save and after delete
$_children  : mixed
$_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  : string
Parameter name in event
$_eventPrefix  : string
Prefix of model events names
$_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)
$_oldFieldsMap  : array<string|int, mixed>
Map short fields names to its full names
$_order  : Mage_Sales_Model_Order|null
Order instance
$_origData  : array<string|int, mixed>|null
Original data that was loaded
$_parentItem  : mixed
$_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
$_statuses  : 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

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_Item
Get resource instance
addChildItem()  : mixed
Adds child item to this item
addData()  : $this
Add data to the object.
afterCommitCallback()  : $this
Callback function which called after transaction commit in resource model
afterLoad()  : $this
Object after load processing. Implemented as public interface for supporting objects after load in collections
cancel()  : $this
Cancel order item
canInvoice()  : bool
Check item invoice availability
canRefund()  : bool
Check item refund availability
canShip()  : bool
Check item ship availability
cleanModelCache()  : $this
Remove model object related cache
clearInstance()  : $this
Clearing object for correct deleting by garbage collector
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
flagDirty()  : $this
getAdditionalData()  : string|null
getAmountRefunded()  : float|null
getAppliedRuleIds()  : string|null
getBaseAmountRefunded()  : float|null
getBaseCost()  : float|null
getBaseDiscountAmount()  : float|null
getBaseDiscountAppliedForWeeeTax()  : float
Get the discount amount applied on weee in base
getBaseDiscountInvoiced()  : float|null
getBaseDiscountRefunded()  : float|null
getBaseHiddenTaxAmount()  : float|null
getBaseHiddenTaxInvoiced()  : float|null
getBaseHiddenTaxRefunded()  : float|null
getBaseOriginalPrice()  : float|null
getBasePrice()  : float|null
getBasePriceInclTax()  : float|null
getBaseRowInvoiced()  : float|null
getBaseRowTotal()  : float|null
getBaseRowTotalInclTax()  : float|null
getBaseTaxAmount()  : float|null
getBaseTaxBeforeDiscount()  : float|null
getBaseTaxInvoiced()  : float|null
getBaseTaxRefunded()  : float|null
getBaseWeeeTaxAppliedAmount()  : float|null
getBaseWeeeTaxAppliedRowAmount()  : float|null
getBaseWeeeTaxDisposition()  : float|null
getBaseWeeeTaxRowDisposition()  : float|null
getBillingAddress()  : Mage_Customer_Model_Address_Abstract|null
getBuyRequest()  : DataObject
Returns formatted buy request - object, holding request received from product view page with keys and options for configured product
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.
getChildrenItems()  : array<string|int, mixed>
Return chilgren items of this item
getCollection()  : Mage_Sales_Model_Resource_Order_Item_Collection
getCreatedAt()  : 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
getDescription()  : string|null
getDiscountAmount()  : float|null
getDiscountAppliedForWeeeTax()  : float
Get the discount amount applied on Weee
getDiscountInvoiced()  : float|null
getDiscountPercent()  : float|null
getDiscountRefunded()  : float|null
getEntityId()  : int
getExtOrderItemId()  : string|null
getForceApplyDiscountToParentItem()  : bool
Check if discount has to be applied to parent item
getFreeShipping()  : bool|null
getGiftMessageAvailable()  : int|null
getGiftMessageId()  : int|null
getHasChildren()  : bool|null
getHiddenTaxAmount()  : float|null
getHiddenTaxCanceled()  : float|null
getHiddenTaxInvoiced()  : float|null
getHiddenTaxRefunded()  : float|null
getId()  : int|string|null
Retrieve model object identifier
getIdFieldName()  : string
Retrieve identifier field name for model
getIsQtyDecimal()  : bool|null
getIsVirtual()  : bool|null
getLockedDoInvoice()  : bool|null
getLockedDoShip()  : bool|null
getName()  : string|null
getNoDiscount()  : bool|null
getOrder()  : Mage_Sales_Model_Order
Retrieve order model object
getOrderId()  : int|null
getOrigData()  : mixed
Get object loaded data (original data)
getOriginalPrice()  : float
Redeclare getter for back compatibility
getParentItem()  : $this|null
Get parent item
getParentItemId()  : int|null
getParentProductId()  : int|null
getPrice()  : float|null
getPriceInclTax()  : float|null
getProduct()  : Mage_Catalog_Model_Product
Retrieve product
getProductAdditionalOptions()  : array<int, array<string, mixed>>
Display-only notes attached to the item, always a list.
getProductId()  : int|null
getProductOptionByCode()  : array<string|int, mixed>|string|null
Get product options array by code.
getProductOptions()  : array<string|int, mixed>
Get product options array
getProductType()  : string|null
getQtyBackordered()  : float|null
getQtyCanceled()  : float|null
getQtyInvoiced()  : float|null
getQtyOrdered()  : float|null
getQtyRefunded()  : float|null
getQtyShipped()  : float|null
getQtyToCancel()  : float|int
Retrieve item qty available for cancel
getQtyToCancelBundle()  : float|int
Retrieve Bundle item qty available for cancel getQtyToInvoice() will always deliver 0 for Bundle
getQtyToCancelBundleItem()  : float|int
Retrieve Bundle child item qty available for cancel getQtyToShip() always returns 0 for BundleItems that ship together
getQtyToInvoice()  : float|int
Retrieve item qty available for invoice
getQtyToRefund()  : float|int
Retrieve item qty available for refund
getQtyToShip()  : float|int
Retrieve item qty available for ship
getQuoteItemId()  : int|null
getQuoteParentItemId()  : int|null
getRealProductType()  : array<string|int, mixed>|null
Return real product type of item or NULL if item is not composite
getResource()  : Mage_Sales_Model_Resource_Order_Item
Retrieve model resource
getResourceCollection()  : Mage_Core_Model_Resource_Db_Collection_Abstract
Get collection instance
getResourceName()  : string
Retrieve model resource name
getRowInvoiced()  : float|null
getRowTotal()  : float|null
getRowTotalInclTax()  : float|null
getRowWeight()  : float|null
getShippingAddress()  : Mage_Customer_Model_Address_Abstract|null
getSimpleQtyToShip()  : float|int
Retrieve item qty available for ship
getSku()  : string|null
getStatus()  : string
Retrieve status
getStatuses()  : array<string|int, mixed>
Retrieve order item statuses array
getStatusId()  : int
Retrieve item status identifier
getStatusName()  : string
Retrieve status name
getStoreId()  : int|null
getTaxAmount()  : float|null
getTaxBeforeDiscount()  : float|null
getTaxCanceled()  : float|null
getTaxClassId()  : int|null
getTaxInvoiced()  : float|null
getTaxPercent()  : float|null
getTaxRefunded()  : float|null
getUpdatedAt()  : string|null
getWeeeTaxApplied()  : string|null
getWeeeTaxAppliedAmount()  : float|null
getWeeeTaxAppliedRowAmount()  : float|null
getWeeeTaxDisposition()  : float|null
getWeeeTaxRowDisposition()  : float|null
getWeight()  : float|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
isChildrenCalculated()  : bool
Return checking of what calculation type was for this product
isCustomItem()  : bool
Check if the item is a custom line, with no catalog product.
isDeleted()  : bool
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
isDirty()  : bool
isDummy()  : bool
This is Dummy item or not if $shipment is true then we checking this for shipping situation if not then we checking this for calculation
isEmpty()  : bool
checks whether the object is empty
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
isShipSeparately()  : bool
Return checking of what shipment type was for this product
jsonSerialize()  : array<string|int, mixed>
Implementation of JsonSerializable::jsonSerialize()
load()  : $this
Load object data
offsetExists()  : bool
Implementation of ArrayAccess::offsetExists()
offsetGet()  : mixed
Implementation of ArrayAccess::offsetGet()
offsetSet()  : void
Implementation of ArrayAccess::offsetSet()
offsetUnset()  : void
Implementation of ArrayAccess::offsetUnset()
save()  : $this
Save object data
serialize()  : string
serialize object attributes
setAdditionalData()  : static
setAmountRefunded()  : static
setAppliedRuleIds()  : static
setAttribute()  : $this
setBaseAmountRefunded()  : static
setBaseCost()  : static
setBaseDiscountAmount()  : static
setBaseDiscountInvoiced()  : static
setBaseDiscountRefunded()  : static
setBaseHiddenTaxAmount()  : static
setBaseHiddenTaxInvoiced()  : static
setBaseHiddenTaxRefunded()  : static
setBaseOriginalPrice()  : static
setBasePrice()  : static
setBasePriceInclTax()  : static
setBaseRowInvoiced()  : static
setBaseRowTotal()  : static
setBaseRowTotalInclTax()  : static
setBaseTaxAmount()  : static
setBaseTaxBeforeDiscount()  : static
setBaseTaxInvoiced()  : static
setBaseTaxRefunded()  : static
setBaseWeeeTaxAppliedAmount()  : static
setBaseWeeeTaxAppliedRowAmount()  : static
setBaseWeeeTaxDisposition()  : static
setBaseWeeeTaxRowDisposition()  : static
setCreatedAt()  : static
setData()  : $this
Overwrite data in the object.
setDataChanges()  : $this
Clears data changes status
setDataUsingMethod()  : $this
Set object data with calling setter method
setDescription()  : static
setDiscountAmount()  : static
setDiscountInvoiced()  : static
setDiscountPercent()  : static
setDiscountRefunded()  : static
setExtOrderItemId()  : static
setFreeShipping()  : static
setGiftMessage()  : static
setGiftMessageAvailable()  : static
setGiftMessageId()  : static
setHasChildren()  : static
setHiddenTaxAmount()  : static
setHiddenTaxCanceled()  : static
setHiddenTaxInvoiced()  : static
setHiddenTaxRefunded()  : static
setId()  : $this
Declare model object identifier value
setIdFieldName()  : $this
set name of object id field
setIsQtyDecimal()  : static
setIsVirtual()  : static
setLockedDoInvoice()  : static
setLockedDoShip()  : static
setName()  : static
setNoDiscount()  : static
setOrder()  : $this
Declare order
setOrderId()  : static
setOrigData()  : $this
Initialize object original data
setOriginalPrice()  : static
setParentItem()  : $this
Set parent item
setParentItemId()  : static
setPrice()  : static
setPriceInclTax()  : static
setProduct()  : static
setProductId()  : static
setProductOptions()  : $this
Set product options
setProductType()  : static
setQtyBackordered()  : static
setQtyCanceled()  : static
setQtyInvoiced()  : static
setQtyOrdered()  : static
setQtyRefunded()  : static
setQtyShipped()  : static
setQuoteItemId()  : static
setQuoteParentItemId()  : static
setRowInvoiced()  : static
setRowTotal()  : static
setRowTotalInclTax()  : static
setRowWeight()  : static
setShippingAmount()  : static
setSku()  : static
setStoreId()  : static
setTaxAmount()  : static
setTaxBeforeDiscount()  : static
setTaxCanceled()  : static
setTaxClassId()  : static
setTaxInvoiced()  : static
setTaxPercent()  : static
setTaxRefunded()  : static
setUpdatedAt()  : static
setWeeeTaxApplied()  : static
setWeeeTaxAppliedAmount()  : static
setWeeeTaxAppliedRowAmount()  : static
setWeeeTaxDisposition()  : static
setWeeeTaxRowDisposition()  : static
setWeight()  : 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.
__toJson()  : string
Convert object attributes to JSON
__toXml()  : string
Convert object attributes to XML
_addFullNames()  : mixed
_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()  : $this
Processing object before delete data
_beforeLoad()  : $this
Processing object before load data
_beforeSave()  : $this
Prepare data before save
_camelize()  : string
_clearData()  : $this
Clearing object's data
_clearReferences()  : $this
Clearing cyclic references
_construct()  : void
Init resource model
_getData()  : mixed
Get value from _data array without parse key
_getEventData()  : array<string|int, mixed>
Get array of objects transferred to default events processing
_getQtyChildrenBackordered()  : float|null
Retrieve backordered qty of children items
_hasModelChanged()  : bool
Check whether model has changed data.
_init()  : mixed
Standard model initialization
_initOldFieldsMap()  : DataObject
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

STATUS_BACKORDERED

public mixed STATUS_BACKORDERED = 3

STATUS_CANCELED

public mixed STATUS_CANCELED = 5

STATUS_INVOICED

public mixed STATUS_INVOICED = 9

STATUS_MIXED

public mixed STATUS_MIXED = 7

STATUS_PARTIAL

public mixed STATUS_PARTIAL = 6

STATUS_PENDING

public mixed STATUS_PENDING = 1

STATUS_REFUNDED

public mixed STATUS_REFUNDED = 8

STATUS_RETURNED

public mixed STATUS_RETURNED = 4

STATUS_SHIPPED

public mixed STATUS_SHIPPED = 2

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

$_children

protected mixed $_children = []

$_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

Parameter name in event

protected string $_eventObject = 'item'

In observe method you can use $observer->getEvent()->getObject() in this case

Attributes
#[Override]

$_eventPrefix

Prefix of model events names

protected string $_eventPrefix = 'sales_order_item'
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

$_oldFieldsMap

Map short fields names to its full names

protected array<string|int, mixed> $_oldFieldsMap = []

$_origData

Original data that was loaded

protected array<string|int, mixed>|null $_origData

$_parentItem

protected mixed $_parentItem = \null

$_resourceCollectionName

Name of the resource collection model

protected string $_resourceCollectionName

$_resourceName

Name of the resource model

protected string $_resourceName

$_statuses

protected static mixed $_statuses = \null

$_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 = []

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>

addData()

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
$this

afterCommitCallback()

Callback function which called after transaction commit in resource model

public afterCommitCallback() : $this
Return values
$this

afterLoad()

Object after load processing. Implemented as public interface for supporting objects after load in collections

public afterLoad() : $this
Return values
$this

cancel()

Cancel order item

public cancel() : $this
Return values
$this

canInvoice()

Check item invoice availability

public canInvoice() : bool
Return values
bool

canRefund()

Check item refund availability

public canRefund() : bool
Return values
bool

canShip()

Check item ship availability

public canShip() : bool
Return values
bool

cleanModelCache()

Remove model object related cache

public cleanModelCache() : $this
Return values
$this

clearInstance()

Clearing object for correct deleting by garbage collector

public final clearInstance() : $this
Return values
$this

dataHasChangedFor()

Compare object data with original data

public dataHasChangedFor(string $field) : bool
Parameters
$field : string
Return values
bool

debug()

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
throws
Throwable
Return values
$this

flagDirty()

public flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
$field : string
$flag : bool = true
Return values
$this

getAdditionalData()

public getAdditionalData() : string|null
Return values
string|null

getAmountRefunded()

public getAmountRefunded() : float|null
Return values
float|null

getAppliedRuleIds()

public getAppliedRuleIds() : string|null
Return values
string|null

getBaseAmountRefunded()

public getBaseAmountRefunded() : float|null
Return values
float|null

getBaseCost()

public getBaseCost() : float|null
Return values
float|null

getBaseDiscountAmount()

public getBaseDiscountAmount() : float|null
Return values
float|null

getBaseDiscountAppliedForWeeeTax()

Get the discount amount applied on weee in base

public getBaseDiscountAppliedForWeeeTax() : float
Return values
float

getBaseDiscountInvoiced()

public getBaseDiscountInvoiced() : float|null
Return values
float|null

getBaseDiscountRefunded()

public getBaseDiscountRefunded() : float|null
Return values
float|null

getBaseHiddenTaxAmount()

public getBaseHiddenTaxAmount() : float|null
Return values
float|null

getBaseHiddenTaxInvoiced()

public getBaseHiddenTaxInvoiced() : float|null
Return values
float|null

getBaseHiddenTaxRefunded()

public getBaseHiddenTaxRefunded() : float|null
Return values
float|null

getBaseOriginalPrice()

public getBaseOriginalPrice() : float|null
Return values
float|null

getBasePrice()

public getBasePrice() : float|null
Return values
float|null

getBasePriceInclTax()

public getBasePriceInclTax() : float|null
Return values
float|null

getBaseRowInvoiced()

public getBaseRowInvoiced() : float|null
Return values
float|null

getBaseRowTotal()

public getBaseRowTotal() : float|null
Return values
float|null

getBaseRowTotalInclTax()

public getBaseRowTotalInclTax() : float|null
Return values
float|null

getBaseTaxAmount()

public getBaseTaxAmount() : float|null
Return values
float|null

getBaseTaxBeforeDiscount()

public getBaseTaxBeforeDiscount() : float|null
Return values
float|null

getBaseTaxInvoiced()

public getBaseTaxInvoiced() : float|null
Return values
float|null

getBaseTaxRefunded()

public getBaseTaxRefunded() : float|null
Return values
float|null

getBaseWeeeTaxAppliedAmount()

public getBaseWeeeTaxAppliedAmount() : float|null
Return values
float|null

getBaseWeeeTaxAppliedRowAmount()

public getBaseWeeeTaxAppliedRowAmount() : float|null
Return values
float|null

getBaseWeeeTaxDisposition()

public getBaseWeeeTaxDisposition() : float|null
Return values
float|null

getBaseWeeeTaxRowDisposition()

public getBaseWeeeTaxRowDisposition() : float|null
Return values
float|null

getBuyRequest()

Returns formatted buy request - object, holding request received from product view page with keys and options for configured product

public getBuyRequest() : DataObject
Return values
DataObject

getCacheIdTags()

Get cache tags associated with object id

public getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getCacheTags()

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>|false

getChildrenItems()

Return chilgren items of this item

public getChildrenItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCreatedAt()

public getCreatedAt() : string|null
Return values
string|null

getData()

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

getDescription()

public getDescription() : string|null
Return values
string|null

getDiscountAmount()

public getDiscountAmount() : float|null
Return values
float|null

getDiscountAppliedForWeeeTax()

Get the discount amount applied on Weee

public getDiscountAppliedForWeeeTax() : float
Return values
float

getDiscountInvoiced()

public getDiscountInvoiced() : float|null
Return values
float|null

getDiscountPercent()

public getDiscountPercent() : float|null
Return values
float|null

getDiscountRefunded()

public getDiscountRefunded() : float|null
Return values
float|null

getEntityId()

public getEntityId() : int
Return values
int

getExtOrderItemId()

public getExtOrderItemId() : string|null
Return values
string|null

getForceApplyDiscountToParentItem()

Check if discount has to be applied to parent item

public getForceApplyDiscountToParentItem() : bool
Return values
bool

getFreeShipping()

public getFreeShipping() : bool|null
Return values
bool|null

getGiftMessageAvailable()

public getGiftMessageAvailable() : int|null
Return values
int|null

getGiftMessageId()

public getGiftMessageId() : int|null
Return values
int|null

getHasChildren()

public getHasChildren() : bool|null
Return values
bool|null

getHiddenTaxAmount()

public getHiddenTaxAmount() : float|null
Return values
float|null

getHiddenTaxCanceled()

public getHiddenTaxCanceled() : float|null
Return values
float|null

getHiddenTaxInvoiced()

public getHiddenTaxInvoiced() : float|null
Return values
float|null

getHiddenTaxRefunded()

public getHiddenTaxRefunded() : float|null
Return values
float|null

getId()

Retrieve model object identifier

public getId() : int|string|null
Attributes
#[Override]
Return values
int|string|null

getIdFieldName()

Retrieve identifier field name for model

public getIdFieldName() : string
Attributes
#[Override]
Return values
string

getIsQtyDecimal()

public getIsQtyDecimal() : bool|null
Return values
bool|null

getIsVirtual()

public getIsVirtual() : bool|null
Return values
bool|null

getLockedDoInvoice()

public getLockedDoInvoice() : bool|null
Return values
bool|null

getLockedDoShip()

public getLockedDoShip() : bool|null
Return values
bool|null

getName()

public getName() : string|null
Return values
string|null

getNoDiscount()

public getNoDiscount() : bool|null
Return values
bool|null

getOrderId()

public getOrderId() : int|null
Return values
int|null

getOrigData()

Get object loaded data (original data)

public getOrigData([string $key = null ]) : mixed
Parameters
$key : string = null

getOriginalPrice()

Redeclare getter for back compatibility

public getOriginalPrice() : float
Return values
float

getParentItem()

Get parent item

public getParentItem() : $this|null
Return values
$this|null

getParentItemId()

public getParentItemId() : int|null
Return values
int|null

getParentProductId()

public getParentProductId() : int|null
Return values
int|null

getPrice()

public getPrice() : float|null
Return values
float|null

getPriceInclTax()

public getPriceInclTax() : float|null
Return values
float|null

getProductAdditionalOptions()

Display-only notes attached to the item, always a list.

public getProductAdditionalOptions() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>

getProductId()

public getProductId() : int|null
Return values
int|null

getProductOptionByCode()

Get product options array by code.

public getProductOptionByCode([string $code = null ]) : array<string|int, mixed>|string|null

If code is null return all options

Parameters
$code : string = null
Return values
array<string|int, mixed>|string|null

getProductOptions()

Get product options array

public getProductOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProductType()

public getProductType() : string|null
Return values
string|null

getQtyBackordered()

public getQtyBackordered() : float|null
Return values
float|null

getQtyCanceled()

public getQtyCanceled() : float|null
Return values
float|null

getQtyInvoiced()

public getQtyInvoiced() : float|null
Return values
float|null

getQtyOrdered()

public getQtyOrdered() : float|null
Return values
float|null

getQtyRefunded()

public getQtyRefunded() : float|null
Return values
float|null

getQtyShipped()

public getQtyShipped() : float|null
Return values
float|null

getQtyToCancel()

Retrieve item qty available for cancel

public getQtyToCancel() : float|int
Return values
float|int

getQtyToCancelBundle()

Retrieve Bundle item qty available for cancel getQtyToInvoice() will always deliver 0 for Bundle

public getQtyToCancelBundle() : float|int
Return values
float|int

getQtyToCancelBundleItem()

Retrieve Bundle child item qty available for cancel getQtyToShip() always returns 0 for BundleItems that ship together

public getQtyToCancelBundleItem() : float|int
Return values
float|int

getQtyToInvoice()

Retrieve item qty available for invoice

public getQtyToInvoice() : float|int
Return values
float|int

getQtyToRefund()

Retrieve item qty available for refund

public getQtyToRefund() : float|int
Return values
float|int

getQtyToShip()

Retrieve item qty available for ship

public getQtyToShip() : float|int
Return values
float|int

getQuoteItemId()

public getQuoteItemId() : int|null
Return values
int|null

getQuoteParentItemId()

public getQuoteParentItemId() : int|null
Return values
int|null

getRealProductType()

Return real product type of item or NULL if item is not composite

public getRealProductType() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getResourceName()

Retrieve model resource name

public getResourceName() : string
Return values
string

getRowInvoiced()

public getRowInvoiced() : float|null
Return values
float|null

getRowTotal()

public getRowTotal() : float|null
Return values
float|null

getRowTotalInclTax()

public getRowTotalInclTax() : float|null
Return values
float|null

getRowWeight()

public getRowWeight() : float|null
Return values
float|null

getSimpleQtyToShip()

Retrieve item qty available for ship

public getSimpleQtyToShip() : float|int
Return values
float|int

getSku()

public getSku() : string|null
Return values
string|null

getStatus()

Retrieve status

public getStatus() : string
Return values
string

getStatuses()

Retrieve order item statuses array

public static getStatuses() : array<string|int, mixed>
Return values
array<string|int, mixed>

getStatusId()

Retrieve item status identifier

public getStatusId() : int
Return values
int

getStatusName()

Retrieve status name

public static getStatusName(int $statusId) : string
Parameters
$statusId : int
Return values
string

getStoreId()

public getStoreId() : int|null
Return values
int|null

getTaxAmount()

public getTaxAmount() : float|null
Return values
float|null

getTaxBeforeDiscount()

public getTaxBeforeDiscount() : float|null
Return values
float|null

getTaxCanceled()

public getTaxCanceled() : float|null
Return values
float|null

getTaxClassId()

public getTaxClassId() : int|null
Return values
int|null

getTaxInvoiced()

public getTaxInvoiced() : float|null
Return values
float|null

getTaxPercent()

public getTaxPercent() : float|null
Return values
float|null

getTaxRefunded()

public getTaxRefunded() : float|null
Return values
float|null

getUpdatedAt()

public getUpdatedAt() : string|null
Return values
string|null

getWeeeTaxApplied()

public getWeeeTaxApplied() : string|null
Return values
string|null

getWeeeTaxAppliedAmount()

public getWeeeTaxAppliedAmount() : float|null
Return values
float|null

getWeeeTaxAppliedRowAmount()

public getWeeeTaxAppliedRowAmount() : float|null
Return values
float|null

getWeeeTaxDisposition()

public getWeeeTaxDisposition() : float|null
Return values
float|null

getWeeeTaxRowDisposition()

public getWeeeTaxRowDisposition() : float|null
Return values
float|null

getWeight()

public getWeight() : float|null
Return values
float|null

hasData()

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
bool

hasDataChanges()

Get data change status

public hasDataChanges() : bool
Return values
bool

hasErrors()

public hasErrors() : bool
Return values
bool

isChildrenCalculated()

Return checking of what calculation type was for this product

public isChildrenCalculated() : bool
Return values
bool

isCustomItem()

Check if the item is a custom line, with no catalog product.

public isCustomItem() : bool
Return values
bool

isDeleted()

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
bool

isDirty()

public isDirty([string $field = null ]) : bool
Parameters
$field : string = null
Return values
bool

isDummy()

This is Dummy item or not if $shipment is true then we checking this for shipping situation if not then we checking this for calculation

public isDummy([bool $shipment = false ]) : bool
Parameters
$shipment : bool = false
Return values
bool

isEmpty()

checks whether the object is empty

public isEmpty() : bool
Return values
bool

isModuleEnabled()

public isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
$moduleName : string
$helperAlias : string = 'core'
Return values
bool

isObjectNew()

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
bool

isShipSeparately()

Return checking of what shipment type was for this product

public isShipSeparately() : bool
Return values
bool

jsonSerialize()

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
$this

save()

Save object data

public save() : $this
Tags
throws
Throwable
Return values
$this

serialize()

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
string

setAdditionalData()

public setAdditionalData(string|null $value) : static
Parameters
$value : string|null
Return values
static

setAmountRefunded()

public setAmountRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setAppliedRuleIds()

public setAppliedRuleIds(string|null $value) : static
Parameters
$value : string|null
Return values
static

setBaseAmountRefunded()

public setBaseAmountRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseCost()

public setBaseCost(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseDiscountAmount()

public setBaseDiscountAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseDiscountInvoiced()

public setBaseDiscountInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseDiscountRefunded()

public setBaseDiscountRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseHiddenTaxAmount()

public setBaseHiddenTaxAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseHiddenTaxInvoiced()

public setBaseHiddenTaxInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseHiddenTaxRefunded()

public setBaseHiddenTaxRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseOriginalPrice()

public setBaseOriginalPrice(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBasePrice()

public setBasePrice(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBasePriceInclTax()

public setBasePriceInclTax(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseRowInvoiced()

public setBaseRowInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseRowTotal()

public setBaseRowTotal(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseRowTotalInclTax()

public setBaseRowTotalInclTax(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseTaxAmount()

public setBaseTaxAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseTaxBeforeDiscount()

public setBaseTaxBeforeDiscount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseTaxInvoiced()

public setBaseTaxInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseTaxRefunded()

public setBaseTaxRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseWeeeTaxAppliedAmount()

public setBaseWeeeTaxAppliedAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseWeeeTaxAppliedRowAmount()

public setBaseWeeeTaxAppliedRowAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseWeeeTaxDisposition()

public setBaseWeeeTaxDisposition(float|null $value) : static
Parameters
$value : float|null
Return values
static

setBaseWeeeTaxRowDisposition()

public setBaseWeeeTaxRowDisposition(float|null $value) : static
Parameters
$value : float|null
Return values
static

setCreatedAt()

public setCreatedAt(string|null $value) : static
Parameters
$value : string|null
Return values
static

setData()

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
$this

setDataChanges()

Clears data changes status

public setDataChanges(bool $value) : $this
Parameters
$value : bool
Return values
$this

setDataUsingMethod()

Set object data with calling setter method

public setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
$key : string
$args : mixed = []
Return values
$this

setDescription()

public setDescription(string|null $value) : static
Parameters
$value : string|null
Return values
static

setDiscountAmount()

public setDiscountAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setDiscountInvoiced()

public setDiscountInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setDiscountPercent()

public setDiscountPercent(float|null $value) : static
Parameters
$value : float|null
Return values
static

setDiscountRefunded()

public setDiscountRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setExtOrderItemId()

public setExtOrderItemId(string|null $value) : static
Parameters
$value : string|null
Return values
static

setFreeShipping()

public setFreeShipping([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setGiftMessage()

public setGiftMessage(string|null $value) : static
Parameters
$value : string|null
Return values
static

setGiftMessageAvailable()

public setGiftMessageAvailable(int|null $value) : static
Parameters
$value : int|null
Return values
static

setGiftMessageId()

public setGiftMessageId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setHasChildren()

public setHasChildren([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setHiddenTaxAmount()

public setHiddenTaxAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setHiddenTaxCanceled()

public setHiddenTaxCanceled(float|null $value) : static
Parameters
$value : float|null
Return values
static

setHiddenTaxInvoiced()

public setHiddenTaxInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setHiddenTaxRefunded()

public setHiddenTaxRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setId()

Declare model object identifier value

public setId(mixed $id) : $this
Parameters
$id : mixed
Attributes
#[Override]
Return values
$this

setIdFieldName()

set name of object id field

public setIdFieldName(string $name) : $this
Parameters
$name : string
Return values
$this

setIsQtyDecimal()

public setIsQtyDecimal([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setIsVirtual()

public setIsVirtual([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setLockedDoInvoice()

public setLockedDoInvoice([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setLockedDoShip()

public setLockedDoShip([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setName()

public setName(string|null $value) : static
Parameters
$value : string|null
Return values
static

setNoDiscount()

public setNoDiscount([bool|null $value = true ]) : static
Parameters
$value : bool|null = true
Return values
static

setOrderId()

public setOrderId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setOrigData()

Initialize object original data

public setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
$key : string = null
$data : mixed = null
Return values
$this

setOriginalPrice()

public setOriginalPrice(float|null $value) : static
Parameters
$value : float|null
Return values
static

setParentItemId()

public setParentItemId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setPrice()

public setPrice(float|null $value) : static
Parameters
$value : float|null
Return values
static

setPriceInclTax()

public setPriceInclTax(float|null $value) : static
Parameters
$value : float|null
Return values
static

setProductId()

public setProductId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setProductOptions()

Set product options

public setProductOptions(array<string|int, mixed> $options) : $this
Parameters
$options : array<string|int, mixed>
Return values
$this

setProductType()

public setProductType(string|null $value) : static
Parameters
$value : string|null
Return values
static

setQtyBackordered()

public setQtyBackordered(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQtyCanceled()

public setQtyCanceled(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQtyInvoiced()

public setQtyInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQtyOrdered()

public setQtyOrdered(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQtyRefunded()

public setQtyRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQtyShipped()

public setQtyShipped(float|null $value) : static
Parameters
$value : float|null
Return values
static

setQuoteItemId()

public setQuoteItemId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setQuoteParentItemId()

public setQuoteParentItemId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setRowInvoiced()

public setRowInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setRowTotal()

public setRowTotal(float|null $value) : static
Parameters
$value : float|null
Return values
static

setRowTotalInclTax()

public setRowTotalInclTax(float|null $value) : static
Parameters
$value : float|null
Return values
static

setRowWeight()

public setRowWeight(float|null $value) : static
Parameters
$value : float|null
Return values
static

setShippingAmount()

public setShippingAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setSku()

public setSku(string|null $value) : static
Parameters
$value : string|null
Return values
static

setStoreId()

public setStoreId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setTaxAmount()

public setTaxAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setTaxBeforeDiscount()

public setTaxBeforeDiscount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setTaxCanceled()

public setTaxCanceled(float|null $value) : static
Parameters
$value : float|null
Return values
static

setTaxClassId()

public setTaxClassId(int|null $value) : static
Parameters
$value : int|null
Return values
static

setTaxInvoiced()

public setTaxInvoiced(float|null $value) : static
Parameters
$value : float|null
Return values
static

setTaxPercent()

public setTaxPercent(float|null $value) : static
Parameters
$value : float|null
Return values
static

setTaxRefunded()

public setTaxRefunded(float|null $value) : static
Parameters
$value : float|null
Return values
static

setUpdatedAt()

public setUpdatedAt(string|null $value) : static
Parameters
$value : string|null
Return values
static

setWeeeTaxApplied()

public setWeeeTaxApplied(string|null $value) : static
Parameters
$value : string|null
Return values
static

setWeeeTaxAppliedAmount()

public setWeeeTaxAppliedAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setWeeeTaxAppliedRowAmount()

public setWeeeTaxAppliedRowAmount(float|null $value) : static
Parameters
$value : float|null
Return values
static

setWeeeTaxDisposition()

public setWeeeTaxDisposition(float|null $value) : static
Parameters
$value : float|null
Return values
static

setWeeeTaxRowDisposition()

public setWeeeTaxRowDisposition(float|null $value) : static
Parameters
$value : float|null
Return values
static

setWeight()

public setWeight(float|null $value) : static
Parameters
$value : float|null
Return values
static

toArray()

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
string

toString()

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
string

toXml()

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
string

unsetData()

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
$this

unsetOldData()

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
$this

__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

_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
Return values
$this

_beforeDelete()

Processing object before delete data

protected _beforeDelete() : $this
Return values
$this

_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()

Prepare data before save

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()

Init resource model

protected _construct() : void
Attributes
#[Override]

_getData()

Get value from _data array without parse key

protected _getData(string $key) : mixed
Parameters
$key : string

_getEventData()

Get array of objects transferred to default events processing

protected _getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getQtyChildrenBackordered()

Retrieve backordered qty of children items

protected _getQtyChildrenBackordered() : float|null
Return values
float|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() : DataObject
Attributes
#[Override]
Return values
DataObject

_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
throws
Mage_Core_Exception

_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
Return values
string
On this page

Search results