Documentation

Mage_Newsletter_Model_Queue extends Mage_Core_Model_Template
in package

Newsletter queue model.

Table of Contents

Constants

DEFAULT_DESIGN_AREA  : mixed = \Mage_Core_Model_App_Area::AREA_FRONTEND
Default design area for emulation
FROZEN_AFTER_START  : mixed = ['template_id', 'newsletter_type', 'newsletter_...
Frozen once a campaign has started: later batches must send exactly what the first one did. Status and schedule stay writable.
QUEUE_NAME  : mixed = 'newsletter'
Logical queue carrying both the campaign batches and the newsletters themselves, so a blast can be consumed by a worker of its own (`queue:work --queue=newsletter`) instead of delaying transactional mail.
STATUS_CANCEL  : mixed = 2
STATUS_NEVER  : mixed = 0
STATUS_PAUSE  : mixed = 4
STATUS_SENDING  : mixed = 1
STATUS_SENT  : mixed = 3
TYPE_HTML  : mixed = 2
TYPE_TEXT  : mixed = 1
Types of template

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
$_designConfig  : DataObject|null
Configuration of design package for template
$_dirty  : array<string|int, mixed>
$_emulatedDesignConfig  : DataObject|false
Configuration of emulated design package.
$_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
$_initialEnvironmentInfo  : DataObject|null
Initial environment information
$_isDeleted  : bool
Object delete flag
$_isObjectNew  : bool|null
Flag which allow detect object state: is it new object (without id) or existing one (with id)
$_oldFieldsMap  : array<string|int, mixed>
Map short fields names to its full names
$_origData  : array<string|int, mixed>|null
Original data that was loaded
$_resource  : Mage_Core_Model_Resource_Db_Abstract
Resource model instance
$_resourceCollectionName  : string
Name of the resource collection model
$_resourceName  : string
Name of the resource model
$_saveStoresFlag  : bool
Save stores flag.
$_stores  : array<string|int, mixed>|null
Stores assigned to queue, null until set or loaded.
$_subscribersCollection  : Mage_Newsletter_Model_Resource_Subscriber_Collection|null
Subscribers collection
$_syncFieldsMap  : mixed
Map of fields to sync to other fields upon changing their data
$_template  : Mage_Newsletter_Model_Template|null
Newsletter Template object
$_underscoreCache  : array<string|int, mixed>
Setter/Getter underscore transformation cache

Methods

__call()  : mixed
Set/Get attribute wrapper
__construct()  : mixed
Constructor
__get()  : mixed
Attribute getter (deprecated)
__set()  : mixed
Attribute setter (deprecated)
__toArray()  : array<string|int, mixed>
Convert object attributes to array
_getResource()  : Mage_Newsletter_Model_Resource_Queue
Get resource instance
addData()  : $this
Add data to the object.
addSubscribersToQueue()  : $this
Add subscribers to queue.
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
cleanModelCache()  : $this
Remove model object related cache
clearInstance()  : $this
Clearing object for correct deleting by garbage collector
dataHasChangedFor()  : bool
Compare object data with original data
debug()  : string|array<string|int, mixed>
Present object data as string in debug mode
delete()  : $this
Delete object from database
emulateDesign()  : mixed
Save current design config and replace with design config from specified store Event is not dispatched.
flagDirty()  : $this
getBillingAddress()  : Mage_Customer_Model_Address_Abstract|null
getCacheIdTags()  : array<string|int, mixed>|false
Get cache tags associated with object id
getCacheTags()  : array<string|int, mixed>|false
Get list of cache tags applied to model object.
getCollection()  : Mage_Newsletter_Model_Resource_Queue_Collection
getCreatedAt()  : string|null
getData()  : mixed
Object data getter
getDataByKey()  : mixed
Get object data by particular key
getDataByPath()  : mixed
Get object data by path
getDataForSave()  : array<string|int, mixed>
Getter data for saving
getDataSetDefault()  : mixed
Fast get data or set default if value is not available
getDataUsingMethod()  : mixed
Get object data by key with calling getter method
getDispatchDedupeKey()  : string
Every message of a campaign carries this key, so one in flight is enough to make any further dispatch of the same campaign a no-op.
getEntityId()  : int
getId()  : int|string|null
Retrieve model object identifier
getIdFieldName()  : string
Retrieve identifier field name for model
getNewsletterSenderEmail()  : string|null
getNewsletterSenderName()  : string|null
getNewsletterStyles()  : string|null
getNewsletterSubject()  : string|null
getNewsletterText()  : string|null
getNewsletterType()  : int|null
getOrigData()  : mixed
Get object loaded data (original data)
getQueueFinishAt()  : string|null
getQueueStartAt()  : string|null
getQueueStatus()  : int|null
getResource()  : Mage_Newsletter_Model_Resource_Queue
Retrieve model resource
getResourceCollection()  : Mage_Core_Model_Resource_Db_Collection_Abstract
Get collection instance
getResourceName()  : string
Retrieve model resource name
getSaveStoresFlag()  : bool
Getter for save stores flag.
getShippingAddress()  : Mage_Customer_Model_Address_Abstract|null
getStores()  : array<string|int, mixed>
Getter for stores of queue.
getSubscribersCollection()  : Mage_Newsletter_Model_Resource_Subscriber_Collection
Returns subscribers collection for this queue
getTemplate()  : Mage_Newsletter_Model_Template
Retrieve Newsletter Template object
getTemplateId()  : int|null
getType()  : int|string
Getter for template type
getUnsentSubscribersCount()  : int
Recipients of this campaign that have not been sent to yet
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
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
isNew()  : bool
Return: is this queue newly created or not.
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
isPlain()  : bool
Return true if template type eq text
isReadyToSend()  : bool
Whether this campaign may send right now: not cancelled or finished, and its start date has come.
jsonSerialize()  : array<string|int, mixed>
Implementation of JsonSerializable::jsonSerialize()
load()  : $this
Load object data
offsetExists()  : bool
Implementation of ArrayAccess::offsetExists()
offsetGet()  : mixed
Implementation of ArrayAccess::offsetGet()
offsetSet()  : void
Implementation of ArrayAccess::offsetSet()
offsetUnset()  : void
Implementation of ArrayAccess::offsetUnset()
revertDesign()  : mixed
Revert to last design config, used before emulation
save()  : $this
Save object data
scheduleSending()  : self
Dispatch a batch of this campaign onto the message queue, but only once its start date has come. A campaign scheduled for later is not parked in the queue as a long-delayed message; the cron that sweeps due campaigns picks it up when its time arrives. The dedupe key makes a repeated dispatch (admin action plus that cron) a no-op while a batch of this campaign is already queued. A handler chaining its own continuation passes $enforceDedupe = false: its own row is still in flight under the key and would swallow the continuation, yet the key must stay on the new message so outside dispatchers keep seeing the chain.
sendPerSubscriber()  : $this
Send messages to subscribers for this queue
serialize()  : string
serialize object attributes
setAttribute()  : $this
setCreatedAt()  : static
setData()  : $this
Overwrite data in the object.
setDataChanges()  : $this
Clears data changes status
setDataUsingMethod()  : $this
Set object data with calling setter method
setDesignConfig()  : $this
Initialize design information for template processing
setId()  : $this
Declare model object identifier value
setIdFieldName()  : $this
set name of object id field
setNewsletterSenderEmail()  : static
setNewsletterSenderName()  : static
setNewsletterStyles()  : static
setNewsletterSubject()  : static
setNewsletterText()  : static
setNewsletterType()  : static
setOrigData()  : $this
Initialize object original data
setQueueFinishAt()  : static
setQueueStartAt()  : static
setQueueStartAtByString()  : $this
Set $_data['queue_start'] based on string from backend, which based on locale.
setQueueStatus()  : static
setSaveStoresFlag()  : $this
Setter for save stores flag.
setStores()  : $this
Setter for stores of queue.
setTemplateId()  : static
setUpdatedAt()  : static
toArray()  : array<string|int, mixed>
Public wrapper for __toArray
toJson()  : string
Public wrapper for __toJson
toString()  : string
Public wrapper for __toString
toXml()  : string
Public wrapper for __toXml
unsetData()  : $this
Unset data from the object.
unsetOldData()  : $this
Unset old fields data from the object.
__toJson()  : string
Convert object attributes to JSON
__toXml()  : string
Convert object attributes to XML
_addFullNames()  : mixed
_afterDelete()  : $this
Processing object after delete data
_afterDeleteCommit()  : $this
Processing manipulation after main transaction commit
_afterLoad()  : $this
Processing object after load data
_afterSave()  : $this
Processing object after save data
_applyDesignConfig()  : $this
Applying of design config
_beforeDelete()  : $this
Processing object before delete data
_beforeLoad()  : $this
Processing object before load data
_beforeSave()  : $this
Processing object before save data
_camelize()  : string
_cancelDesignConfig()  : $this
Revert design settings to previous
_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
_finishQueue()  : $this
Finish queue: set status SENT and update finish date
_getData()  : mixed
Get value from _data array without parse key
_getEventData()  : array<string|int, mixed>
Get array of objects transferred to default events processing
_getStartAtUtc()  : string|null
Start date as a UTC 'Y-m-d H:i:s' string, null when the campaign has none
_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.
_loadUnsentBatch()  : Mage_Newsletter_Model_Resource_Subscriber_Collection
_prepareArray()  : array<string|int, mixed>
Set required array elements
_prepareSyncFieldsMap()  : $this
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
_protectFromNonAdmin()  : mixed
Safeguard func that will check, if we are in admin area
_setResourceModel()  : mixed
Set resource names
_underscore()  : string
Converts field names for setters and getters
getDesignConfig()  : DataObject
Get design configuration data

Constants

DEFAULT_DESIGN_AREA

Default design area for emulation

public mixed DEFAULT_DESIGN_AREA = \Mage_Core_Model_App_Area::AREA_FRONTEND

FROZEN_AFTER_START

Frozen once a campaign has started: later batches must send exactly what the first one did. Status and schedule stay writable.

public mixed FROZEN_AFTER_START = ['template_id', 'newsletter_type', 'newsletter_subject', 'newsletter_sender_name', 'newsletter_sender_email', 'newsletter_text', 'newsletter_styles', 'customer_segment_ids']

QUEUE_NAME

Logical queue carrying both the campaign batches and the newsletters themselves, so a blast can be consumed by a worker of its own (`queue:work --queue=newsletter`) instead of delaying transactional mail.

public mixed QUEUE_NAME = 'newsletter'

STATUS_CANCEL

public mixed STATUS_CANCEL = 2

STATUS_NEVER

public mixed STATUS_NEVER = 0

STATUS_PAUSE

public mixed STATUS_PAUSE = 4

STATUS_SENDING

public mixed STATUS_SENDING = 1

STATUS_SENT

public mixed STATUS_SENT = 3

TYPE_TEXT

Types of template

public mixed TYPE_TEXT = 1

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

$_designConfig

Configuration of design package for template

protected DataObject|null $_designConfig

$_dirty

protected array<string|int, mixed> $_dirty

$_emulatedDesignConfig

Configuration of emulated design package.

protected DataObject|false $_emulatedDesignConfig = \false

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

$_initialEnvironmentInfo

Initial environment information

protected DataObject|null $_initialEnvironmentInfo = \null
Tags
see
self::_applyDesignConfig()

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

$_resourceCollectionName

Name of the resource collection model

protected string $_resourceCollectionName

$_resourceName

Name of the resource model

protected string $_resourceName

$_saveStoresFlag

Save stores flag.

protected bool $_saveStoresFlag = \false

$_stores

Stores assigned to queue, null until set or loaded.

protected array<string|int, mixed>|null $_stores = \null

$_syncFieldsMap

Map of fields to sync to other fields upon changing their data

protected mixed $_syncFieldsMap = []

$_underscoreCache

Setter/Getter underscore transformation cache

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

Methods

__call()

Set/Get attribute wrapper

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

__construct()

Constructor

public __construct() : mixed

By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes

__get()

Attribute getter (deprecated)

public __get(string $var) : mixed
Parameters
$var : string

__set()

Attribute setter (deprecated)

public __set(string $var, mixed $value) : mixed
Parameters
$var : string
$value : mixed

__toArray()

Convert object attributes to array

public __toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

Return values
array<string|int, mixed>

addData()

Add data to the object.

public addData(array<string|int, mixed> $arr) : $this

Retains previous data in the object.

Parameters
$arr : array<string|int, mixed>
Return values
$this

addSubscribersToQueue()

Add subscribers to queue.

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

afterCommitCallback()

Callback function which called after transaction commit in resource model

public afterCommitCallback() : $this
Return values
$this

afterLoad()

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

public afterLoad() : $this
Return values
$this

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

emulateDesign()

Save current design config and replace with design config from specified store Event is not dispatched.

public emulateDesign(int|string $storeId[, string $area = self::DEFAULT_DESIGN_AREA ]) : mixed
Parameters
$storeId : int|string
$area : string = self::DEFAULT_DESIGN_AREA

flagDirty()

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

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

getCreatedAt()

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

getData()

Object data getter

public getData([string $key = '' ][, string|int $index = null ]) : mixed

If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data

If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.

Parameters
$key : string = ''
$index : string|int = null

getDataByKey()

Get object data by particular key

public getDataByKey(string $key) : mixed
Parameters
$key : string

getDataByPath()

Get object data by path

public getDataByPath(string $path) : mixed

Method consider the path as chain of keys: a/b/c => ['a']['b']['c']

Parameters
$path : string

getDataForSave()

Getter data for saving

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

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

getDispatchDedupeKey()

Every message of a campaign carries this key, so one in flight is enough to make any further dispatch of the same campaign a no-op.

public getDispatchDedupeKey() : string
Return values
string

getEntityId()

public getEntityId() : int
Return values
int

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

getNewsletterSenderEmail()

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

getNewsletterSenderName()

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

getNewsletterStyles()

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

getNewsletterSubject()

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

getNewsletterText()

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

getNewsletterType()

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

getOrigData()

Get object loaded data (original data)

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

getQueueFinishAt()

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

getQueueStartAt()

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

getQueueStatus()

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

getResourceName()

Retrieve model resource name

public getResourceName() : string
Return values
string

getSaveStoresFlag()

Getter for save stores flag.

public getSaveStoresFlag() : bool
Return values
bool

getStores()

Getter for stores of queue.

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

getTemplateId()

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

getType()

Getter for template type

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

getUnsentSubscribersCount()

Recipients of this campaign that have not been sent to yet

public getUnsentSubscribersCount() : int
Return values
int

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

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

isNew()

Return: is this queue newly created or not.

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

isPlain()

Return true if template type eq text

public isPlain() : bool
Return values
bool

isReadyToSend()

Whether this campaign may send right now: not cancelled or finished, and its start date has come.

public isReadyToSend() : bool
Return values
bool

jsonSerialize()

Implementation of JsonSerializable::jsonSerialize()

public jsonSerialize() : array<string|int, mixed>

Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:

  • If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
  • If a nested DataObject has a custom toJson() method, it's converted to JSON string
  • If a nested DataObject uses only the base implementations, it's excluded from output

This prevents infinite recursion and circular references when serializing object hierarchies.

Attributes
#[Override]
Return values
array<string|int, mixed>

load()

Load object data

public load(string|null|int $id[, string|null $field = null ]) : $this
Parameters
$id : string|null|int
$field : string|null = null
Return values
$this

revertDesign()

Revert to last design config, used before emulation

public revertDesign() : mixed

save()

Save object data

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

scheduleSending()

Dispatch a batch of this campaign onto the message queue, but only once its start date has come. A campaign scheduled for later is not parked in the queue as a long-delayed message; the cron that sweeps due campaigns picks it up when its time arrives. The dedupe key makes a repeated dispatch (admin action plus that cron) a no-op while a batch of this campaign is already queued. A handler chaining its own continuation passes $enforceDedupe = false: its own row is still in flight under the key and would swallow the continuation, yet the key must stay on the new message so outside dispatchers keep seeing the chain.

public scheduleSending([bool $enforceDedupe = true ]) : self
Parameters
$enforceDedupe : bool = true
Return values
self

sendPerSubscriber()

Send messages to subscribers for this queue

public sendPerSubscriber([int $count = 20 ][, array<string|int, mixed> $additionalVariables = [] ]) : $this
Parameters
$count : int = 20
$additionalVariables : array<string|int, mixed> = []
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

setCreatedAt()

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

setData()

Overwrite data in the object.

public setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this

$key can be string or array. If $key is string, the attribute value will be overwritten by $value

If $key is an array, it will overwrite all the data in the object.

Parameters
$key : string|array<string|int, mixed>
$value : mixed = null
Return values
$this

setDataChanges()

Clears data changes status

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

setDataUsingMethod()

Set object data with calling setter method

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

setDesignConfig()

Initialize design information for template processing

public setDesignConfig(array<string|int, mixed> $config) : $this
Parameters
$config : array<string|int, 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

setNewsletterSenderEmail()

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

setNewsletterSenderName()

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

setNewsletterStyles()

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

setNewsletterSubject()

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

setNewsletterText()

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

setNewsletterType()

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

setOrigData()

Initialize object original data

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

setQueueFinishAt()

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

setQueueStartAt()

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

setQueueStartAtByString()

Set $_data['queue_start'] based on string from backend, which based on locale.

public setQueueStartAtByString(string|null $startAt) : $this
Parameters
$startAt : string|null

start date of the mailing queue

Return values
$this

setQueueStatus()

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

setSaveStoresFlag()

Setter for save stores flag.

public setSaveStoresFlag(bool|int|string $value) : $this
Parameters
$value : bool|int|string
Return values
$this

setStores()

Setter for stores of queue.

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

setTemplateId()

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

setUpdatedAt()

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

toArray()

Public wrapper for __toArray

public toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
$arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>

toJson()

Public wrapper for __toJson

public toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []
Return values
string

toString()

Public wrapper for __toString

public toString([string $format = '' ]) : string

Will use $format as an template and substitute {{key}} for attributes

Parameters
$format : string = ''
Return values
string

toXml()

Public wrapper for __toXml

public toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []
$rootName : string = 'item'
$addOpenTag : bool = false
$addCdata : bool = true
Return values
string

unsetData()

Unset data from the object.

public unsetData([string $key = null ]) : $this

$key can be a string only. Array will be ignored.

Parameters
$key : string = null
Return values
$this

unsetOldData()

Unset old fields data from the object.

public unsetOldData([string $key = null ]) : $this

$key can be a string only. Array will be ignored.

Parameters
$key : string = null
Return values
$this

__toJson()

Convert object attributes to JSON

protected __toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

Return values
string

__toXml()

Convert object attributes to XML

protected __toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

$rootName : string = 'item'

name of the root element

$addOpenTag : bool = false
$addCdata : bool = true
Return values
string

_addFullNames()

protected _addFullNames() : mixed

_afterDelete()

Processing object after delete data

protected _afterDelete() : $this
Return values
$this

_afterDeleteCommit()

Processing manipulation after main transaction commit

protected _afterDeleteCommit() : $this
Return values
$this

_afterLoad()

Processing object after load data

protected _afterLoad() : $this
Return values
$this

_afterSave()

Processing object after save data

protected _afterSave() : $this
Return values
$this

_applyDesignConfig()

Applying of design config

protected _applyDesignConfig() : $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()

Processing object before save data

protected _beforeSave() : $this
Attributes
#[Override]
Return values
$this

_camelize()

protected _camelize(string $name) : string
Parameters
$name : string
Return values
string

_cancelDesignConfig()

Revert design settings to previous

protected _cancelDesignConfig() : $this
Return values
$this

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

_finishQueue()

Finish queue: set status SENT and update finish date

protected _finishQueue() : $this
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>

_getStartAtUtc()

Start date as a UTC 'Y-m-d H:i:s' string, null when the campaign has none

protected _getStartAtUtc() : string|null
Return values
string|null

_hasModelChanged()

Check whether model has changed data.

protected _hasModelChanged() : bool

Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique

Return values
bool

_init()

Standard model initialization

protected _init(string $resourceModel) : mixed
Parameters
$resourceModel : string

_initOldFieldsMap()

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.

_prepareArray()

Set required array elements

protected _prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
$elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>

_prepareSyncFieldsMap()

Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.

protected _prepareSyncFieldsMap() : $this
Return values
$this

_protectFromNonAdmin()

Safeguard func that will check, if we are in admin area

protected _protectFromNonAdmin() : mixed
Tags
throws
Mage_Core_Exception

_setResourceModel()

Set resource names

protected _setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed

If collection name is omitted, resource name will be used with _collection appended

Parameters
$resourceName : string
$resourceCollectionName : string|null = null

_underscore()

Converts field names for setters and getters

protected _underscore(string $name) : string

$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace

Parameters
$name : string
Return values
string
On this page

Search results