Documentation

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

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

$_resourceCollectionName

Name of the resource collection model

protected string $_resourceCollectionName

$_resourceName

Name of the resource model

protected string $_resourceName

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

activate()

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

addOrderRelation()

Add order relation to recurring profile

public addOrderRelation(int $orderId) : $this
Parameters
$orderId : int
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

canActivate()

Check whether the workflow allows to activate the profile

public canActivate() : bool
Return values
bool

canCancel()

Check whether the workflow allows to cancel the profile

public canCancel() : bool
Return values
bool

cancel()

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

exportScheduleInfo()

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

fetchUpdate()

public fetchUpdate() : mixed

flagDirty()

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

getAdditionalInfo()

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

getAllPeriodUnits()

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

getBillingAddressInfo()

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

getBillingAmount()

Get billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float

public getBillingAmount() : float
Return values
float

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

getChildOrderIds()

Return recurring profile child orders Ids

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

getCreatedAt()

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

getCurrencyCode()

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

getCustomerId()

public getCustomerId() : int|null
Return values
int|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

getEntityId()

public getEntityId() : int
Return values
int

getFieldComment()

Getter for sales-related field comments

public getFieldComment(string $field) : string|null
Parameters
$field : string
Attributes
#[Override]
Return values
string|null

getFieldLabel()

Getter for sales-related field labels

public getFieldLabel(string $field) : string|null
Parameters
$field : string
Attributes
#[Override]
Return values
string|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

getInfoValue()

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

getInitAmount()

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

getInitMayFail()

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

getInternalReferenceId()

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

getMethodCode()

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

getOrderInfo()

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

getOrderItemInfo()

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

getOrigData()

Get object loaded data (original data)

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

getPeriodFrequency()

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

getPeriodMaxCycles()

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

getPeriodUnit()

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

getPeriodUnitLabel()

Render label for specified period unit

public getPeriodUnitLabel(string $unit) : string
Parameters
$unit : string
Return values
string

getProfileVendorInfo()

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

getReferenceId()

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

getResourceName()

Retrieve model resource name

public getResourceName() : string
Return values
string

getScheduleDescription()

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

getShippingAddressInfo()

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

getShippingAmount()

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

getStartDateIsEditable()

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

getStartDatetime()

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

getState()

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

getStateLabel()

Get state label based on the code

public getStateLabel(string $state) : string
Parameters
$state : string
Return values
string

getStoreId()

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

getSubscriberName()

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

getSuspensionThreshold()

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

getTaxAmount()

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

getTrialBillingAmount()

Get trial billing amount with proper float casting DBAL returns DECIMAL as string, so we cast to float

public getTrialBillingAmount() : float
Return values
float

getTrialPeriodFrequency()

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

getTrialPeriodMaxCycles()

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

getTrialPeriodUnit()

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

getUpdatedAt()

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

getValidationErrors()

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

hasDataChanges()

Get data change status

public hasDataChanges() : bool
Return values
bool

hasErrors()

public hasErrors() : bool
Return values
bool

hasScheduleDescription()

public hasScheduleDescription() : 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

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

isValid()

Validate states

public isValid() : bool
Attributes
#[Override]
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

loadByInternalReferenceId()

Load order by system increment identifier

public loadByInternalReferenceId(int $internalReferenceId) : $this
Parameters
$internalReferenceId : int
Return values
$this

renderData()

Render state as label

public renderData(string $key) : mixed
Parameters
$key : string
Attributes
#[Override]

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

setAdditionalInfo()

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

setBillFailedLater()

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

setBillingAddressInfo()

public setBillingAddressInfo(array<string|int, mixed>|string|null $value) : static
Parameters
$value : array<string|int, mixed>|string|null
Return values
static

setCreatedAt()

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

setCustomerId()

public setCustomerId(int|null $value) : static
Parameters
$value : int|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

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

setImportedStartDatetime()

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

setInitAmount()

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

setInitMayFail()

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

setMethodCode()

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

setNearestStartDatetime()

Determine nearest possible profile start date

public setNearestStartDatetime([DateTime|null $minAllowed = null ]) : $this
Parameters
$minAllowed : DateTime|null = null
Return values
$this

setNewState()

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

setOrderInfo()

public setOrderInfo(array<string|int, mixed>|string|null $value) : static
Parameters
$value : array<string|int, mixed>|string|null
Return values
static

setOrderItemInfo()

public setOrderItemInfo(array<string|int, mixed>|string|null $value) : static
Parameters
$value : array<string|int, mixed>|string|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

setPeriodMaxCycles()

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

setProfileVendorInfo()

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

setReferenceId()

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

setScheduleDescription()

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

setShippingAddressInfo()

public setShippingAddressInfo(array<string|int, mixed>|string|null $value) : static
Parameters
$value : array<string|int, mixed>|string|null
Return values
static

setShippingAmount()

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

setStartDatetime()

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

setState()

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

setSubscriberName()

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

setSuspensionThreshold()

public setSuspensionThreshold(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

setUpdatedAt()

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

submit()

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

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

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

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

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

_validatePeriodFrequency()

Check accordance of the unit and frequency

protected _validatePeriodFrequency(string $unitKey, string $frequencyKey) : bool
Parameters
$unitKey : string
$frequencyKey : string
Return values
bool

_cleanupArray()

Recursively cleanup array from objects

private _cleanupArray(array<string|int, mixed> &$array) : void
Parameters
$array : array<string|int, mixed>
On this page

Search results