Mage_Sales_Model_Resource_Order_Payment_Transaction
extends Mage_Sales_Model_Resource_Order_Abstract
in package
Table of Contents
Properties
- $_commitCallbacks : array<string|int, mixed>
- Array of callbacks subscribed to commit transaction commit
- $_connections : array<string|int, mixed>
- Connections cache for this resource model
- $_entityTypeForIncrementId : string
- Entity code for increment id (Eav entity code)
- $_eventObject : string
- $_eventPrefix : string
- $_grid : bool
- Is grid available
- $_gridColumns : array<string|int, mixed>|null
- Grid columns
- $_idFieldName : string
- Main table primary key field name
- $_isPkAutoIncrement : bool
- Primery key auto increment flag
- $_mainTable : string
- Main table name
- $_mainTableFields : array<string|int, mixed>
- Fields of main table
- $_resourceModel : string
- Resource model name that contains entities (names of tables)
- $_resourcePrefix : string
- Prefix for resources that will be used in this resource model
- $_resources : Mage_Core_Model_Resource
- Cached resources singleton
- $_serializableFields : array<string|int, mixed>
- Serializeable field: additional_information
- $_tables : array<string|int, mixed>
- Tables used in this resource model
- $_uniqueFields : array<string|int, mixed>|null
- Main table unique keys field names could [ ['field' => 'db_field_name1', 'title' => 'Field 1 should be unique'] ['field' => 'db_field_name2', 'title' => 'Field 2 should be unique'] [ 'field' => ['db_field_name3', 'db_field_name3'], 'title' => 'Field 3 and Field 4 combination should be unique' ] ] or string 'my_field_name' - will be autoconverted to [ [ 'field' => 'my_field_name', 'title' => 'my_field_name' ] ]
- $_useIncrementId : bool
- Flag for using of increment id
- $_useIsObjectNew : bool
- Use additional is object new check for this resource
- $_virtualGridColumns : array<string|int, mixed>|null
- Grid virtual columns
Methods
- __construct() : mixed
- Main constructor
- addCommitCallback() : $this
- Subscribe some callback to transaction commit
- addUniqueField() : $this
- Add unique field restriction
- addVirtualGridColumn() : $this
- Add new virtual grid column
- afterLoad() : mixed
- After load
- beginTransaction() : $this
- Start resource transaction
- commit() : $this
- Commit resource transaction
- delete() : $this
- Delete the object
- formatDate() : string|null
- Format date to internal format
- getChecksum() : array<string|int, mixed>|false
- Retrieve table checksum
- getGridColumns() : array<string|int, mixed>
- Retrieve list of grid columns
- getGridTable() : string|false
- Retrieve grid table
- getIdFieldName() : string
- Get primary key field name
- getMainTable() : string
- Returns main table name - extracted from "module/table" style and validated by db adapter
- getOrderWebsiteId() : string
- Retrieve order website id
- getReadConnection() : AdapterInterface
- Temporary resolving collection compatibility
- getTable() : string
- Get table name for the entity, validated by db adapter
- getUniqueFields() : array<string|int, mixed>
- Get configuration of all unique fields
- getUpdateGridRecordsSelect() : Select
- Retrieve update grid records select
- getValueTable() : string
- Retrieve table name for the entity separated value
- getVirtualGridColumns() : array<string|int, mixed>
- Retrieve virtual grid columns
- hasConnection() : bool
- hasDataChanged() : bool
- Check that model data fields that can be saved has really changed comparing with origData
- injectAsParent() : mixed
- Update transactions in database using provided transaction as parent for them have to repeat the business logic to avoid accidental injection of wrong transactions
- isModuleEnabled() : bool
- joinVirtualGridColumnsToSelect() : $this
- Join virtual grid columns to select
- load() : $this
- Load an object
- loadObjectByTxnId() : mixed
- Load the transaction object by specified txn_id
- mktime() : int
- Convert internal date to UNIX timestamp
- resetUniqueField() : $this
- Reset unique fields restrictions
- rollBack() : $this
- Roll back resource transaction
- save() : $this
- Save object data
- saveAttribute() : $this
- Perform actions after object save
- setMainTable() : $this
- Set main resource table
- unserializeFields() : mixed
- Un-serialize serializable object fields
- updateGridRecords() : $this
- Update records in grid table
- updateOnRelatedRecordChanged() : $this
- Update grid table on entity update
- _afterDelete() : $this
- Perform actions after object delete
- _afterLoad() : $this
- Perform actions after object load
- _afterSave() : $this
- Perform actions after object save
- _afterSaveAttribute() : $this
- After save object attribute
- _beforeDelete() : $this
- Perform actions before object delete
- _beforeSave() : $this
- Lookup for parent_id in already saved transactions of this payment by the order_id Also serialize additional information, if any
- _beforeSaveAttribute() : $this
- Before save object attribute
- _canFieldHoldValue() : bool
- Return false when $field is an integer column of the main table and $value is out of its range. No row has such a value, and PostgreSQL refuses the query. The check uses the value as _getLoadSelect() converts it.
- _checkUnique() : $this
- Check for unique values existence
- _construct() : mixed
- Initialize main table and the primary key field name
- _getConnection() : AdapterInterface|false
- Get connection by name or type
- _getLoadSelect() : Select
- Retrieve select object for load object data
- _getReadAdapter() : AdapterInterface|false
- Retrieve connection for read data
- _getUniqueCheckValue() : string|null
- Return the value that the unique check compares with a column. A column that cannot hold the value stores its default, so the check uses the default. Return null when no row can hold the value.
- _getWriteAdapter() : AdapterInterface|false
- Retrieve connection for write data
- _init() : mixed
- Standard resource model initialization
- _initUniqueFields() : $this
- Initialize unique fields
- _initVirtualGridColumns() : $this
- Init virtual grid records for entity
- _postSaveFieldsUpdate() : $this
- Update field in table if model have been already saved
- _prepareDataForSave() : array<string|int, mixed>
- Prepare data for save
- _prepareDataForTable() : array<string|int, mixed>
- Prepare data for passed table
- _prepareTableValueForSave() : mixed
- Prepare value for save
- _prepareValueForSave() : mixed
- Prepare value for save
- _serializeField() : $this
- Serialize specified field in an object
- _serializeFields() : mixed
- Serialize serializable fields of the object
- _setMainTable() : $this
- Set main entity table name and primary key field name If field name is omitted {table_name}_id will be used
- _setResource() : Mage_Core_Model_Resource_Abstract
- Initialize connections and tables for this resource model If one or both arguments are string, will be used as prefix If $tables is null and $connections is string, $tables will be the same
- _unserializeField() : mixed
- Unserialize \Maho\DataObject field in an object
- _getLoadByUniqueKeySelect() : Select
- Get select object for loading transaction by the unique key of order_id, payment_id, txn_id
- _lookupByTxnId() : array<string|int, mixed>|string
- Load cell/row by specified unique key parts
Properties
$_commitCallbacks
Array of callbacks subscribed to commit transaction commit
protected
static array<string|int, mixed>
$_commitCallbacks
= []
$_connections
Connections cache for this resource model
protected
array<string|int, mixed>
$_connections
= []
$_entityTypeForIncrementId
Entity code for increment id (Eav entity code)
protected
string
$_entityTypeForIncrementId
= ''
$_eventObject
protected
string
$_eventObject
= 'resource'
$_eventPrefix
protected
string
$_eventPrefix
= 'sales_resource'
$_grid
Is grid available
protected
bool
$_grid
= \false
$_gridColumns
Grid columns
protected
array<string|int, mixed>|null
$_gridColumns
= \null
$_idFieldName
Main table primary key field name
protected
string
$_idFieldName
$_isPkAutoIncrement
Primery key auto increment flag
protected
bool
$_isPkAutoIncrement
= \true
$_mainTable
Main table name
protected
string
$_mainTable
$_mainTableFields
Fields of main table
protected
array<string|int, mixed>
$_mainTableFields
$_resourceModel
Resource model name that contains entities (names of tables)
protected
string
$_resourceModel
$_resourcePrefix
Prefix for resources that will be used in this resource model
protected
string
$_resourcePrefix
$_resources
Cached resources singleton
protected
Mage_Core_Model_Resource
$_resources
$_serializableFields
Serializeable field: additional_information
protected
array<string|int, mixed>
$_serializableFields
= ['additional_information' => [\null, []]]
Attributes
- #[Override]
$_tables
Tables used in this resource model
protected
array<string|int, mixed>
$_tables
= []
$_uniqueFields
Main table unique keys field names could [ ['field' => 'db_field_name1', 'title' => 'Field 1 should be unique'] ['field' => 'db_field_name2', 'title' => 'Field 2 should be unique'] [ 'field' => ['db_field_name3', 'db_field_name3'], 'title' => 'Field 3 and Field 4 combination should be unique' ] ] or string 'my_field_name' - will be autoconverted to [ [ 'field' => 'my_field_name', 'title' => 'my_field_name' ] ]
protected
array<string|int, mixed>|null
$_uniqueFields
= \null
$_useIncrementId
Flag for using of increment id
protected
bool
$_useIncrementId
= \false
$_useIsObjectNew
Use additional is object new check for this resource
protected
bool
$_useIsObjectNew
= \true
Attributes
- #[Override]
$_virtualGridColumns
Grid virtual columns
protected
array<string|int, mixed>|null
$_virtualGridColumns
= \null
Methods
__construct()
Main constructor
public
__construct() : mixed
addCommitCallback()
Subscribe some callback to transaction commit
public
addCommitCallback(callable $callback) : $this
Parameters
- $callback : callable
Return values
$thisaddUniqueField()
Add unique field restriction
public
addUniqueField(array<string|int, mixed>|string $field) : $this
Parameters
- $field : array<string|int, mixed>|string
Return values
$thisaddVirtualGridColumn()
Add new virtual grid column
public
addVirtualGridColumn(string $alias, string $table, array<string|int, mixed> $joinCondition, string $column) : $this
Parameters
- $alias : string
- $table : string
- $joinCondition : array<string|int, mixed>
- $column : string
Return values
$thisafterLoad()
After load
public
afterLoad(Mage_Core_Model_Abstract $object) : mixed
Parameters
- $object : Mage_Core_Model_Abstract
beginTransaction()
Start resource transaction
public
beginTransaction() : $this
Return values
$thiscommit()
Commit resource transaction
public
commit() : $this
Return values
$thisdelete()
Delete the object
public
delete(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Tags
Return values
$thisformatDate()
Format date to internal format
public
formatDate(int|string|DateTime|bool|null $date[, bool $withTime = true ]) : string|null
since 26.5 Use Mage::app()->getLocale()->formatDateForDb() instead
Parameters
- $date : int|string|DateTime|bool|null
- $withTime : bool = true
Tags
Return values
string|nullgetChecksum()
Retrieve table checksum
public
getChecksum(string|array<string|int, mixed> $table) : array<string|int, mixed>|false
Parameters
- $table : string|array<string|int, mixed>
Return values
array<string|int, mixed>|falsegetGridColumns()
Retrieve list of grid columns
public
getGridColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>getGridTable()
Retrieve grid table
public
getGridTable() : string|false
Return values
string|falsegetIdFieldName()
Get primary key field name
public
getIdFieldName() : string
Return values
stringgetMainTable()
Returns main table name - extracted from "module/table" style and validated by db adapter
public
getMainTable() : string
Return values
stringgetOrderWebsiteId()
Retrieve order website id
public
getOrderWebsiteId(int $orderId) : string
Parameters
- $orderId : int
Return values
stringgetReadConnection()
Temporary resolving collection compatibility
public
getReadConnection() : AdapterInterface
Return values
AdapterInterfacegetTable()
Get table name for the entity, validated by db adapter
public
getTable(string|array<string|int, mixed> $entityName) : string
Parameters
- $entityName : string|array<string|int, mixed>
Return values
stringgetUniqueFields()
Get configuration of all unique fields
public
getUniqueFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getUpdateGridRecordsSelect()
Retrieve update grid records select
public
getUpdateGridRecordsSelect(array<string|int, mixed> $ids, array<string|int, mixed> &$flatColumnsToSelect[, array<string|int, mixed>|null $gridColumns = null ]) : Select
Parameters
- $ids : array<string|int, mixed>
- $flatColumnsToSelect : array<string|int, mixed>
- $gridColumns : array<string|int, mixed>|null = null
Return values
SelectgetValueTable()
Retrieve table name for the entity separated value
public
getValueTable(string $entityName, string $valueType) : string
Parameters
- $entityName : string
- $valueType : string
Return values
stringgetVirtualGridColumns()
Retrieve virtual grid columns
public
getVirtualGridColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>hasConnection()
public
hasConnection(string $connectionName) : bool
Parameters
- $connectionName : string
Return values
boolhasDataChanged()
Check that model data fields that can be saved has really changed comparing with origData
public
hasDataChanged(Mage_Core_Model_Abstract $object) : bool
Parameters
- $object : Mage_Core_Model_Abstract
Return values
boolinjectAsParent()
Update transactions in database using provided transaction as parent for them have to repeat the business logic to avoid accidental injection of wrong transactions
public
injectAsParent(Mage_Sales_Model_Order_Payment_Transaction $transaction) : mixed
Parameters
- $transaction : Mage_Sales_Model_Order_Payment_Transaction
isModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
booljoinVirtualGridColumnsToSelect()
Join virtual grid columns to select
public
joinVirtualGridColumnsToSelect(string $mainTableAlias, Select $select, array<string|int, mixed> &$columnsToSelect) : $this
Parameters
- $mainTableAlias : string
- $select : Select
- $columnsToSelect : array<string|int, mixed>
Return values
$thisload()
Load an object
public
load(Mage_Core_Model_Abstract $object, mixed $value[, string|null $field = null ]) : $this
Parameters
- $object : Mage_Core_Model_Abstract
- $value : mixed
- $field : string|null = null
-
field to load by (defaults to model id)
Return values
$thisloadObjectByTxnId()
Load the transaction object by specified txn_id
public
loadObjectByTxnId(Mage_Sales_Model_Order_Payment_Transaction $transaction, int $orderId, int $paymentId, string $txnId) : mixed
Parameters
- $transaction : Mage_Sales_Model_Order_Payment_Transaction
- $orderId : int
- $paymentId : int
- $txnId : string
mktime()
Convert internal date to UNIX timestamp
public
mktime(string $str) : int
Parameters
- $str : string
Return values
intresetUniqueField()
Reset unique fields restrictions
public
resetUniqueField() : $this
Return values
$thisrollBack()
Roll back resource transaction
public
rollBack() : $this
Return values
$thissave()
Save object data
public
save(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Attributes
- #[Override]
Return values
$thissaveAttribute()
Perform actions after object save
public
saveAttribute(Mage_Core_Model_Abstract $object, string|array<string|int, string>|Mage_Eav_Model_Entity_Attribute_Abstract $attribute) : $this
Parameters
- $object : Mage_Core_Model_Abstract
- $attribute : string|array<string|int, string>|Mage_Eav_Model_Entity_Attribute_Abstract
Return values
$thissetMainTable()
Set main resource table
public
setMainTable(string $table) : $this
Parameters
- $table : string
Return values
$thisunserializeFields()
Un-serialize serializable object fields
public
unserializeFields(Mage_Core_Model_Abstract $object) : mixed
Parameters
- $object : Mage_Core_Model_Abstract
updateGridRecords()
Update records in grid table
public
updateGridRecords(array<string|int, mixed>|int $ids) : $this
Parameters
- $ids : array<string|int, mixed>|int
Return values
$thisupdateOnRelatedRecordChanged()
Update grid table on entity update
public
updateOnRelatedRecordChanged(string $field, int $entityId) : $this
Parameters
- $field : string
- $entityId : int
Return values
$this_afterDelete()
Perform actions after object delete
protected
_afterDelete(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Return values
$this_afterLoad()
Perform actions after object load
protected
_afterLoad(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Return values
$this_afterSave()
Perform actions after object save
protected
_afterSave(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Return values
$this_afterSaveAttribute()
After save object attribute
protected
_afterSaveAttribute(Mage_Core_Model_Abstract $object, array<string|int, mixed>|string $attribute) : $this
Parameters
- $object : Mage_Core_Model_Abstract
- $attribute : array<string|int, mixed>|string
Return values
$this_beforeDelete()
Perform actions before object delete
protected
_beforeDelete(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Return values
$this_beforeSave()
Lookup for parent_id in already saved transactions of this payment by the order_id Also serialize additional information, if any
protected
_beforeSave(Mage_Core_Model_Abstract $transaction) : $this
Parameters
- $transaction : Mage_Core_Model_Abstract
Tags
Attributes
- #[Override]
Return values
$this_beforeSaveAttribute()
Before save object attribute
protected
_beforeSaveAttribute(Mage_Core_Model_Abstract $object, array<string|int, mixed>|string $attribute) : $this
Parameters
- $object : Mage_Core_Model_Abstract
- $attribute : array<string|int, mixed>|string
Return values
$this_canFieldHoldValue()
Return false when $field is an integer column of the main table and $value is out of its range. No row has such a value, and PostgreSQL refuses the query. The check uses the value as _getLoadSelect() converts it.
protected
_canFieldHoldValue(string $field, mixed $value) : bool
Parameters
- $field : string
- $value : mixed
Return values
bool_checkUnique()
Check for unique values existence
protected
_checkUnique(Mage_Core_Model_Abstract $object) : $this
Parameters
- $object : Mage_Core_Model_Abstract
Tags
Return values
$this_construct()
Initialize main table and the primary key field name
protected
_construct() : mixed
Attributes
- #[Override]
_getConnection()
Get connection by name or type
protected
_getConnection(string $connectionName) : AdapterInterface|false
Parameters
- $connectionName : string
Return values
AdapterInterface|false_getLoadSelect()
Retrieve select object for load object data
protected
_getLoadSelect(string $field, mixed $value, Mage_Core_Model_Abstract $object) : Select
Parameters
- $field : string
- $value : mixed
- $object : Mage_Core_Model_Abstract
Tags
Return values
Select_getReadAdapter()
Retrieve connection for read data
protected
_getReadAdapter() : AdapterInterface|false
Attributes
- #[Override]
Return values
AdapterInterface|false_getUniqueCheckValue()
Return the value that the unique check compares with a column. A column that cannot hold the value stores its default, so the check uses the default. Return null when no row can hold the value.
protected
_getUniqueCheckValue(array<string, mixed> $column, mixed $value) : string|null
Parameters
- $column : array<string, mixed>
-
the description of the column, from describeTable()
- $value : mixed
Return values
string|null_getWriteAdapter()
Retrieve connection for write data
protected
_getWriteAdapter() : AdapterInterface|false
Attributes
- #[Override]
Return values
AdapterInterface|false_init()
Standard resource model initialization
protected
_init(string $mainTable, string $idFieldName) : mixed
Parameters
- $mainTable : string
- $idFieldName : string
_initUniqueFields()
Initialize unique fields
protected
_initUniqueFields() : $this
Return values
$this_initVirtualGridColumns()
Init virtual grid records for entity
protected
_initVirtualGridColumns() : $this
Return values
$this_postSaveFieldsUpdate()
Update field in table if model have been already saved
protected
_postSaveFieldsUpdate(Mage_Core_Model_Abstract $object, array<string|int, mixed> $data) : $this
Parameters
- $object : Mage_Core_Model_Abstract
- $data : array<string|int, mixed>
Return values
$this_prepareDataForSave()
Prepare data for save
protected
_prepareDataForSave(Mage_Core_Model_Abstract $object) : array<string|int, mixed>
Parameters
- $object : Mage_Core_Model_Abstract
Attributes
- #[Override]
Return values
array<string|int, mixed>_prepareDataForTable()
Prepare data for passed table
protected
_prepareDataForTable(DataObject $object, string $table) : array<string|int, mixed>
Parameters
- $object : DataObject
- $table : string
Return values
array<string|int, mixed>_prepareTableValueForSave()
Prepare value for save
protected
_prepareTableValueForSave(mixed $value, string $type) : mixed
Parameters
- $value : mixed
- $type : string
_prepareValueForSave()
Prepare value for save
protected
_prepareValueForSave(mixed $value, string $type) : mixed
Parameters
- $value : mixed
- $type : string
_serializeField()
Serialize specified field in an object
protected
_serializeField(DataObject $object, string $field[, mixed $defaultValue = null ][, bool $unsetEmpty = false ]) : $this
Parameters
- $object : DataObject
- $field : string
- $defaultValue : mixed = null
- $unsetEmpty : bool = false
Return values
$this_serializeFields()
Serialize serializable fields of the object
protected
_serializeFields(Mage_Core_Model_Abstract $object) : mixed
Parameters
- $object : Mage_Core_Model_Abstract
_setMainTable()
Set main entity table name and primary key field name If field name is omitted {table_name}_id will be used
protected
_setMainTable(string $mainTable[, string|null $idFieldName = null ]) : $this
Parameters
- $mainTable : string
- $idFieldName : string|null = null
Return values
$this_setResource()
Initialize connections and tables for this resource model If one or both arguments are string, will be used as prefix If $tables is null and $connections is string, $tables will be the same
protected
_setResource(string|array<string|int, mixed> $connections[, string|array<string|int, mixed>|null $tables = null ]) : Mage_Core_Model_Resource_Abstract
Parameters
- $connections : string|array<string|int, mixed>
- $tables : string|array<string|int, mixed>|null = null
Return values
Mage_Core_Model_Resource_Abstract_unserializeField()
Unserialize \Maho\DataObject field in an object
protected
_unserializeField(DataObject $object, string $field[, mixed $defaultValue = null ]) : mixed
Parameters
- $object : DataObject
- $field : string
- $defaultValue : mixed = null
Attributes
- #[Override]
_getLoadByUniqueKeySelect()
Get select object for loading transaction by the unique key of order_id, payment_id, txn_id
private
_getLoadByUniqueKeySelect(int $orderId, int $paymentId, string $txnId[, string|array<string|int, mixed>|Expr $columns = '*' ]) : Select
Parameters
- $orderId : int
- $paymentId : int
- $txnId : string
- $columns : string|array<string|int, mixed>|Expr = '*'
Return values
Select_lookupByTxnId()
Load cell/row by specified unique key parts
private
_lookupByTxnId(int $orderId, int $paymentId, string $txnId, array<string|int, mixed>|string|object $columns[, bool $isRow = false ][, string $txnType = null ]) : array<string|int, mixed>|string
Parameters
- $orderId : int
- $paymentId : int
- $txnId : string
- $columns : array<string|int, mixed>|string|object
- $isRow : bool = false
- $txnType : string = null