Single Newsletter Item
Base class with common features for database based items and item collections.
| copyright | four for business AG |
|---|
Item($sTable, $sPrimaryKey, $iLifetime)
| inherited_from | \Item::Item() |
|---|
Newsletter($mId)
| deprecated | [2011-03-15] Old constructor function for downwards compatibility |
|---|
__construct(mixed $mId) : void
mixedSpecifies the ID of item to load
\cInvalidArgumentException |
If table name or primary key is not set |
|---|
_inFilter(mixed $mData) : mixed
| see | \setFilters |
|---|---|
| inherited_from | \Item::_inFilter() |
mixedData to filter
mixedFiltered data_replaceTag(string $sCode, bool $bIsHTML, string $sField, string $sData)
MAIL_NAME) with data. If code is just text using str_replace; if it is HTML by using regular expressions
| access | private |
|---|
stringsCode Code, where the tags will be replaced (by reference)
boolbIsHTML Is code HTML?
stringsField Field name, without MAIL_ (e.g. just "name")
stringsData Data
deleteProperty(string $sType, string $sName) : bool
| inherited_from | \Item::deleteProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
booldeletePropertyById(int $idprop) : bool
| inherited_from | \Item::deletePropertyById() |
|---|
intId of property
boolescape(string $sString) : string
| inherited_from | \cItemBaseAbstract::escape() |
|---|---|
| inherited_from | \Item::escape() |
stringThe string to escape
stringEscaped stringget(string $sField) : mixed
| inherited_from | \Item::get() |
|---|
stringSpecifies the field to retrieve
mixedValue of the fieldgetField(string $sField) : mixed
| inherited_from | \Item::getField() |
|---|
stringSpecifies the field to retrieve
mixedValue of the fieldgetHTMLMessage() : string
stringHTML messagegetMetaObject()
| inherited_from | \Item::getMetaObject() |
|---|
getProperty(string $sType, string $sName) : mixed
| inherited_from | \Item::getProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
mixedValue of the given property or falsehtmlArticleExists() : bool
boolisLoaded() : bool
| inherited_from | \Item::isLoaded() |
|---|
boolloadBy(string $sField, mixed $mValue, bool $bSafe) : bool
| inherited_from | \Item::loadBy() |
|---|
stringSpecifies the field
mixedSpecifies the value
boolUse inFilter or not
\cException |
if more than one item has been found matching the given arguments |
|---|
boolTrue if the load was successfulloadByMany(array $aAttributes, bool $bSafe) : bool
| inherited_from | \Item::loadByMany() |
|---|
arrayassociative array with field / value pairs
boolUse inFilter or not
\cException |
if more than one item could be found matching the given arguments |
|---|
boolTrue if the load was successfulloadByPrimaryKey(string $mValue) : bool
| inherited_from | \Item::loadByPrimaryKey() |
|---|
stringSpecifies the primary key value
boolTrue if the load was successfulloadByRecordSet(array $aRecordSet)
| inherited_from | \Item::loadByRecordSet() |
|---|
arrayThe recordset of the item
register(string $event, mixed $callback, mixed $class) : void
Example: cGenericDb::register(cGenericDb::CREATE_SUCCESS, 'itemCreateHandler', 'cApiArticle'); cGenericDb::register(cGenericDb::CREATE_SUCCESS, array('cCallbackHandler', 'executeCreateHandle'), 'cApiArticle');
| inherited_from | \cGenericDb::register() |
|---|---|
| inherited_from | \cItemBaseAbstract::register() |
| inherited_from | \Item::register() |
stringCallback event, must be a valid value of a cGenericDb event constant
mixedCallback to register
mixedClass name for registering callback (can be string of array with names of the concrete Item classes)
\cInvalidArgumentException |
if event or class are not set or the callback is not callable |
|---|
send($idcatart, $destination, $to, $iChunkSize, $iChunk, $sEncoding)
| deprecated | >V4.6.15 - 21.05.2007 Sends a newsletter |
|---|
integer specifies id of the 'BlackBox'-acrticle containing the 'BlackBox'-module for management
string specifies, who will receive the newsletter ("all", "default" = defaultgroup, "selection" = selected groups, "single" = one recepient [e.g. Welcome-Newsletter])
array specifies, which group of recipients shall receive the newsletter ("all", "default" = defaultgroup, "4,5,6" = group IDs)
integer specifies size of chunks when sending in chunks, 0 = don't send in chunks
integer specifies current chunk number when sending in chunks result array array of recipient names/e-mails
sendDirect(integer $iIDCatArt, integer $iIDNewsRcp, integer $iIDNewsGroup, array $aSendRcps, string $sEncoding)
Note: Sending in chunks not supported! Only usable for tests and only a few recipients.
integeridcatart of newsletter handler article
integerIf specified, newsletter recipient id, ignored, if group specified
integerIf specified, newsletter recipient group id
arrayAs reference: Filled with a list of succesfull recipients
stringMessage (and header) encoding, e.g. iso-8859-1
sendEMail(integer $iIDCatArt, string $sEMail, string $sName, $bSimulatePlugins, string $sEncoding)
integeridcatart of newsletter handler article
stringRecipient email address
stringOptional: Recipient name
stringMessage (and header) encoding, e.g. iso-8859-1
set(string $sField, string $mValue, bool $bSafe)
| inherited_from | \Item::set() |
|---|
stringField name
stringValue to set
boolFlag to run defined inFilter on passed value
setField(string $sField, string $mValue, bool $bSafe)
| inherited_from | \Item::setField() |
|---|
stringField name
stringValue to set
boolFlag to run defined inFilter on passed value
setFilters(array $aInFilters, array $aOutFilters) : void
Examples:
$obj->setFilters(array('addslashes'), array('stripslashes'));
$obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
| inherited_from | \Item::setFilters() |
|---|
arrayArray with function names
arrayArray with function names
setProperty(string $sType, string $sName, mixed $mValue) : bool
| inherited_from | \Item::setProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
mixedSpecifies the value
boolstore() : bool
booltoArray() : array | false
| inherited_from | \Item::toArray() |
|---|
arrayfalse
unregister(string $event, mixed $class) : void
Example: cGenericDb::unregister(cGenericDb::CREATE_SUCCESS, 'cApiArticle');
| inherited_from | \cGenericDb::unregister() |
|---|---|
| inherited_from | \cItemBaseAbstract::unregister() |
| inherited_from | \Item::unregister() |
stringCallback event, must be a valid value of a cGenericDb event constant
mixedClass name for unregistering callback (can be string of array with names of the concrete Item classes)
\cInvalidArgumentException |
if the event or the class are not set |
|---|
_deChunkHTTPBody($sHeader, $sBody, $sEOL)
_executeCallbacks(string $event, string $class, array $arguments) : void
| inherited_from | \cGenericDb::_executeCallbacks() |
|---|---|
| inherited_from | \cItemBaseAbstract::_executeCallbacks() |
| inherited_from | \Item::_executeCallbacks() |
stringCallback event, must be a valid value of a cGenericDb event constant
stringClass name for executing callback
arrayArguments to pass to the callback function
\cInvalidArgumentException |
if the event or class is not set |
|---|
_getNewsletterTagData($sHTML, $sTag)
_getPropertiesCollectionInstance() : \cApiPropertyCollection
| inherited_from | \cItemBaseAbstract::_getPropertiesCollectionInstance() |
|---|---|
| inherited_from | \Item::_getPropertiesCollectionInstance() |
_getSecondDBInstance() : \cDb
| inherited_from | \cItemBaseAbstract::_getSecondDBInstance() |
|---|---|
| inherited_from | \Item::_getSecondDBInstance() |
_loadByWhereClause(string $sWhere) : bool
This function is expensive, since it executes allways a query to the database to retrieve the primary key, even if the record set is aleady cached. NOTE: Passed value has to be escaped before. This will not be done by this function.
| inherited_from | \Item::_loadByWhereClause() |
|---|
stringThe where clause like 'idart = 123 AND idlang = 1'
\cException |
if more than one item could be found matching the given where clause |
|---|
boolTrue if the load was successful_onLoad() : void
Inherited classes should override this function if desired.
| inherited_from | \Item::_onLoad() |
|---|
_outFilter(mixed $mData) : mixed
| see | \setFilters |
|---|---|
| inherited_from | \Item::_outFilter() |
mixedData to filter
mixedFiltered data_setMetaObject($sObjectName)
| inherited_from | \Item::_setMetaObject() |
|---|
$primaryKey : string
| inherited_from | \cItemBaseAbstract::$$primaryKey |
|---|---|
| inherited_from | \Item::$$primaryKey |
$values : array
| inherited_from | \Item::$$values |
|---|
$virgin : bool
If true, the object is virgin and no operations on it except load-Functions are allowed.
| inherited_from | \cItemBaseAbstract::$$virgin |
|---|---|
| inherited_from | \Item::$$virgin |
$_arrInFilters : array
| inherited_from | \Item::$$_arrInFilters |
|---|
$_arrOutFilters : array
| inherited_from | \Item::$$_arrOutFilters |
|---|
$_className : string
| inherited_from | \cItemBaseAbstract::$$_className |
|---|---|
| inherited_from | \Item::$$_className |
$_oCache : \cItemCache
| inherited_from | \cItemBaseAbstract::$$_oCache |
|---|---|
| inherited_from | \Item::$$_oCache |
$_sError : string
| access | private |
|---|
$_settings : array
| inherited_from | \cItemBaseAbstract::$$_settings |
|---|---|
| inherited_from | \Item::$$_settings |
$cache : array
| inherited_from | \cItemBaseAbstract::$$cache |
|---|---|
| inherited_from | \Item::$$cache |
$lasterror : string
| inherited_from | \cItemBaseAbstract::$$lasterror |
|---|---|
| inherited_from | \Item::$$lasterror |
$lifetime : int
| inherited_from | \cItemBaseAbstract::$$lifetime |
|---|---|
| inherited_from | \Item::$$lifetime |
$modifiedValues : array
| inherited_from | \Item::$$modifiedValues |
|---|
$oldPrimaryKey : string
| inherited_from | \Item::$$oldPrimaryKey |
|---|
$properties : \cApiPropertyCollection
| inherited_from | \cItemBaseAbstract::$$properties |
|---|---|
| inherited_from | \Item::$$properties |
$secondDb : \cDb
| inherited_from | \cItemBaseAbstract::$$secondDb |
|---|---|
| inherited_from | \Item::$$secondDb |
$table : string
| inherited_from | \cItemBaseAbstract::$$table |
|---|---|
| inherited_from | \Item::$$table |
$_callbacks : array
| inherited_from | \cGenericDb::$$_callbacks |
|---|---|
| inherited_from | \cItemBaseAbstract::$$_callbacks |
| inherited_from | \Item::$$_callbacks |
CREATE_BEFORE
Expected parameters for callback: none
| inherited_from | \cGenericDb::CREATE_BEFORE |
|---|---|
| inherited_from | \cItemBaseAbstract::CREATE_BEFORE |
| inherited_from | \Item::CREATE_BEFORE |
CREATE_FAILURE
Expected parameters for callback: none
| inherited_from | \cGenericDb::CREATE_FAILURE |
|---|---|
| inherited_from | \cItemBaseAbstract::CREATE_FAILURE |
| inherited_from | \Item::CREATE_FAILURE |
CREATE_SUCCESS
Expected parameters for callback: ID of created item
| inherited_from | \cGenericDb::CREATE_SUCCESS |
|---|---|
| inherited_from | \cItemBaseAbstract::CREATE_SUCCESS |
| inherited_from | \Item::CREATE_SUCCESS |
DELETE_BEFORE
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_BEFORE |
|---|---|
| inherited_from | \cItemBaseAbstract::DELETE_BEFORE |
| inherited_from | \Item::DELETE_BEFORE |
DELETE_FAILURE
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_FAILURE |
|---|---|
| inherited_from | \cItemBaseAbstract::DELETE_FAILURE |
| inherited_from | \Item::DELETE_FAILURE |
DELETE_SUCCESS
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_SUCCESS |
|---|---|
| inherited_from | \cItemBaseAbstract::DELETE_SUCCESS |
| inherited_from | \Item::DELETE_SUCCESS |
STORE_BEFORE
Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_BEFORE |
|---|---|
| inherited_from | \cItemBaseAbstract::STORE_BEFORE |
| inherited_from | \Item::STORE_BEFORE |
STORE_FAILURE
This is also likely to happen if query would not change anything in database! Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_FAILURE |
|---|---|
| inherited_from | \cItemBaseAbstract::STORE_FAILURE |
| inherited_from | \Item::STORE_FAILURE |
STORE_SUCCESS
Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_SUCCESS |
|---|---|
| inherited_from | \cItemBaseAbstract::STORE_SUCCESS |
| inherited_from | \Item::STORE_SUCCESS |