Mage_Sales_Model_Recurring_Profile
extends Mage_Payment_Model_Recurring_Profile
in package
Sales implementation of recurring payment profiles Implements saving and manageing profiles
Table of Contents
Constants
- BUY_REQUEST_START_DATETIME : string = 'recurring_profile_start_datetime'
- Constants for passing data through catalog
- PAYMENT_TYPE_INITIAL : mixed = 'initial'
- PAYMENT_TYPE_REGULAR : string = 'regular'
- Payment types
- PAYMENT_TYPE_TRIAL : mixed = 'trial'
- PERIOD_UNIT_DAY : string = 'day'
- Period units
- PERIOD_UNIT_MONTH : mixed = 'month'
- PERIOD_UNIT_SEMI_MONTH : mixed = 'semi_month'
- PERIOD_UNIT_WEEK : mixed = 'week'
- PERIOD_UNIT_YEAR : mixed = 'year'
- PRODUCT_OPTIONS_KEY : mixed = 'recurring_profile_options'
- STATE_ACTIVE : mixed = 'active'
- STATE_CANCELED : mixed = 'canceled'
- STATE_EXPIRED : mixed = 'expired'
- STATE_PENDING : mixed = 'pending'
- STATE_SUSPENDED : mixed = 'suspended'
- STATE_UNKNOWN : string = 'unknown'
- Available states
Properties
- $_cacheTag : string|bool|array<string|int, mixed>
- Model cache tag for clear cache in after save and after delete
- $_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>
- $_errors : array<string|int, mixed>
- Errors collected during validation
- $_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)
- $_locale : Mage_Core_Model_Locale
- Locale instance used for importing/exporting data
- $_methodInstance : Mage_Payment_Model_Method_Abstract
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_paymentMethods : array<string|int, mixed>
- Payment methods reference
- $_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
- $_store : Mage_Core_Model_Store
- Store instance used by locale or method instance
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
- $_workflow : array<string|int, mixed>
- Allowed actions matrix
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_Recurring_Profile
- Get resource instance
- activate() : mixed
- Activate the suspended profile
- addData() : $this
- Add data to the object.
- addOrderRelation() : $this
- Add order relation to recurring profile
- 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
- canActivate() : bool
- Check whether the workflow allows to activate the profile
- canCancel() : bool
- Check whether the workflow allows to cancel the profile
- cancel() : mixed
- Cancel active or suspended profile
- canFetchUpdate() : mixed
- canSuspend() : bool
- Check whether the workflow allows to suspend the profile
- cleanModelCache() : $this
- Remove model object related cache
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- createOrder() : Mage_Sales_Model_Order
- Initialize new order based on profile data
- 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
- exportScheduleInfo() : array<string|int, DataObject>
- Render available schedule information
- exportStartDatetime() : DateTimeImmutable|string
- Convert the start datetime (if set) to proper locale/timezone and return
- fetchUpdate() : mixed
- flagDirty() : $this
- getAdditionalInfo() : string|null
- getAllPeriodUnits() : array<string|int, mixed>
- Getter for available period units
- getAllStates() : array<string|int, mixed>
- Getter for all available states
- getBillFailedLater() : bool|null
- getBillingAddress() : Mage_Customer_Model_Address_Abstract|null
- getBillingAddressInfo() : array<string|int, mixed>|string|null
- getBillingAmount() : float
- Get billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
- 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.
- getChildOrderIds() : array<string|int, mixed>
- Return recurring profile child orders Ids
- getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
- getCreatedAt() : string|null
- getCurrencyCode() : string|null
- getCustomerId() : int|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
- getEntityId() : int
- getFieldComment() : string|null
- Getter for sales-related field comments
- getFieldLabel() : string|null
- Getter for sales-related field labels
- getId() : int|string|null
- Retrieve model object identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getInfoValue() : mixed|null
- Getter for additional information value It is assumed that the specified additional info is an object or associative array
- getInitAmount() : float|null
- getInitMayFail() : bool|null
- getInternalReferenceId() : string|null
- getMethodCode() : string|null
- getOrderInfo() : array<string|int, mixed>|string|null
- getOrderItemInfo() : array<string|int, mixed>|string|null
- getOrigData() : mixed
- Get object loaded data (original data)
- getPeriodFrequency() : int|null
- getPeriodMaxCycles() : int|null
- getPeriodUnit() : string|null
- getPeriodUnitLabel() : string
- Render label for specified period unit
- getProfileVendorInfo() : string|null
- getQuote() : Mage_Sales_Model_Quote|null
- getReferenceId() : string|null
- getResource() : Mage_Sales_Model_Resource_Recurring_Profile
- Retrieve model resource
- getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getScheduleDescription() : string|null
- getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
- getShippingAddressInfo() : array<string|int, mixed>|string|null
- getShippingAmount() : float|null
- getStartDateIsEditable() : bool|null
- getStartDatetime() : string|null
- getState() : string|null
- getStateLabel() : string
- Get state label based on the code
- getStoreId() : int|null
- getSubscriberName() : string|null
- getSuspensionThreshold() : int|null
- getTaxAmount() : float|null
- getTrialBillingAmount() : float
- Get trial billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
- getTrialPeriodFrequency() : int|null
- getTrialPeriodMaxCycles() : int|null
- getTrialPeriodUnit() : string|null
- getUpdatedAt() : string|null
- getValidationErrors() : array<string|int, mixed>
- Getter for errors that may appear after validation
- 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
- hasScheduleDescription() : bool
- importBuyRequest() : $this
- Collect needed information from buy request Then filter data
- importProduct() : $this|false
- Import product recurring profile information Returns false if it cannot be imported
- importQuote() : $this
- Import quote information to the profile
- importQuoteItem() : $this
- Import quote item information to the profile
- 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
- 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
- isValid() : bool
- Validate states
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadByInternalReferenceId() : $this
- Load order by system increment identifier
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- renderData() : mixed
- Render state as label
- save() : $this
- Save object data
- serialize() : string
- serialize object attributes
- setAdditionalInfo() : static
- setAttribute() : $this
- setBillFailedLater() : static
- setBillingAddressInfo() : static
- setCreatedAt() : static
- setCustomerId() : static
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setImportedStartDatetime() : static
- setInitAmount() : static
- setInitMayFail() : static
- setLocale() : $this
- Locale instance setter
- setMethodCode() : static
- setMethodInstance() : $this
- Setter for payment method instance
- setNearestStartDatetime() : $this
- Determine nearest possible profile start date
- setNewState() : static
- setOrderInfo() : static
- setOrderItemInfo() : static
- setOrigData() : $this
- Initialize object original data
- setPeriodMaxCycles() : static
- setProfileVendorInfo() : static
- setReferenceId() : static
- setScheduleDescription() : static
- setShippingAddressInfo() : static
- setShippingAmount() : static
- setStartDatetime() : static
- setState() : static
- setStore() : $this
- Store instance setter
- setSubscriberName() : static
- setSuspensionThreshold() : static
- setTaxAmount() : static
- setUpdatedAt() : static
- submit() : mixed
- Submit a recurring profile right after an order is placed
- suspend() : mixed
- Suspend active profile
- 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
- _addAdditionalOptionToItem() : mixed
- Add additional options suboption into itev
- _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
- Validate before saving
- _camelize() : string
- _checkWorkflow() : bool
- Check whether profile can be changed to specified state
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Internal constructor not depended on params. Can be used for object initialization
- _ensureLocaleAndStore() : mixed
- Check that locale and store instances are set
- _filterValues() : $this
- Automatically set "unknown" state if not defined
- _getData() : mixed
- Get value from _data array without parse key
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _getInitialItem() : Mage_Sales_Model_Order_Item
- Create and return new order item based on profile item data and $itemInfo for initial payment
- _getItem() : Mage_Sales_Model_Order_Item|void
- Create and return new order item based on profile item data and $itemInfo
- _getRegularItem() : Mage_Sales_Model_Order_Item
- Create and return new order item based on profile item data and $itemInfo for regular payment
- _getTrialItem() : Mage_Sales_Model_Order_Item
- Create and return new order item based on profile item data and $itemInfo for trial payment
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : mixed
- Inits mapping array of object's previously used fields to new fields.
- _initWorkflow() : mixed
- Initialize the workflow reference
- _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
- _renderSchedule() : array<string|int, mixed>
- Generate explanations for specified schedule parameters
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- _validateBeforeSave() : mixed
- Perform full validation before saving
- _validatePeriodFrequency() : bool
- Check accordance of the unit and frequency
- getMethodInstance() : Mage_Payment_Model_Method_Abstract
- Return payment method instance
- _cleanupArray() : void
- Recursively cleanup array from objects
Constants
BUY_REQUEST_START_DATETIME
Constants for passing data through catalog
public
string
BUY_REQUEST_START_DATETIME
= 'recurring_profile_start_datetime'
PAYMENT_TYPE_INITIAL
public
mixed
PAYMENT_TYPE_INITIAL
= 'initial'
PAYMENT_TYPE_REGULAR
Payment types
public
string
PAYMENT_TYPE_REGULAR
= 'regular'
PAYMENT_TYPE_TRIAL
public
mixed
PAYMENT_TYPE_TRIAL
= 'trial'
PERIOD_UNIT_DAY
Period units
public
string
PERIOD_UNIT_DAY
= 'day'
PERIOD_UNIT_MONTH
public
mixed
PERIOD_UNIT_MONTH
= 'month'
PERIOD_UNIT_SEMI_MONTH
public
mixed
PERIOD_UNIT_SEMI_MONTH
= 'semi_month'
PERIOD_UNIT_WEEK
public
mixed
PERIOD_UNIT_WEEK
= 'week'
PERIOD_UNIT_YEAR
public
mixed
PERIOD_UNIT_YEAR
= 'year'
PRODUCT_OPTIONS_KEY
public
mixed
PRODUCT_OPTIONS_KEY
= 'recurring_profile_options'
STATE_ACTIVE
public
mixed
STATE_ACTIVE
= 'active'
STATE_CANCELED
public
mixed
STATE_CANCELED
= 'canceled'
STATE_EXPIRED
public
mixed
STATE_EXPIRED
= 'expired'
STATE_PENDING
public
mixed
STATE_PENDING
= 'pending'
STATE_SUSPENDED
public
mixed
STATE_SUSPENDED
= 'suspended'
STATE_UNKNOWN
Available states
public
string
STATE_UNKNOWN
= 'unknown'
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
$_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
$_errors
Errors collected during validation
protected
array<string|int, mixed>
$_errors
= []
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'object'
In observe method you can use $observer->getEvent()->getObject() in this case
$_eventPrefix
Prefix of model events names
protected
string
$_eventPrefix
= 'core_abstract'
$_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
$_locale
Locale instance used for importing/exporting data
protected
Mage_Core_Model_Locale
$_locale
= \null
$_methodInstance
protected
Mage_Payment_Model_Method_Abstract
$_methodInstance
= \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
$_paymentMethods
Payment methods reference
protected
array<string|int, mixed>
$_paymentMethods
= []
$_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
$_store
Store instance used by locale or method instance
protected
Mage_Core_Model_Store
$_store
= \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
= []
$_workflow
Allowed actions matrix
protected
array<string|int, mixed>
$_workflow
= \null
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_Recurring_Profile
Return values
Mage_Sales_Model_Resource_Recurring_Profileactivate()
Activate the suspended profile
public
activate() : 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
$thisaddOrderRelation()
Add order relation to recurring profile
public
addOrderRelation(int $orderId) : $this
Parameters
- $orderId : int
Return values
$thisafterCommitCallback()
Callback function which called after transaction commit in resource model
public
afterCommitCallback() : $this
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thiscanActivate()
Check whether the workflow allows to activate the profile
public
canActivate() : bool
Return values
boolcanCancel()
Check whether the workflow allows to cancel the profile
public
canCancel() : bool
Return values
boolcancel()
Cancel active or suspended profile
public
cancel() : mixed
canFetchUpdate()
public
canFetchUpdate() : mixed
canSuspend()
Check whether the workflow allows to suspend the profile
public
canSuspend() : bool
Return values
boolcleanModelCache()
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
$thiscreateOrder()
Initialize new order based on profile data
public
createOrder() : Mage_Sales_Model_Order
Takes arbitrary number of \Maho\DataObject instances to be treated as items for new order
Return values
Mage_Sales_Model_OrderdataHasChangedFor()
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
$thisexportScheduleInfo()
Render available schedule information
public
exportScheduleInfo() : array<string|int, DataObject>
Return values
array<string|int, DataObject>exportStartDatetime()
Convert the start datetime (if set) to proper locale/timezone and return
public
exportStartDatetime([bool $asString = true ]) : DateTimeImmutable|string
Parameters
- $asString : bool = true
Return values
DateTimeImmutable|stringfetchUpdate()
public
fetchUpdate() : mixed
flagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetAdditionalInfo()
public
getAdditionalInfo() : string|null
Return values
string|nullgetAllPeriodUnits()
Getter for available period units
public
getAllPeriodUnits([bool $withLabels = true ]) : array<string|int, mixed>
Parameters
- $withLabels : bool = true
Return values
array<string|int, mixed>getAllStates()
Getter for all available states
public
getAllStates([bool $withLabels = true ]) : array<string|int, mixed>
Parameters
- $withLabels : bool = true
Return values
array<string|int, mixed>getBillFailedLater()
public
getBillFailedLater() : bool|null
Return values
bool|nullgetBillingAddress()
public
getBillingAddress() : Mage_Customer_Model_Address_Abstract|null
Return values
Mage_Customer_Model_Address_Abstract|nullgetBillingAddressInfo()
public
getBillingAddressInfo() : array<string|int, mixed>|string|null
Return values
array<string|int, mixed>|string|nullgetBillingAmount()
Get billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
public
getBillingAmount() : float
Return values
floatgetCacheIdTags()
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>|falsegetChildOrderIds()
Return recurring profile child orders Ids
public
getChildOrderIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getCollection()
public
getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_Abstract|falsegetCreatedAt()
public
getCreatedAt() : string|null
Return values
string|nullgetCurrencyCode()
public
getCurrencyCode() : string|null
Return values
string|nullgetCustomerId()
public
getCustomerId() : int|null
Return values
int|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
getEntityId()
public
getEntityId() : int
Return values
intgetFieldComment()
Getter for sales-related field comments
public
getFieldComment(string $field) : string|null
Parameters
- $field : string
Attributes
- #[Override]
Return values
string|nullgetFieldLabel()
Getter for sales-related field labels
public
getFieldLabel(string $field) : string|null
Parameters
- $field : string
Attributes
- #[Override]
Return values
string|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
stringgetInfoValue()
Getter for additional information value It is assumed that the specified additional info is an object or associative array
public
getInfoValue(string $infoKey, string $infoValueKey) : mixed|null
Parameters
- $infoKey : string
- $infoValueKey : string
Return values
mixed|nullgetInitAmount()
public
getInitAmount() : float|null
Return values
float|nullgetInitMayFail()
public
getInitMayFail() : bool|null
Return values
bool|nullgetInternalReferenceId()
public
getInternalReferenceId() : string|null
Return values
string|nullgetMethodCode()
public
getMethodCode() : string|null
Return values
string|nullgetOrderInfo()
public
getOrderInfo() : array<string|int, mixed>|string|null
Return values
array<string|int, mixed>|string|nullgetOrderItemInfo()
public
getOrderItemInfo() : array<string|int, mixed>|string|null
Return values
array<string|int, mixed>|string|nullgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getPeriodFrequency()
public
getPeriodFrequency() : int|null
Return values
int|nullgetPeriodMaxCycles()
public
getPeriodMaxCycles() : int|null
Return values
int|nullgetPeriodUnit()
public
getPeriodUnit() : string|null
Return values
string|nullgetPeriodUnitLabel()
Render label for specified period unit
public
getPeriodUnitLabel(string $unit) : string
Parameters
- $unit : string
Return values
stringgetProfileVendorInfo()
public
getProfileVendorInfo() : string|null
Return values
string|nullgetQuote()
public
getQuote() : Mage_Sales_Model_Quote|null
Return values
Mage_Sales_Model_Quote|nullgetReferenceId()
public
getReferenceId() : string|null
Return values
string|nullgetResource()
Retrieve model resource
public
getResource() : Mage_Sales_Model_Resource_Recurring_Profile
Return values
Mage_Sales_Model_Resource_Recurring_ProfilegetResourceCollection()
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
stringgetScheduleDescription()
public
getScheduleDescription() : string|null
Return values
string|nullgetShippingAddress()
public
getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
Return values
Mage_Customer_Model_Address_Abstract|nullgetShippingAddressInfo()
public
getShippingAddressInfo() : array<string|int, mixed>|string|null
Return values
array<string|int, mixed>|string|nullgetShippingAmount()
public
getShippingAmount() : float|null
Return values
float|nullgetStartDateIsEditable()
public
getStartDateIsEditable() : bool|null
Return values
bool|nullgetStartDatetime()
public
getStartDatetime() : string|null
Return values
string|nullgetState()
public
getState() : string|null
Return values
string|nullgetStateLabel()
Get state label based on the code
public
getStateLabel(string $state) : string
Parameters
- $state : string
Return values
stringgetStoreId()
public
getStoreId() : int|null
Return values
int|nullgetSubscriberName()
public
getSubscriberName() : string|null
Return values
string|nullgetSuspensionThreshold()
public
getSuspensionThreshold() : int|null
Return values
int|nullgetTaxAmount()
public
getTaxAmount() : float|null
Return values
float|nullgetTrialBillingAmount()
Get trial billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float
public
getTrialBillingAmount() : float
Return values
floatgetTrialPeriodFrequency()
public
getTrialPeriodFrequency() : int|null
Return values
int|nullgetTrialPeriodMaxCycles()
public
getTrialPeriodMaxCycles() : int|null
Return values
int|nullgetTrialPeriodUnit()
public
getTrialPeriodUnit() : string|null
Return values
string|nullgetUpdatedAt()
public
getUpdatedAt() : string|null
Return values
string|nullgetValidationErrors()
Getter for errors that may appear after validation
public
getValidationErrors([bool $isGrouped = true ][, bool $asMessage = false ]) : array<string|int, mixed>
Parameters
- $isGrouped : bool = true
- $asMessage : bool = false
Tags
Return values
array<string|int, mixed>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
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolhasScheduleDescription()
public
hasScheduleDescription() : bool
Return values
boolimportBuyRequest()
Collect needed information from buy request Then filter data
public
importBuyRequest(DataObject $buyRequest) : $this
Parameters
- $buyRequest : DataObject
Tags
Return values
$thisimportProduct()
Import product recurring profile information Returns false if it cannot be imported
public
importProduct(Mage_Catalog_Model_Product $product) : $this|false
Parameters
- $product : Mage_Catalog_Model_Product
Return values
$this|falseimportQuote()
Import quote information to the profile
public
importQuote(Mage_Sales_Model_Quote $quote) : $this
Parameters
- $quote : Mage_Sales_Model_Quote
Tags
Return values
$thisimportQuoteItem()
Import quote item information to the profile
public
importQuoteItem(Mage_Sales_Model_Quote_Item_Abstract $item) : $this
Parameters
Return values
$thisisDeleted()
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
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
boolisValid()
Validate states
public
isValid() : bool
Attributes
- #[Override]
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
$thisloadByInternalReferenceId()
Load order by system increment identifier
public
loadByInternalReferenceId(int $internalReferenceId) : $this
Parameters
- $internalReferenceId : int
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]
renderData()
Render state as label
public
renderData(string $key) : mixed
Parameters
- $key : string
Attributes
- #[Override]
save()
Save object data
public
save() : $this
Tags
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
stringsetAdditionalInfo()
public
setAdditionalInfo(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetBillFailedLater()
public
setBillFailedLater([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetBillingAddressInfo()
public
setBillingAddressInfo(array<string|int, mixed>|string|null $value) : static
Parameters
- $value : array<string|int, mixed>|string|null
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
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
$thissetId()
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
$thissetImportedStartDatetime()
public
setImportedStartDatetime(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetInitAmount()
public
setInitAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetInitMayFail()
public
setInitMayFail([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetLocale()
Locale instance setter
public
setLocale(Mage_Core_Model_Locale $locale) : $this
Parameters
- $locale : Mage_Core_Model_Locale
Return values
$thissetMethodCode()
public
setMethodCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetMethodInstance()
Setter for payment method instance
public
setMethodInstance(Mage_Payment_Model_Method_Abstract $object) : $this
Parameters
- $object : Mage_Payment_Model_Method_Abstract
Tags
Return values
$thissetNearestStartDatetime()
Determine nearest possible profile start date
public
setNearestStartDatetime([DateTime|null $minAllowed = null ]) : $this
Parameters
- $minAllowed : DateTime|null = null
Return values
$thissetNewState()
public
setNewState(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetOrderInfo()
public
setOrderInfo(array<string|int, mixed>|string|null $value) : static
Parameters
- $value : array<string|int, mixed>|string|null
Return values
staticsetOrderItemInfo()
public
setOrderItemInfo(array<string|int, mixed>|string|null $value) : static
Parameters
- $value : array<string|int, mixed>|string|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
$thissetPeriodMaxCycles()
public
setPeriodMaxCycles(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetProfileVendorInfo()
public
setProfileVendorInfo(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetReferenceId()
public
setReferenceId(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetScheduleDescription()
public
setScheduleDescription(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetShippingAddressInfo()
public
setShippingAddressInfo(array<string|int, mixed>|string|null $value) : static
Parameters
- $value : array<string|int, mixed>|string|null
Return values
staticsetShippingAmount()
public
setShippingAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetStartDatetime()
public
setStartDatetime(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetState()
public
setState(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetStore()
Store instance setter
public
setStore(Mage_Core_Model_Store $store) : $this
Parameters
- $store : Mage_Core_Model_Store
Return values
$thissetSubscriberName()
public
setSubscriberName(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetSuspensionThreshold()
public
setSuspensionThreshold(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetTaxAmount()
public
setTaxAmount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetUpdatedAt()
public
setUpdatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsubmit()
Submit a recurring profile right after an order is placed
public
submit() : mixed
suspend()
Suspend active profile
public
suspend() : mixed
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
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
$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_addAdditionalOptionToItem()
Add additional options suboption into itev
protected
_addAdditionalOptionToItem(Mage_Sales_Model_Order_Item $item, array<string|int, mixed> $option) : mixed
Parameters
- $item : Mage_Sales_Model_Order_Item
- $option : array<string|int, mixed>
_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()
Validate before saving
protected
_beforeSave() : $this
Attributes
- #[Override]
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_checkWorkflow()
Check whether profile can be changed to specified state
protected
_checkWorkflow(string $againstState[, bool $soft = true ]) : bool
Parameters
- $againstState : string
- $soft : bool = true
Tags
Return values
bool_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Internal constructor not depended on params. Can be used for object initialization
protected
_construct() : void
Attributes
- #[Override]
_ensureLocaleAndStore()
Check that locale and store instances are set
protected
_ensureLocaleAndStore() : mixed
Tags
_filterValues()
Automatically set "unknown" state if not defined
protected
_filterValues() : $this
Attributes
- #[Override]
Return values
$this_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>_getInitialItem()
Create and return new order item based on profile item data and $itemInfo for initial payment
protected
_getInitialItem(DataObject $itemInfo) : Mage_Sales_Model_Order_Item
Parameters
- $itemInfo : DataObject
Return values
Mage_Sales_Model_Order_Item_getItem()
Create and return new order item based on profile item data and $itemInfo
protected
_getItem(DataObject $itemInfo) : Mage_Sales_Model_Order_Item|void
Parameters
- $itemInfo : DataObject
Return values
Mage_Sales_Model_Order_Item|void_getRegularItem()
Create and return new order item based on profile item data and $itemInfo for regular payment
protected
_getRegularItem(DataObject $itemInfo) : Mage_Sales_Model_Order_Item
Parameters
- $itemInfo : DataObject
Return values
Mage_Sales_Model_Order_Item_getTrialItem()
Create and return new order item based on profile item data and $itemInfo for trial payment
protected
_getTrialItem(DataObject $itemInfo) : Mage_Sales_Model_Order_Item
Parameters
- $itemInfo : DataObject
Return values
Mage_Sales_Model_Order_Item_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()
Inits mapping array of object's previously used fields to new fields.
protected
_initOldFieldsMap() : mixed
Must be overloaded by descendants to set concrete fields map.
_initWorkflow()
Initialize the workflow reference
protected
_initWorkflow() : mixed
_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
_renderSchedule()
Generate explanations for specified schedule parameters
protected
_renderSchedule(string $periodKey, string $frequencyKey, string $cyclesKey) : array<string|int, mixed>
Parameters
- $periodKey : string
- $frequencyKey : string
- $cyclesKey : string
Return values
array<string|int, mixed>_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_validateBeforeSave()
Perform full validation before saving
protected
_validateBeforeSave() : mixed
Tags
_validatePeriodFrequency()
Check accordance of the unit and frequency
protected
_validatePeriodFrequency(string $unitKey, string $frequencyKey) : bool
Parameters
- $unitKey : string
- $frequencyKey : string
Return values
boolgetMethodInstance()
Return payment method instance
protected
getMethodInstance() : Mage_Payment_Model_Method_Abstract
Return values
Mage_Payment_Model_Method_Abstract_cleanupArray()
Recursively cleanup array from objects
private
_cleanupArray(array<string|int, mixed> &$array) : void
Parameters
- $array : array<string|int, mixed>