Version Notes
Version 3.1.0.6
Download this release
Release Info
Developer | Mattheo Geoffray |
Extension | DndInxmail_Subscriber |
Version | 3.1.0.6 |
Comparing to | |
See all releases |
Code changes from version 3.1.0.5 to 3.1.0.6
- app/code/community/DndInxmail/Subscriber/Helper/Synchronize.php +52 -17
- app/code/community/DndInxmail/Subscriber/Helper/Version.php +29 -0
- app/code/community/DndInxmail/Subscriber/Model/Observer.php +8 -4
- app/code/community/DndInxmail/Subscriber/Model/Resource/Newsletter/Subscriber.php +9 -6
- app/code/community/DndInxmail/Subscriber/Model/Xml.php +6 -2
- app/code/community/DndInxmail/Subscriber/etc/config.xml +16 -8
- app/locale/de_DE/DndInxmail_Subscriber.csv +113 -0
- lib/Inx/Api/APIException.php +39 -39
- lib/Inx/Api/Action/ActionManager.php +97 -97
- lib/Inx/Api/Action/Command.php +32 -32
- lib/Inx/Api/Action/CommandFactory.php +202 -202
- lib/Inx/Api/Action/DeleteRecipientCommand.php +18 -18
- lib/Inx/Api/Action/SendActionMailCommand.php +42 -42
- lib/Inx/Api/Action/SendMailCommand.php +56 -56
- lib/Inx/Api/Action/SetValueCommand.php +72 -72
- lib/Inx/Api/Action/SubUnsubscriptionCommand.php +61 -61
- lib/Inx/Api/Action/SubscriptionCommand.php +48 -48
- lib/Inx/Api/Action/UnsubscriptionCommand.php +56 -56
- lib/Inx/Api/Approval/Approver.php +100 -100
- lib/Inx/Api/Approval/ApproverManager.php +46 -46
- lib/Inx/Api/Blacklist/BlacklistEntry.php +102 -102
- lib/Inx/Api/Blacklist/BlacklistManager.php +109 -109
- lib/Inx/Api/ConnectException.php +18 -18
- lib/Inx/Api/DataException.php +19 -19
- lib/Inx/Api/DesignTemplate/DesignCollection.php +85 -85
- lib/Inx/Api/DesignTemplate/DesignCollectionManager.php +127 -127
- lib/Inx/Api/DesignTemplate/ImportException.php +111 -111
- lib/Inx/Api/DesignTemplate/Style.php +32 -32
- lib/Inx/Api/DesignTemplate/Template.php +50 -50
- lib/Inx/Api/FeatureNotAvailableException.php +22 -22
- lib/Inx/Api/Features.php +136 -136
- lib/Inx/Api/Filter/Filter.php +165 -165
- lib/Inx/Api/Filter/FilterManager.php +96 -96
- lib/Inx/Api/FilterStmtException.php +17 -17
- lib/Inx/Api/IOException.php +12 -12
- lib/Inx/Api/IllegalArgumentException.php +16 -16
- lib/Inx/Api/IllegalStateException.php +18 -18
- lib/Inx/Api/Inbox/InboxManager.php +98 -98
- lib/Inx/Api/Inbox/InboxMessage.php +267 -267
- lib/Inx/Api/IndexOutOfBoundsException.php +28 -28
- lib/Inx/Api/IndexSelection.php +100 -100
- lib/Inx/Api/InputStream.php +15 -15
- lib/Inx/Api/List/AdminListContext.php +25 -25
- lib/Inx/Api/List/FilterListContext.php +59 -59
- lib/Inx/Api/List/ListContext.php +166 -166
- lib/Inx/Api/List/ListContextManager.php +77 -77
- lib/Inx/Api/List/ListSize.php +29 -29
- lib/Inx/Api/List/StandardListContext.php +27 -27
- lib/Inx/Api/List/SystemListContext.php +27 -27
- lib/Inx/Api/LockException.php +43 -43
- lib/Inx/Api/LockTicket.php +105 -105
- lib/Inx/Api/LoginException.php +56 -56
- lib/Inx/Api/Mailing/ContentHandler.php +23 -23
- lib/Inx/Api/Mailing/HtmlTextContentHandler.php +19 -19
- lib/Inx/Api/Mailing/MailingManager.php +238 -238
- lib/Inx/Api/Mailing/MailingStateException.php +61 -61
- lib/Inx/Api/Mailing/MultiPartContentHandler.php +46 -46
- lib/Inx/Api/Mailing/PlainTextContentHandler.php +17 -17
- lib/Inx/Api/Mailing/SendException.php +17 -17
- lib/Inx/Api/Mailing/SendingInfo.php +56 -56
- lib/Inx/Api/Mailing/SinglePartContentHandler.php +33 -33
- lib/Inx/Api/Mailing/XsltContentHandler.php +48 -48
- lib/Inx/Api/Mailing/XsltHtmlTextContentHandler.php +34 -34
- lib/Inx/Api/Mailing/XsltMultiPartContentHandler.php +45 -45
- lib/Inx/Api/Mailing/XsltPlainTextContentHandler.php +33 -33
- lib/Inx/Api/MailingTemplate/MailingTemplate.php +130 -130
- lib/Inx/Api/MailingTemplate/MailingTemplateManager.php +96 -96
- lib/Inx/Api/NameException.php +20 -20
- lib/Inx/Api/NullPointerException.php +12 -12
- lib/Inx/Api/Order.php +19 -19
- lib/Inx/Api/Plugin/PluginStore.php +99 -99
- lib/Inx/Api/PluginStatusService.php +110 -110
- lib/Inx/Api/Property/ApprovalPropertyValue.php +141 -141
- lib/Inx/Api/Property/FormatChoicePropertyFormatter.php +467 -467
- lib/Inx/Api/Property/Property.php +126 -126
- lib/Inx/Api/Property/PropertyFormatter.php +77 -77
- lib/Inx/Api/Recipient/Attribute.php +266 -266
- lib/Inx/Api/Recipient/AttributeManager.php +159 -159
- lib/Inx/Api/Recipient/AttributeNotFoundException.php +17 -17
- lib/Inx/Api/Recipient/BatchChannel.php +267 -267
- lib/Inx/Api/Recipient/BlackListException.php +16 -16
- lib/Inx/Api/Recipient/DuplicateKeyException.php +18 -18
- lib/Inx/Api/Recipient/IllegalValueException.php +20 -20
- lib/Inx/Api/Recipient/RecipientMetaData.php +120 -120
- lib/Inx/Api/Recipient/SelectException.php +20 -20
- lib/Inx/Api/RemoteException.php +30 -30
- lib/Inx/Api/Reporting/ConfigDescriptor.php +106 -106
- lib/Inx/Api/Reporting/Control.php +129 -129
- lib/Inx/Api/Reporting/ControlUnit.php +50 -50
- lib/Inx/Api/Reporting/DownloadableResult.php +108 -108
- lib/Inx/Api/Reporting/ReportException.php +19 -19
- lib/Inx/Api/Reporting/ReportTicket.php +90 -90
- lib/Inx/Api/Resource/Resource.php +196 -196
- lib/Inx/Api/Resource/ResourceManager.php +118 -118
- lib/Inx/Api/SecurityException.php +10 -10
- lib/Inx/Api/ServerTime.php +47 -47
- lib/Inx/Api/Testprofiles/TestRecipientContext.php +146 -146
- lib/Inx/Api/TextModule/TextModule.php +156 -156
- lib/Inx/Api/TextModule/TextModuleManager.php +89 -89
- lib/Inx/Api/TriggerMail/TriggerMailingConstants.php +24 -24
- lib/Inx/Api/TriggerMail/TriggerMailingExceptionType.php +139 -139
- lib/Inx/Api/TriggerMailing/Descriptor/ActionTriggerDescriptorBuilder.php +22 -22
- lib/Inx/Api/TriggerMailing/Descriptor/AnniversaryTriggerDescriptorBuilder.php +99 -99
- lib/Inx/Api/TriggerMailing/Descriptor/AttributeTriggerDescriptorBuilder.php +108 -108
- lib/Inx/Api/TriggerMailing/Descriptor/DailyTriggerIntervalBuilder.php +25 -25
- lib/Inx/Api/TriggerMailing/Descriptor/HourlyTriggerIntervalBuilder.php +25 -25
- lib/Inx/Api/TriggerMailing/Descriptor/IntervalTriggerDescriptorBuilder.php +85 -85
- lib/Inx/Api/TriggerMailing/Descriptor/MonthlyTriggerIntervalBuilder.php +85 -85
- lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerDescriptorBuilder.php +92 -92
- lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerDispatchInterval.php +284 -284
- lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerOffset.php +132 -132
- lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerOffsetType.php +118 -118
- lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerUnit.php +199 -199
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptor.php +137 -137
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptorBuilder.php +41 -41
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptorBuilderFactory.php +70 -70
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerInterval.php +83 -83
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerIntervalBuilder.php +48 -48
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerIntervalBuilderFactory.php +52 -52
- lib/Inx/Api/TriggerMailing/Descriptor/TriggerType.php +253 -253
- lib/Inx/Api/TriggerMailing/Descriptor/WeeklyTriggerIntervalBuilder.php +67 -67
- lib/Inx/Api/TriggerMailing/FilterConcatenationType.php +148 -148
- lib/Inx/Api/TriggerMailing/SendException.php +16 -16
- lib/Inx/Api/TriggerMailing/StateFilter.php +79 -79
- lib/Inx/Api/TriggerMailing/TriggerMailingAttribute.php +476 -476
- lib/Inx/Api/TriggerMailing/TriggerMailingManager.php +337 -337
- lib/Inx/Api/TriggerMailing/TriggerMailingState.php +217 -217
- lib/Inx/Api/TriggerMailing/TriggerMailingStateException.php +76 -76
- lib/Inx/Api/TriggerMailing/TriggerState.php +135 -135
- lib/Inx/Api/UnknownRecipientException.php +10 -10
- lib/Inx/Api/UpdateException.php +72 -72
- lib/Inx/Api/User.php +83 -83
- lib/Inx/Api/UserContext.php +48 -48
- lib/Inx/Api/Util/TellAFriendException.php +58 -58
- lib/Inx/Api/Util/TemporaryMail.php +125 -125
- lib/Inx/Api/Util/TemporaryMailSender.php +87 -87
- lib/Inx/Api/Util/Utilities.php +44 -44
- lib/Inx/Api/Webpage/Webpage.php +97 -97
- lib/Inx/Api/Webpage/WebpageManager.php +90 -90
- lib/Inx/Apiimpl/Action/ActionConstants.php +4 -4
- lib/Inx/Apiimpl/Action/ActionManagerImpl.php +169 -169
- lib/Inx/Apiimpl/Action/CommandFactoryImpl.php +158 -158
- lib/Inx/Apiimpl/Action/CommandImpl.php +177 -177
- lib/Inx/Apiimpl/Action/CommandImpl/RemoveRecipientCmd.php +27 -27
- lib/Inx/Apiimpl/Action/CommandImpl/SendActionMailCmd.php +59 -59
- lib/Inx/Apiimpl/Action/CommandImpl/SendMailCmd.php +69 -69
- lib/Inx/Apiimpl/Action/CommandImpl/SetValueCmd.php +65 -65
- lib/Inx/Apiimpl/Action/CommandImpl/SubUnsubscriptionCmd.php +64 -64
- lib/Inx/Apiimpl/Action/CommandImpl/SubscriptionCmd.php +64 -64
- lib/Inx/Apiimpl/Action/CommandImpl/UnknownCmd.php +4 -4
- lib/Inx/Apiimpl/Action/CommandImpl/UnsubscriptionCmd.php +64 -64
- lib/Inx/Apiimpl/Approval/ApproverImpl.php +144 -144
- lib/Inx/Apiimpl/Approval/ApproverManagerImpl.php +124 -124
- lib/Inx/Apiimpl/Blacklist/BlacklistConstants.php +13 -13
- lib/Inx/Apiimpl/Blacklist/BlacklistEntryImpl.php +150 -150
- lib/Inx/Apiimpl/Blacklist/BlacklistManagerImpl.php +211 -211
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/AttrGetter.php +74 -74
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/BooleanGetter.php +13 -13
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DateGetter.php +13 -13
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DateTimeGetter.php +14 -14
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DoubleGetter.php +14 -14
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/IntegerGetter.php +14 -14
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/StringGetter.php +13 -13
- lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/TimeGetter.php +13 -13
- lib/Inx/Apiimpl/Constants.php +39 -39
- lib/Inx/Apiimpl/Core/BOResultSetDelegate.php +14 -14
- lib/Inx/Apiimpl/Core/DelegateBOResultSet.php +0 -11
app/code/community/DndInxmail/Subscriber/Helper/Synchronize.php
CHANGED
@@ -263,7 +263,8 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
263 |
$isSubscribed = ($recipientRowSet->next()) ? true : false;
|
264 |
|
265 |
if (!$isSubscribed && $trigger == true) {
|
266 |
-
$
|
|
|
267 |
}
|
268 |
|
269 |
if (!$isSubscribed && $trigger == false) {
|
@@ -284,7 +285,7 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
284 |
}
|
285 |
}
|
286 |
|
287 |
-
if (!$isSubscribed) {
|
288 |
$batchChannel->write($subscriptionAttribute, date("c"));
|
289 |
}
|
290 |
|
@@ -320,7 +321,8 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
320 |
$batchChannel = $recipientContext->createBatchChannel();
|
321 |
|
322 |
if ($trigger) {
|
323 |
-
$
|
|
|
324 |
}
|
325 |
else {
|
326 |
$batchChannel->selectRecipient($email);
|
@@ -1002,6 +1004,8 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
1002 |
|
1003 |
$contextListManager = $this->getListContextManager();
|
1004 |
|
|
|
|
|
1005 |
$this->doMappingCheck();
|
1006 |
|
1007 |
foreach ($groupsConfig as $groupId) {
|
@@ -1010,13 +1014,8 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
1010 |
$emails = $groupHelper->getCustomersFromGroup($groupId);
|
1011 |
|
1012 |
if (!$list = $contextListManager->findByName($listName)) {
|
1013 |
-
$
|
1014 |
-
|
1015 |
-
$description = $groupHelper->getGroupName($groupId);
|
1016 |
-
$list->updateDescription($description);
|
1017 |
-
$list->commitUpdate();
|
1018 |
-
}
|
1019 |
-
else {
|
1020 |
$this->truncateSpecificInxmailList($list);
|
1021 |
}
|
1022 |
|
@@ -1024,17 +1023,18 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
1024 |
|
1025 |
$inxmailList = $contextListManager->get($list->getId());
|
1026 |
|
1027 |
-
|
|
|
|
|
|
|
|
|
1028 |
|
1029 |
-
|
1030 |
-
if (!$subscriber
|
1031 |
continue;
|
1032 |
}
|
1033 |
-
|
1034 |
-
|
1035 |
-
$this->subscribeCustomer($email, false, $inxmailList);
|
1036 |
}
|
1037 |
-
|
1038 |
}
|
1039 |
|
1040 |
$this->closeInxmailSession();
|
@@ -1042,6 +1042,41 @@ class DndInxmail_Subscriber_Helper_Synchronize extends DndInxmail_Subscriber_Hel
|
|
1042 |
return true;
|
1043 |
}
|
1044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1045 |
|
1046 |
/**
|
1047 |
* @return bool
|
263 |
$isSubscribed = ($recipientRowSet->next()) ? true : false;
|
264 |
|
265 |
if (!$isSubscribed && $trigger == true) {
|
266 |
+
$sourceIdentifier = Mage::helper('dndinxmail_subscriber/version')->getSourceIdentifierString();
|
267 |
+
$subscriptionManager->processSubscription($sourceIdentifier, null, $inxmailList, $email);
|
268 |
}
|
269 |
|
270 |
if (!$isSubscribed && $trigger == false) {
|
285 |
}
|
286 |
}
|
287 |
|
288 |
+
if (!$isSubscribed && $trigger == false) {
|
289 |
$batchChannel->write($subscriptionAttribute, date("c"));
|
290 |
}
|
291 |
|
321 |
$batchChannel = $recipientContext->createBatchChannel();
|
322 |
|
323 |
if ($trigger) {
|
324 |
+
$sourceIdentifier = Mage::helper('dndinxmail_subscriber/version')->getSourceIdentifierString();
|
325 |
+
$subscriptionManager->processUnsubscription($sourceIdentifier, null, $inxmailList, $email);
|
326 |
}
|
327 |
else {
|
328 |
$batchChannel->selectRecipient($email);
|
1004 |
|
1005 |
$contextListManager = $this->getListContextManager();
|
1006 |
|
1007 |
+
$this->_createMissingLists($groupsConfig);
|
1008 |
+
|
1009 |
$this->doMappingCheck();
|
1010 |
|
1011 |
foreach ($groupsConfig as $groupId) {
|
1014 |
$emails = $groupHelper->getCustomersFromGroup($groupId);
|
1015 |
|
1016 |
if (!$list = $contextListManager->findByName($listName)) {
|
1017 |
+
$this->_createMissingListByGroup($groupId);
|
1018 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
1019 |
$this->truncateSpecificInxmailList($list);
|
1020 |
}
|
1021 |
|
1023 |
|
1024 |
$inxmailList = $contextListManager->get($list->getId());
|
1025 |
|
1026 |
+
/** @var Mage_Newsletter_Model_Resource_Subscriber_Collection $subscriberCollection */
|
1027 |
+
$subscriberCollection = Mage::getModel('newsletter/subscriber')->getCollection();
|
1028 |
+
$subscriberCollection->useOnlySubscribed()
|
1029 |
+
->addFieldToFilter('subscriber_email', array('in' => $emails));
|
1030 |
+
$subscriberCollection->getSelect()->group('main_table.subscriber_email');
|
1031 |
|
1032 |
+
foreach ($subscriberCollection as $subscriber) {
|
1033 |
+
if (!$subscriber->isSubscribed()) {
|
1034 |
continue;
|
1035 |
}
|
1036 |
+
$this->subscribeCustomer($subscriber->getEmail(), false, $inxmailList);
|
|
|
|
|
1037 |
}
|
|
|
1038 |
}
|
1039 |
|
1040 |
$this->closeInxmailSession();
|
1042 |
return true;
|
1043 |
}
|
1044 |
|
1045 |
+
/**
|
1046 |
+
* @param $groupIds
|
1047 |
+
*
|
1048 |
+
* @throws Exception
|
1049 |
+
*/
|
1050 |
+
protected function _createMissingLists($groupIds)
|
1051 |
+
{
|
1052 |
+
$groupHelper = Mage::helper('dndinxmail_subscriber/group');
|
1053 |
+
$contextListManager = $this->getListContextManager();
|
1054 |
+
foreach ($groupIds as $groupId) {
|
1055 |
+
$listName = $groupHelper->formatInxmailListName($groupId);
|
1056 |
+
if ($contextListManager->findByName($listName)) {
|
1057 |
+
continue;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
$this->_createMissingListByGroup($groupId);
|
1061 |
+
}
|
1062 |
+
}
|
1063 |
+
|
1064 |
+
/**
|
1065 |
+
* @param $groupId
|
1066 |
+
*/
|
1067 |
+
protected function _createMissingListByGroup($groupId)
|
1068 |
+
{
|
1069 |
+
$groupHelper = Mage::helper('dndinxmail_subscriber/group');
|
1070 |
+
$contextListManager = $this->getListContextManager();
|
1071 |
+
$listName = $groupHelper->formatInxmailListName($groupId);
|
1072 |
+
|
1073 |
+
$list = $contextListManager->createStandardList();
|
1074 |
+
$list->updateName($listName);
|
1075 |
+
$description = $groupHelper->getGroupName($groupId);
|
1076 |
+
$list->updateDescription($description);
|
1077 |
+
$list->commitUpdate();
|
1078 |
+
}
|
1079 |
+
|
1080 |
|
1081 |
/**
|
1082 |
* @return bool
|
app/code/community/DndInxmail/Subscriber/Helper/Version.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @category Module Helper
|
5 |
+
* @package DndInxmail_Subscriber
|
6 |
+
* @dev Alexander Velykzhanin
|
7 |
+
* @last_modified 12/10/2015
|
8 |
+
* @copyright Copyright (c) 2015 Flagbit GmbH & Co. KG
|
9 |
+
* @author Flagbit GmbH & Co. KG : https://www.flagbit.de/
|
10 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
11 |
+
*/
|
12 |
+
class DndInxmail_Subscriber_Helper_Version extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
public function getSourceIdentifierString()
|
18 |
+
{
|
19 |
+
return sprintf('Magento %s - Inx %s', Mage::getVersion(), $this->getInxmailVersion());
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public function getInxmailVersion()
|
26 |
+
{
|
27 |
+
return Mage::getConfig()->getModuleConfig('DndInxmail_Subscriber')->version;
|
28 |
+
}
|
29 |
+
}
|
app/code/community/DndInxmail/Subscriber/Model/Observer.php
CHANGED
@@ -116,20 +116,24 @@ class DndInxmail_Subscriber_Model_Observer
|
|
116 |
}
|
117 |
|
118 |
$synchronize = Mage::helper('dndinxmail_subscriber/synchronize');
|
119 |
-
$unsubscribed = array();
|
120 |
|
121 |
foreach (Mage::app()->getWebsites() as $website) {
|
122 |
foreach ($website->getGroups() as $group) {
|
123 |
$stores = $group->getStores();
|
124 |
foreach ($stores as $store) {
|
125 |
$unsubscribedStore = $synchronize->getUnsubscribedCustomers($store->getStoreId());
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
}
|
129 |
}
|
130 |
|
131 |
-
$synchronize->unsubscribeCustomersFromInxmail($unsubscribed);
|
132 |
-
|
133 |
$synchronize->unsubscribeCustomersFromGroups();
|
134 |
|
135 |
return true;
|
116 |
}
|
117 |
|
118 |
$synchronize = Mage::helper('dndinxmail_subscriber/synchronize');
|
|
|
119 |
|
120 |
foreach (Mage::app()->getWebsites() as $website) {
|
121 |
foreach ($website->getGroups() as $group) {
|
122 |
$stores = $group->getStores();
|
123 |
foreach ($stores as $store) {
|
124 |
$unsubscribedStore = $synchronize->getUnsubscribedCustomers($store->getStoreId());
|
125 |
+
|
126 |
+
// Emulate store that is synchronized to get correct email subscription by store
|
127 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
128 |
+
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($store->getStoreId());
|
129 |
+
|
130 |
+
$synchronize->unsubscribeCustomersFromInxmail($unsubscribedStore);
|
131 |
+
|
132 |
+
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
|
133 |
}
|
134 |
}
|
135 |
}
|
136 |
|
|
|
|
|
137 |
$synchronize->unsubscribeCustomersFromGroups();
|
138 |
|
139 |
return true;
|
app/code/community/DndInxmail/Subscriber/Model/Resource/Newsletter/Subscriber.php
CHANGED
@@ -16,13 +16,16 @@ class DndInxmail_Subscriber_Model_Resource_Newsletter_Subscriber extends Mage_Ne
|
|
16 |
|
17 |
$select = $this->_read->select()
|
18 |
->from($this->getMainTable())
|
19 |
-
->where('subscriber_email=:subscriber_email')
|
20 |
-
->where('store_id=:store_id'); // Add store ID for newsletters
|
21 |
|
22 |
-
$
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
|
27 |
if (!$result) {
|
28 |
return array();
|
16 |
|
17 |
$select = $this->_read->select()
|
18 |
->from($this->getMainTable())
|
19 |
+
->where('subscriber_email=:subscriber_email');
|
|
|
20 |
|
21 |
+
$bind = array('subscriber_email' => $subscriberEmail);
|
22 |
+
// Add store ID for newsletters
|
23 |
+
if ($storeId != Mage_Core_Model_App::ADMIN_STORE_ID) {
|
24 |
+
$select->where('store_id=:store_id');
|
25 |
+
$bind['store_id'] = $storeId;
|
26 |
+
}
|
27 |
+
|
28 |
+
$result = $this->_read->fetchRow($select, $bind);
|
29 |
|
30 |
if (!$result) {
|
31 |
return array();
|
app/code/community/DndInxmail/Subscriber/Model/Xml.php
CHANGED
@@ -45,8 +45,12 @@ class DndInxmail_Subscriber_Model_Xml extends Mage_Core_Model_Abstract
|
|
45 |
$xmlAttr = "";
|
46 |
|
47 |
if (count($attributes) != 0) {
|
48 |
-
foreach ($attributes as $
|
49 |
-
$
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
}
|
52 |
|
45 |
$xmlAttr = "";
|
46 |
|
47 |
if (count($attributes) != 0) {
|
48 |
+
foreach ($attributes as $attributeCode) {
|
49 |
+
$attribute = $product->getResource()->getAttribute($attributeCode);
|
50 |
+
if (!$attribute) {
|
51 |
+
continue;
|
52 |
+
}
|
53 |
+
$xmlAttr .= "<" . ucfirst($attributeCode) . ">" . htmlspecialchars($product->getAttributeText($attributeCode)) . "</" . ucfirst($attributeCode) . ">";
|
54 |
}
|
55 |
}
|
56 |
|
app/code/community/DndInxmail/Subscriber/etc/config.xml
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
<config>
|
14 |
<modules>
|
15 |
<DndInxmail_Subscriber>
|
16 |
-
<version>3.1.0.
|
17 |
</DndInxmail_Subscriber>
|
18 |
</modules>
|
19 |
<global>
|
@@ -182,25 +182,33 @@
|
|
182 |
<customer_config_orders_options_single_date>30</customer_config_orders_options_single_date>
|
183 |
</mapping_groups>
|
184 |
</dndinxmail_subscriber_mapping>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
</default>
|
186 |
<crontab>
|
187 |
<jobs>
|
188 |
<dndinxmail_subscriber_synchronize_unsubscribed>
|
189 |
-
<schedule>
|
190 |
-
<cron_expr>0 * * * *</cron_expr>
|
191 |
-
</schedule>
|
192 |
<run>
|
193 |
<model>dndinxmail_subscriber/observer::synchronizeUnsubscribed</model>
|
194 |
</run>
|
195 |
</dndinxmail_subscriber_synchronize_unsubscribed>
|
196 |
<dndinxmail_subscriber_synchronize_customer_group>
|
197 |
-
<schedule>
|
198 |
-
<cron_expr>0 1 * * *</cron_expr>
|
199 |
-
</schedule>
|
200 |
<run>
|
201 |
<model>dndinxmail_subscriber/observer::synchronizeCustomerGroup</model>
|
202 |
</run>
|
203 |
</dndinxmail_subscriber_synchronize_customer_group>
|
204 |
</jobs>
|
205 |
</crontab>
|
206 |
-
</config>
|
13 |
<config>
|
14 |
<modules>
|
15 |
<DndInxmail_Subscriber>
|
16 |
+
<version>3.1.0.6</version>
|
17 |
</DndInxmail_Subscriber>
|
18 |
</modules>
|
19 |
<global>
|
182 |
<customer_config_orders_options_single_date>30</customer_config_orders_options_single_date>
|
183 |
</mapping_groups>
|
184 |
</dndinxmail_subscriber_mapping>
|
185 |
+
<crontab>
|
186 |
+
<jobs>
|
187 |
+
<dndinxmail_subscriber_synchronize_unsubscribed>
|
188 |
+
<schedule>
|
189 |
+
<cron_expr>0 * * * *</cron_expr>
|
190 |
+
</schedule>
|
191 |
+
</dndinxmail_subscriber_synchronize_unsubscribed>
|
192 |
+
<dndinxmail_subscriber_synchronize_customer_group>
|
193 |
+
<schedule>
|
194 |
+
<cron_expr>0 1 * * *</cron_expr>
|
195 |
+
</schedule>
|
196 |
+
</dndinxmail_subscriber_synchronize_customer_group>
|
197 |
+
</jobs>
|
198 |
+
</crontab>
|
199 |
</default>
|
200 |
<crontab>
|
201 |
<jobs>
|
202 |
<dndinxmail_subscriber_synchronize_unsubscribed>
|
|
|
|
|
|
|
203 |
<run>
|
204 |
<model>dndinxmail_subscriber/observer::synchronizeUnsubscribed</model>
|
205 |
</run>
|
206 |
</dndinxmail_subscriber_synchronize_unsubscribed>
|
207 |
<dndinxmail_subscriber_synchronize_customer_group>
|
|
|
|
|
|
|
208 |
<run>
|
209 |
<model>dndinxmail_subscriber/observer::synchronizeCustomerGroup</model>
|
210 |
</run>
|
211 |
</dndinxmail_subscriber_synchronize_customer_group>
|
212 |
</jobs>
|
213 |
</crontab>
|
214 |
+
</config>
|
app/locale/de_DE/DndInxmail_Subscriber.csv
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Enabled","Aktiviert"
|
2 |
+
"API Url","API Url"
|
3 |
+
"API User","API Benutzer"
|
4 |
+
"API Password","API Passwort"
|
5 |
+
"General","Allgemein"
|
6 |
+
"Guest","Gast"
|
7 |
+
"Magento subscribers are successfully synchronized to Inxmail.","Die Newsletter-Abonnenten aus Magento wurden erfolgreich nach Inxmail synchronisiert."
|
8 |
+
"Synchronize All Subscribers","Alle Abonnenten synchronisieren"
|
9 |
+
"Inxmail List","Inxmail Mailingliste"
|
10 |
+
"Fields to synchronize","Felder synchronisieren"
|
11 |
+
"Synchronize all Magento subscribers to Inxmail","Alle Newsletter-Abonnenten nach Inxmail synchronisieren."
|
12 |
+
"Select your Inxmail list","Wählen Sie die Inxmail Mailingliste"
|
13 |
+
"Mapping <strong>{customer_attribute}:{inxmail_attribute}</strong><br/><span class="notice">If the {inxmail_attribute} is not defined, the value of {customer_attribute} will be taken</span>","Zuordnung <strong>{attribut_client}:{attribut_inxmail}</strong><br/><span class="notice">Wenn {attribut_inxmail} nicht definiert ist, wird der {attribut_client} Wert verwendet</span>"
|
14 |
+
"Synchronize now","Jetzt synchronisieren"
|
15 |
+
"Disabled","Deaktiviert"
|
16 |
+
"No list selected","Keine Mailingliste ausgewählt"
|
17 |
+
"No list defined in configuration","Keine Mailingliste in der Konfiguration definiert"
|
18 |
+
"No column available","Keine Spalte verfügbar"
|
19 |
+
"No list available","Keine Mailingliste verfügbar"
|
20 |
+
"Inxmail session does not exist","Inxmail-Sitzung nicht aktiv"
|
21 |
+
"Yes","Ja"
|
22 |
+
"No","Nein"
|
23 |
+
"Inxmail API Error: %s","Inxmail API Fehler: %s"
|
24 |
+
"Mapping Customer Fields","Zuordnung Kundenfelder"
|
25 |
+
"Mapping Dynamic Fields","Zuordnung Dynamische Felder"
|
26 |
+
"Customer ID","Kunden ID"
|
27 |
+
"Website ID","Website ID"
|
28 |
+
"Group ID","Gruppe ID"
|
29 |
+
"Store ID","Store ID"
|
30 |
+
"Creation Date","Erstellungsdatum"
|
31 |
+
"Update Date","Updatedatum"
|
32 |
+
"Customer is active","Kunde ist aktiv"
|
33 |
+
"Firstname","Vorname"
|
34 |
+
"Lastname","Nachname"
|
35 |
+
"First Order","Erste Bestellung"
|
36 |
+
"Last Order","Letzte Bestellung"
|
37 |
+
"Total Orders","Anzahl Bestellungen"
|
38 |
+
"AVG Orders","Durchschnittswert Bestellungen"
|
39 |
+
"Last Connection","Letzte Verbindung"
|
40 |
+
"Error truncating Inxmail list","Fehler während des Leerens der Inxmail Mailingliste"
|
41 |
+
"Mapping Customer Group","Zuordnung Kundengruppe"
|
42 |
+
"Customer Group","Kundengruppe"
|
43 |
+
"Specific groups customer limit","Limit Anzahl Kunden spezifische Kundengruppen"
|
44 |
+
"Last customers (specific)","Letzter Kunde(spezifisch)"
|
45 |
+
"Best customers (specific)","Beste Kunden(spezifisch)"
|
46 |
+
"Customers birthday (specific)","Kunden mit Geburtstag(spezifisch)"
|
47 |
+
"Abandonned carts (specific)","Abgebrochene Warenkörbe(spezifisch)"
|
48 |
+
"Today orders (specific)","Heutige Bestellungen(spezifisch)"
|
49 |
+
"You have selected the Birthday group even though the date of birth is not enabled on your shop","Sie haben die Geburtstagsgruppe ausgewählt, obwohl das Geburtstagsdatum im Shop nicht aktiviert ist"
|
50 |
+
"You have selected the Birthday group even though the date of birth is not enabled on your shop","You have selected the Birthday group even though the date of birth is not enabled on your shop"
|
51 |
+
"Image Width","Bildbreite"
|
52 |
+
"Image Height","Bildhöhe"
|
53 |
+
"Add Specific Attributes","Spezielle Attribute hinzufügen"
|
54 |
+
"Number Of Products In The Feed","Anzahl der Produkte im Product Feed"
|
55 |
+
"Unsubscribed customer synchronization","Abgemeldete Kunden synchronisieren"
|
56 |
+
"Customer groups synchronization","Kundengruppen synchronisieren"
|
57 |
+
"Frequency","Intervall"
|
58 |
+
"Start Time","Startzeit"
|
59 |
+
"Daily","Täglich"
|
60 |
+
"Weekly","Wöchentlich"
|
61 |
+
"Monthly","Monatlich"
|
62 |
+
"Mapping","Zuordnung"
|
63 |
+
"Launch manually","Manuell starten"
|
64 |
+
"Synchronize All Groups","Alle Gruppen synchronisieren"
|
65 |
+
"Customers per pass","Kunden pro Transfer"
|
66 |
+
"Subscribers per pass","Abonnenten pro Transfer"
|
67 |
+
"Subscribers synchronization","Abonnenten-Synchronisation"
|
68 |
+
"Create Inxmail column","Inxmail-Spalte erstellen"
|
69 |
+
"Create","Erstellen"
|
70 |
+
"Column name","Spaltenname"
|
71 |
+
"Column length","Spaltenlänge"
|
72 |
+
"Column type","Spaltentyp"
|
73 |
+
"Text","Text"
|
74 |
+
"Date and time","Datum und Uhrzzeit"
|
75 |
+
"Date only","nur Datum"
|
76 |
+
"Time only","nur Uhrzeit"
|
77 |
+
"Integer","Ganzzahl"
|
78 |
+
"Float","Gleitkommazahl"
|
79 |
+
"Yes / No","Ja / Nein"
|
80 |
+
"Subscribers synchronization is only available on the store view configuration of your website.","Die Synchronisation der Newsletter-Abonnenten ist nur in der Konfigurationsansicht des Stores verfügbar."
|
81 |
+
"Column %s successfully created in Inxmail","Die Spalte %s wurde erfolgreich in Inxmail erstellt"
|
82 |
+
"Column %s already exist in Inxmail","Die Spalte %s ist in Inxmail bereits vorhanden"
|
83 |
+
"No post data","Keine Post Daten"
|
84 |
+
"No store set","Kein Store ausgewählt"
|
85 |
+
"No default store set","Kein Default Store ausgewählt"
|
86 |
+
"You are not allowed on this page.","Sie haben für diese Seite keine Erlaubnis."
|
87 |
+
"No subscriber to synchronize.","Kein Abonnent zu synchronisieren."
|
88 |
+
"Error synchronizing unsubscribed customers from Inxmail","Fehler beim Synchronisieren abgemeldeter Kunden von Inxmail"
|
89 |
+
"No customer to synchronize.","Kein Kunde zu synchronisieren."
|
90 |
+
"Type Date only","Typ nur Datum"
|
91 |
+
"Type Yes/No","Typ Ja/Nein"
|
92 |
+
"Type Integer","Typ Ganzzahl"
|
93 |
+
"Type Float","Typ Gleitkommazahl"
|
94 |
+
"Type Text","Typ Text"
|
95 |
+
"Last customers","Letzte Kunden"
|
96 |
+
"Best customers","Beste Kunden"
|
97 |
+
"Abandonned carts","Abgebrochene Warenkörbe"
|
98 |
+
"Orders configuration","Konfiguration Bestellungen"
|
99 |
+
"Orders configuration: Last X Days","Konfiguration Bestellungen: die letzten X Tage"
|
100 |
+
"Orders configuration: Date range From","Konfiguration Bestellungen: Anfangsdatum Bestellzeitraum"
|
101 |
+
"Orders configuration: Date range to","Konfiguration Bestellungen: Enddatum Bestellzeitraum"
|
102 |
+
"Get last customers since X days","Die letzten Kunden der letzten X Tage"
|
103 |
+
"Get customers whose sum of all orders is superior to X","Kunden, deren Bestellsumme höher als X ist"
|
104 |
+
"Get abandonned carts' customer since X days","Abgebrochene Warenkörbe von Kunden der letzten X Tage"
|
105 |
+
"Configuration to get orders","Konfiguration, um Bestellungen zu erhalten"
|
106 |
+
"Get orders since X days","Bestellungen der letzten X Tage"
|
107 |
+
"Get orders of specific date range (from)","Bestellungen ab einem bestimmten Startdatum"
|
108 |
+
"Get orders of specific date range (to)","Bestellungen bis zu einem bestimmten Enddatum"
|
109 |
+
"Last X Days","Die letzten X Tage"
|
110 |
+
"Date Range","Zeitraum"
|
111 |
+
"Orders (specific)","Bestellungen (spezifisch)"
|
112 |
+
"Gender","Geschlecht"
|
113 |
+
"Date Of Birth","Geburtstag"
|
lib/Inx/Api/APIException.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* <i>Inx_Api_APIException</i> is the runtime exception that can be thrown during the normal operation of the API.
|
7 |
-
*
|
8 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
9 |
-
* @package Inxmail
|
10 |
-
*/
|
11 |
-
class Inx_Api_APIException extends Exception
|
12 |
-
{
|
13 |
-
/**
|
14 |
-
* @var Exception the original exception that was thrown.
|
15 |
-
*/
|
16 |
-
public $oCause = null;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Constructs a new api runtime exception with the specified detail message.
|
20 |
-
*
|
21 |
-
* @param string $sMsg the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
|
22 |
-
* @param Exception $oCause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
|
23 |
-
* value is permitted, and indicates that the cause is nonexistent or unknown.)
|
24 |
-
*/
|
25 |
-
function __construct($sMsg, Exception $oCause = null) {
|
26 |
-
parent::__construct($sMsg);
|
27 |
-
$this->oCause = $oCause;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Returns the original exception.
|
32 |
-
*
|
33 |
-
* @return Exception the original exception.
|
34 |
-
*/
|
35 |
-
public function getCause()
|
36 |
-
{
|
37 |
-
return $this->oCause;
|
38 |
-
}
|
39 |
-
|
40 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* <i>Inx_Api_APIException</i> is the runtime exception that can be thrown during the normal operation of the API.
|
7 |
+
*
|
8 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
9 |
+
* @package Inxmail
|
10 |
+
*/
|
11 |
+
class Inx_Api_APIException extends Exception
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* @var Exception the original exception that was thrown.
|
15 |
+
*/
|
16 |
+
public $oCause = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructs a new api runtime exception with the specified detail message.
|
20 |
+
*
|
21 |
+
* @param string $sMsg the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
|
22 |
+
* @param Exception $oCause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
|
23 |
+
* value is permitted, and indicates that the cause is nonexistent or unknown.)
|
24 |
+
*/
|
25 |
+
function __construct($sMsg, Exception $oCause = null) {
|
26 |
+
parent::__construct($sMsg);
|
27 |
+
$this->oCause = $oCause;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns the original exception.
|
32 |
+
*
|
33 |
+
* @return Exception the original exception.
|
34 |
+
*/
|
35 |
+
public function getCause()
|
36 |
+
{
|
37 |
+
return $this->oCause;
|
38 |
+
}
|
39 |
+
|
40 |
}
|
lib/Inx/Api/Action/ActionManager.php
CHANGED
@@ -1,97 +1,97 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Action_ActionManager</i> manages all actions.
|
8 |
-
* The following snippet creates a new <i>Action</i> that sets the lastClick recipient attribute
|
9 |
-
* (last time the recipient clicked a link) to the current date and increments the clickCount
|
10 |
-
* recipient attribute (the number of clicks by the recipient):
|
11 |
-
*
|
12 |
-
* <PRE>
|
13 |
-
* $oListContextManager = $oSession->getListContextManager();
|
14 |
-
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
15 |
-
*
|
16 |
-
* $oRecipientMetaData = $session->createRecipientContext()->getMetaData();
|
17 |
-
* $iLastClick = $oRecipientMetaData->getUserAttribute( "lastClick" )->getId();
|
18 |
-
* $iClickCount = $oRecipientMetaData->getUserAttribute( "clickCount" )->getId();
|
19 |
-
*
|
20 |
-
* $oActionMgr = $oSession->getActionManager();
|
21 |
-
*
|
22 |
-
* $oAction = $oActionMgr->createAction( $oListContext );
|
23 |
-
* $oAction->updateEventType( Inx_Api_Action_Action::EVENT_TYPE_CLICK );
|
24 |
-
* $oAction->updateName( "Click-Registry" );
|
25 |
-
*
|
26 |
-
* $oCommandFactory = $oActionMgr->getCommandFactory();
|
27 |
-
*
|
28 |
-
* $aCmds = array();
|
29 |
-
* $aCmds[] = $oCommandFactory->createSetValueCmd( $iLastClick, "=Date()" );
|
30 |
-
* $aCmds[] = $oCommandFactory->createSetRelativeValueCmd( $iClickCount, 1 );
|
31 |
-
*
|
32 |
-
* $oAction->updateCommands( $aCmds );
|
33 |
-
* $oAction->commitUpdate();
|
34 |
-
* </PRE>
|
35 |
-
*
|
36 |
-
* <p>
|
37 |
-
* Note: The recipient attributes referenced in the snippet are not standard attributes and must be created using the
|
38 |
-
* <i>Inx_Api_Recipient_AttributeManager</i> before they may be used in the shown way.
|
39 |
-
* <p>
|
40 |
-
* Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
|
41 |
-
* <p>
|
42 |
-
* For more information on actions (including event types), see the <i>Inx_Api_Action_Action</i> documentation.
|
43 |
-
*
|
44 |
-
* @see Inx_Api_Action_Action
|
45 |
-
* @since API 1.2.0
|
46 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
47 |
-
* @package Inxmail
|
48 |
-
* @subpackage Action
|
49 |
-
*/
|
50 |
-
interface Inx_Api_Action_ActionManager extends Inx_Api_BOManager
|
51 |
-
{
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Creates a new, empty action with the specified owning list. If the action is not list specific, the
|
55 |
-
* system list context must be used. The following snippet retrieves the system list context:
|
56 |
-
*
|
57 |
-
* <PRE>
|
58 |
-
* $oListContextManager = $oSession->getListContextManager();
|
59 |
-
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
60 |
-
* </PRE>
|
61 |
-
*
|
62 |
-
*
|
63 |
-
* @param Inx_Api_List_ListContext $oListContext the list owning the action.
|
64 |
-
* @return Inx_Api_Action_Action a new action.
|
65 |
-
*
|
66 |
-
*/
|
67 |
-
public function createAction( Inx_Api_List_ListContext $oListContext );
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Selects all actions owned by the specified list context. To retrieve actions which are not list
|
72 |
-
* specific, use the system list context. The following snippet retrieves the system list context:
|
73 |
-
*
|
74 |
-
* <PRE>
|
75 |
-
* $oListContextManager = $oSession->getListContextManager();
|
76 |
-
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
77 |
-
* </PRE>
|
78 |
-
*
|
79 |
-
*
|
80 |
-
* @paramInx_Api_List_ListContext|int $mListContext the list context (or list id) which owns the actions to retrieve.
|
81 |
-
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> object that contains the actions owned by the specified list.
|
82 |
-
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
83 |
-
* <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
|
84 |
-
*/
|
85 |
-
public function select( $mListContext );
|
86 |
-
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Returns the factory used to create new commands.
|
90 |
-
* <i>Inx_Api_Action_Command</i>s are executed by an <i>Inx_Api_Action</i> if the event associated with that
|
91 |
-
* action is triggered.
|
92 |
-
*
|
93 |
-
* @return Inx_Api_Action_CommandFactory the command factory.
|
94 |
-
*/
|
95 |
-
public function getCommandFactory();
|
96 |
-
|
97 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Action_ActionManager</i> manages all actions.
|
8 |
+
* The following snippet creates a new <i>Action</i> that sets the lastClick recipient attribute
|
9 |
+
* (last time the recipient clicked a link) to the current date and increments the clickCount
|
10 |
+
* recipient attribute (the number of clicks by the recipient):
|
11 |
+
*
|
12 |
+
* <PRE>
|
13 |
+
* $oListContextManager = $oSession->getListContextManager();
|
14 |
+
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
15 |
+
*
|
16 |
+
* $oRecipientMetaData = $session->createRecipientContext()->getMetaData();
|
17 |
+
* $iLastClick = $oRecipientMetaData->getUserAttribute( "lastClick" )->getId();
|
18 |
+
* $iClickCount = $oRecipientMetaData->getUserAttribute( "clickCount" )->getId();
|
19 |
+
*
|
20 |
+
* $oActionMgr = $oSession->getActionManager();
|
21 |
+
*
|
22 |
+
* $oAction = $oActionMgr->createAction( $oListContext );
|
23 |
+
* $oAction->updateEventType( Inx_Api_Action_Action::EVENT_TYPE_CLICK );
|
24 |
+
* $oAction->updateName( "Click-Registry" );
|
25 |
+
*
|
26 |
+
* $oCommandFactory = $oActionMgr->getCommandFactory();
|
27 |
+
*
|
28 |
+
* $aCmds = array();
|
29 |
+
* $aCmds[] = $oCommandFactory->createSetValueCmd( $iLastClick, "=Date()" );
|
30 |
+
* $aCmds[] = $oCommandFactory->createSetRelativeValueCmd( $iClickCount, 1 );
|
31 |
+
*
|
32 |
+
* $oAction->updateCommands( $aCmds );
|
33 |
+
* $oAction->commitUpdate();
|
34 |
+
* </PRE>
|
35 |
+
*
|
36 |
+
* <p>
|
37 |
+
* Note: The recipient attributes referenced in the snippet are not standard attributes and must be created using the
|
38 |
+
* <i>Inx_Api_Recipient_AttributeManager</i> before they may be used in the shown way.
|
39 |
+
* <p>
|
40 |
+
* Note: The usage of <i>Inx_Api_Action_Action</i>s requires the api user right: <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
|
41 |
+
* <p>
|
42 |
+
* For more information on actions (including event types), see the <i>Inx_Api_Action_Action</i> documentation.
|
43 |
+
*
|
44 |
+
* @see Inx_Api_Action_Action
|
45 |
+
* @since API 1.2.0
|
46 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
47 |
+
* @package Inxmail
|
48 |
+
* @subpackage Action
|
49 |
+
*/
|
50 |
+
interface Inx_Api_Action_ActionManager extends Inx_Api_BOManager
|
51 |
+
{
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Creates a new, empty action with the specified owning list. If the action is not list specific, the
|
55 |
+
* system list context must be used. The following snippet retrieves the system list context:
|
56 |
+
*
|
57 |
+
* <PRE>
|
58 |
+
* $oListContextManager = $oSession->getListContextManager();
|
59 |
+
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
60 |
+
* </PRE>
|
61 |
+
*
|
62 |
+
*
|
63 |
+
* @param Inx_Api_List_ListContext $oListContext the list owning the action.
|
64 |
+
* @return Inx_Api_Action_Action a new action.
|
65 |
+
*
|
66 |
+
*/
|
67 |
+
public function createAction( Inx_Api_List_ListContext $oListContext );
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Selects all actions owned by the specified list context. To retrieve actions which are not list
|
72 |
+
* specific, use the system list context. The following snippet retrieves the system list context:
|
73 |
+
*
|
74 |
+
* <PRE>
|
75 |
+
* $oListContextManager = $oSession->getListContextManager();
|
76 |
+
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
77 |
+
* </PRE>
|
78 |
+
*
|
79 |
+
*
|
80 |
+
* @paramInx_Api_List_ListContext|int $mListContext the list context (or list id) which owns the actions to retrieve.
|
81 |
+
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> object that contains the actions owned by the specified list.
|
82 |
+
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
83 |
+
* <i>Inx_Api_UserRights::ACTION_FEATURE_USE</i>
|
84 |
+
*/
|
85 |
+
public function select( $mListContext );
|
86 |
+
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Returns the factory used to create new commands.
|
90 |
+
* <i>Inx_Api_Action_Command</i>s are executed by an <i>Inx_Api_Action</i> if the event associated with that
|
91 |
+
* action is triggered.
|
92 |
+
*
|
93 |
+
* @return Inx_Api_Action_CommandFactory the command factory.
|
94 |
+
*/
|
95 |
+
public function getCommandFactory();
|
96 |
+
|
97 |
+
}
|
lib/Inx/Api/Action/Command.php
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Action_Command</i> interface identifies commands which are executed by an <i>Inx_Api_Action_Action</i>
|
8 |
-
* when the event associated with the action is triggered.
|
9 |
-
* <i>Inx_Api_Action_Command</i>s can be used to manipulate a recipient or to send a single mailing to that recipient.
|
10 |
-
* <p>
|
11 |
-
* The different types of commands are:
|
12 |
-
* <ul>
|
13 |
-
* <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
|
14 |
-
* <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
|
15 |
-
* <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
|
16 |
-
* <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
|
17 |
-
* <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
|
18 |
-
* </ul>
|
19 |
-
* <p>
|
20 |
-
* For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
|
21 |
-
*
|
22 |
-
* @see Inx_Api_Action_Action
|
23 |
-
* @see Inx_Api_Action_ActionManager
|
24 |
-
* @since API 1.2.0
|
25 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
26 |
-
* @package Inxmail
|
27 |
-
* @subpackage Action
|
28 |
-
*/
|
29 |
-
interface Inx_Api_Action_Command
|
30 |
-
{
|
31 |
-
|
32 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Action_Command</i> interface identifies commands which are executed by an <i>Inx_Api_Action_Action</i>
|
8 |
+
* when the event associated with the action is triggered.
|
9 |
+
* <i>Inx_Api_Action_Command</i>s can be used to manipulate a recipient or to send a single mailing to that recipient.
|
10 |
+
* <p>
|
11 |
+
* The different types of commands are:
|
12 |
+
* <ul>
|
13 |
+
* <li><i>Inx_Api_Action_DeleteRecipientCommand</i> - Permanently remove the recipient.
|
14 |
+
* <li><i>Inx_Api_Action_SendMailCommand</i> - Send a mailing to the recipient.
|
15 |
+
* <li><i>Inx_Api_Action_SetValueCommand</i> - Set an attribute value of the recipient.
|
16 |
+
* <li><i>Inx_Api_Action_SubscriptionCommand</i> - Subscribe the recipient.
|
17 |
+
* <li><i>Inx_Api_Action_UnsubscriptionCommand</i> - Unsubscribe the recipient.
|
18 |
+
* </ul>
|
19 |
+
* <p>
|
20 |
+
* For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i> documentation.
|
21 |
+
*
|
22 |
+
* @see Inx_Api_Action_Action
|
23 |
+
* @see Inx_Api_Action_ActionManager
|
24 |
+
* @since API 1.2.0
|
25 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
26 |
+
* @package Inxmail
|
27 |
+
* @subpackage Action
|
28 |
+
*/
|
29 |
+
interface Inx_Api_Action_Command
|
30 |
+
{
|
31 |
+
|
32 |
+
}
|
lib/Inx/Api/Action/CommandFactory.php
CHANGED
@@ -1,202 +1,202 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Action_CommandFactory</i> is a factory for creating <i>Inx_Api_Action_Command</i>s.
|
8 |
-
* <p>
|
9 |
-
* For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i>
|
10 |
-
* documentation.
|
11 |
-
*
|
12 |
-
* @see Inx_Api_Action_Command
|
13 |
-
* @see Inx_Api_Action_ActionManager
|
14 |
-
* @since API 1.2.0
|
15 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage Action
|
18 |
-
*/
|
19 |
-
interface Inx_Api_Action_CommandFactory
|
20 |
-
{
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Creates a new <i>Inx_Api_Action_DeleteRecipientCommand</i> that will delete the recipient permanently
|
24 |
-
* from the system.
|
25 |
-
*
|
26 |
-
* @return Inx_Api_Action_DeleteRecipientCommand a new <i>Inx_Api_Action_DeleteRecipientCommand</i>.
|
27 |
-
*/
|
28 |
-
public function createDeleteRecipientCmd();
|
29 |
-
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a value based on an expression.
|
33 |
-
* The expression must begin with an equal sign. The data type of the expression must be the same as the
|
34 |
-
* data type of the specified attribute.
|
35 |
-
* <p>
|
36 |
-
* See the Inxmail client documentation for a detailed description.
|
37 |
-
*
|
38 |
-
* <PRE>
|
39 |
-
* $oFactory->createSetValueCmd( $oDatetimeAttr->getId(), "=Date()" );
|
40 |
-
* </PRE>
|
41 |
-
*
|
42 |
-
* @param int $iAttributeId the id of the user attribute.
|
43 |
-
* @param string $sExpression an expression that sets the value of the attribute.
|
44 |
-
* @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
|
45 |
-
* @see Inx_Api_Recipient_Attribute
|
46 |
-
*/
|
47 |
-
public function createSetValueCmd( $iAttributeId, $sExpression );
|
48 |
-
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets an absolute value.
|
52 |
-
* Some examples for allowed values, dependent on the data type: <br>
|
53 |
-
* <ul>
|
54 |
-
* <li>DataType.TEXT - "Text", null
|
55 |
-
* <li>DataType.INTEGER - "12", "-3", null
|
56 |
-
* <li>DataType.DOUBLE - "3.4", "-1.25", null
|
57 |
-
* <li>DataType.BOOLEAN - "TRUE", "FALSE"
|
58 |
-
* <li>DataType.DATETIME - "31.12.2006 23:45:00"; (dd.MM.yyyy HH:mm:ss or dd.MM.yyyy HH:mm), null
|
59 |
-
* <li>DataType.DATE - "31.12.2006"; (dd.MM.yyyy), null
|
60 |
-
* <li>DataType.TIME - "23:45:00"; (HH:mm:ss or HH:mm), null
|
61 |
-
* </ul>
|
62 |
-
*
|
63 |
-
* @param int $iAttributeId the id of the user attribute.
|
64 |
-
* @param string $sAbsoluteValue an absolute value for the attribute.
|
65 |
-
* @return Inx_Api_Action_SetValue_Command a new <i>Inx_Api_Action_SetValueCommand</i>.
|
66 |
-
* @see Inx_Api_Recipient_Attribute
|
67 |
-
*/
|
68 |
-
public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue );
|
69 |
-
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a relative value.
|
73 |
-
* Examples for allowed values, dependent on the data type: <br>
|
74 |
-
* <ul>
|
75 |
-
* <li>DataType.TEXT - "3", "-10"
|
76 |
-
* <li>DataType.INTEGER - "12", "-3"
|
77 |
-
* <li>DataType.DOUBLE - "3.4", "-1.25"
|
78 |
-
* </ul>
|
79 |
-
* <p>
|
80 |
-
* You might wonder why text attributes can be incremented/decremented. This is a convenience for attributes that
|
81 |
-
* are numbers by nature but have the type text. DO NOT use this method for changing real text attributes, as this
|
82 |
-
* will overwrite the value.
|
83 |
-
*
|
84 |
-
* @param int $iAttributeId the id of the user attribute.
|
85 |
-
* @param string $sRelativeValue a relative value for the attribute that can be positive (increment) or negative
|
86 |
-
* (decrement).
|
87 |
-
* @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
|
88 |
-
* @see Inx_Api_Recipient_Attribute
|
89 |
-
*/
|
90 |
-
public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue );
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which subscribes the recipient to the specified
|
95 |
-
* standard list.
|
96 |
-
*
|
97 |
-
* @param int $iListContextId the id of the standard list context to which to subscribe to.
|
98 |
-
* @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct (forced)
|
99 |
-
* subscription is used. If processing and double opt in (DOI) are enabled, this will send a verification
|
100 |
-
* email to the recipient.
|
101 |
-
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
102 |
-
* @deprecated use createSubscriptionCmd2(int, bool) instead.
|
103 |
-
*/
|
104 |
-
public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled );
|
105 |
-
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from the
|
109 |
-
* specified standard list.
|
110 |
-
*
|
111 |
-
* @param int $iListContextId the id of the standard list context from which to unsubscribe from.
|
112 |
-
* @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if direct
|
113 |
-
* (forced) unsubscription is used. If processing and double opt out (DOO) are enabled, this will send
|
114 |
-
* a verification email to the recipient.
|
115 |
-
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
116 |
-
* @deprecated use createUnsubscriptionCmd2(int, bool) instead.
|
117 |
-
*/
|
118 |
-
public function createUnsubscriptionCmd( $iListContextId, $blSnsubscriptionProcessingEnabled );
|
119 |
-
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from all standard
|
123 |
-
* lists.
|
124 |
-
*
|
125 |
-
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
126 |
-
* @deprecated use createUnsubscribeAllCmd2() instead.
|
127 |
-
*/
|
128 |
-
public function createUnsubscribeAllCmd();
|
129 |
-
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Creates an <i>Inx_Api_Action_SubscriptionCommand</i> which subscribes the recipient to the specified
|
133 |
-
* standard list.
|
134 |
-
*
|
135 |
-
* @param int $iListContextId the id of the standard list context to which to subscribe to.
|
136 |
-
* @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct
|
137 |
-
* (forced) subscription is used. If processing and double opt in (DOI) are enabled, this will send
|
138 |
-
* a verification email to the recipient.
|
139 |
-
* @return Inx_Api_Action_SubscriptionCommand a new <i>Inx_Api_Action_SubscriptionCommand</i>.
|
140 |
-
* @since API 1.6.0
|
141 |
-
*/
|
142 |
-
public function createSubscriptionCmd2( $iListContextId,
|
143 |
-
$blSubscriptionProcessingEnabled );
|
144 |
-
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from the
|
148 |
-
* specified standard list.
|
149 |
-
*
|
150 |
-
* @param int $iListContextId the id of the standard list context from which to unsubscribe from.
|
151 |
-
* @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if
|
152 |
-
* direct (forced) unsubscription is used. If processing and double opt out (DOO) are enabled,
|
153 |
-
* this will send a verification email to the recipient.
|
154 |
-
* @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
|
155 |
-
* @since API 1.6.0
|
156 |
-
*/
|
157 |
-
public function createUnsubscriptionCmd2( $iListContextId,
|
158 |
-
$blSnsubscriptionProcessingEnabled );
|
159 |
-
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from all
|
163 |
-
* standard lists.
|
164 |
-
*
|
165 |
-
* @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
|
166 |
-
* @since API 1.6.0
|
167 |
-
*/
|
168 |
-
public function createUnsubscribeAllCmd2();
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the last newsletter from the
|
174 |
-
* specified list context to the recipient.
|
175 |
-
*
|
176 |
-
* @param int $iListContextId the id of the standard or filter list context.
|
177 |
-
* @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
|
178 |
-
*/
|
179 |
-
public function createSendLastNewsletterCmd( $iListContextId );
|
180 |
-
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the specified mailing from the
|
184 |
-
* corresponding list context to the recipient.
|
185 |
-
*
|
186 |
-
* @param int $iListContextId the id of the standard or filter list context containing the mailing.
|
187 |
-
* @param int $iMailingId the id of the mailing to send.
|
188 |
-
* @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
|
189 |
-
*/
|
190 |
-
public function createSendMailCmd( $iListContextId, $iMailingId );
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Creates an <i>Inx_Api_Action_SendActionMailCommand</i> which sends the specified action mailing
|
194 |
-
* from the corresponding list context to the recipient.
|
195 |
-
*
|
196 |
-
* @param int $iListContextId id of the standard or filter list context containing the action mailing.
|
197 |
-
* @param int $iActionMailingId the id of the action mailing to send.
|
198 |
-
* @return Inx_Api_Action_SendActionMailCommand a new <i>Inx_Api_Action_SendActionMailCommand</i>.
|
199 |
-
* @since API 1.10.0
|
200 |
-
*/
|
201 |
-
public function createSendActionMailCmd( $iListContextId, $iActionMailingId );
|
202 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Action_CommandFactory</i> is a factory for creating <i>Inx_Api_Action_Command</i>s.
|
8 |
+
* <p>
|
9 |
+
* For an example on how to use commands and actions, see the <i>Inx_Api_Action_ActionManager</i>
|
10 |
+
* documentation.
|
11 |
+
*
|
12 |
+
* @see Inx_Api_Action_Command
|
13 |
+
* @see Inx_Api_Action_ActionManager
|
14 |
+
* @since API 1.2.0
|
15 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage Action
|
18 |
+
*/
|
19 |
+
interface Inx_Api_Action_CommandFactory
|
20 |
+
{
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Creates a new <i>Inx_Api_Action_DeleteRecipientCommand</i> that will delete the recipient permanently
|
24 |
+
* from the system.
|
25 |
+
*
|
26 |
+
* @return Inx_Api_Action_DeleteRecipientCommand a new <i>Inx_Api_Action_DeleteRecipientCommand</i>.
|
27 |
+
*/
|
28 |
+
public function createDeleteRecipientCmd();
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a value based on an expression.
|
33 |
+
* The expression must begin with an equal sign. The data type of the expression must be the same as the
|
34 |
+
* data type of the specified attribute.
|
35 |
+
* <p>
|
36 |
+
* See the Inxmail client documentation for a detailed description.
|
37 |
+
*
|
38 |
+
* <PRE>
|
39 |
+
* $oFactory->createSetValueCmd( $oDatetimeAttr->getId(), "=Date()" );
|
40 |
+
* </PRE>
|
41 |
+
*
|
42 |
+
* @param int $iAttributeId the id of the user attribute.
|
43 |
+
* @param string $sExpression an expression that sets the value of the attribute.
|
44 |
+
* @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
|
45 |
+
* @see Inx_Api_Recipient_Attribute
|
46 |
+
*/
|
47 |
+
public function createSetValueCmd( $iAttributeId, $sExpression );
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets an absolute value.
|
52 |
+
* Some examples for allowed values, dependent on the data type: <br>
|
53 |
+
* <ul>
|
54 |
+
* <li>DataType.TEXT - "Text", null
|
55 |
+
* <li>DataType.INTEGER - "12", "-3", null
|
56 |
+
* <li>DataType.DOUBLE - "3.4", "-1.25", null
|
57 |
+
* <li>DataType.BOOLEAN - "TRUE", "FALSE"
|
58 |
+
* <li>DataType.DATETIME - "31.12.2006 23:45:00"; (dd.MM.yyyy HH:mm:ss or dd.MM.yyyy HH:mm), null
|
59 |
+
* <li>DataType.DATE - "31.12.2006"; (dd.MM.yyyy), null
|
60 |
+
* <li>DataType.TIME - "23:45:00"; (HH:mm:ss or HH:mm), null
|
61 |
+
* </ul>
|
62 |
+
*
|
63 |
+
* @param int $iAttributeId the id of the user attribute.
|
64 |
+
* @param string $sAbsoluteValue an absolute value for the attribute.
|
65 |
+
* @return Inx_Api_Action_SetValue_Command a new <i>Inx_Api_Action_SetValueCommand</i>.
|
66 |
+
* @see Inx_Api_Recipient_Attribute
|
67 |
+
*/
|
68 |
+
public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue );
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Creates an <i>Inx_Api_Action_SetValueCommand</i> which sets a relative value.
|
73 |
+
* Examples for allowed values, dependent on the data type: <br>
|
74 |
+
* <ul>
|
75 |
+
* <li>DataType.TEXT - "3", "-10"
|
76 |
+
* <li>DataType.INTEGER - "12", "-3"
|
77 |
+
* <li>DataType.DOUBLE - "3.4", "-1.25"
|
78 |
+
* </ul>
|
79 |
+
* <p>
|
80 |
+
* You might wonder why text attributes can be incremented/decremented. This is a convenience for attributes that
|
81 |
+
* are numbers by nature but have the type text. DO NOT use this method for changing real text attributes, as this
|
82 |
+
* will overwrite the value.
|
83 |
+
*
|
84 |
+
* @param int $iAttributeId the id of the user attribute.
|
85 |
+
* @param string $sRelativeValue a relative value for the attribute that can be positive (increment) or negative
|
86 |
+
* (decrement).
|
87 |
+
* @return Inx_Api_Action_SetValueCommand a new <i>Inx_Api_Action_SetValueCommand</i>.
|
88 |
+
* @see Inx_Api_Recipient_Attribute
|
89 |
+
*/
|
90 |
+
public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue );
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which subscribes the recipient to the specified
|
95 |
+
* standard list.
|
96 |
+
*
|
97 |
+
* @param int $iListContextId the id of the standard list context to which to subscribe to.
|
98 |
+
* @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct (forced)
|
99 |
+
* subscription is used. If processing and double opt in (DOI) are enabled, this will send a verification
|
100 |
+
* email to the recipient.
|
101 |
+
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
102 |
+
* @deprecated use createSubscriptionCmd2(int, bool) instead.
|
103 |
+
*/
|
104 |
+
public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled );
|
105 |
+
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from the
|
109 |
+
* specified standard list.
|
110 |
+
*
|
111 |
+
* @param int $iListContextId the id of the standard list context from which to unsubscribe from.
|
112 |
+
* @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if direct
|
113 |
+
* (forced) unsubscription is used. If processing and double opt out (DOO) are enabled, this will send
|
114 |
+
* a verification email to the recipient.
|
115 |
+
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
116 |
+
* @deprecated use createUnsubscriptionCmd2(int, bool) instead.
|
117 |
+
*/
|
118 |
+
public function createUnsubscriptionCmd( $iListContextId, $blSnsubscriptionProcessingEnabled );
|
119 |
+
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Creates an <i>Inx_Api_Action_SubUnsubscriptionCommand</i> which unsubscribes the recipient from all standard
|
123 |
+
* lists.
|
124 |
+
*
|
125 |
+
* @return Inx_Api_Action_SubUnsubscriptionCommand a new <i>Inx_Api_Action_SubUnsubscriptionCommand</i>.
|
126 |
+
* @deprecated use createUnsubscribeAllCmd2() instead.
|
127 |
+
*/
|
128 |
+
public function createUnsubscribeAllCmd();
|
129 |
+
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Creates an <i>Inx_Api_Action_SubscriptionCommand</i> which subscribes the recipient to the specified
|
133 |
+
* standard list.
|
134 |
+
*
|
135 |
+
* @param int $iListContextId the id of the standard list context to which to subscribe to.
|
136 |
+
* @param bool $blSubscriptionProcessingEnabled true if subscription processing is enabled, false if direct
|
137 |
+
* (forced) subscription is used. If processing and double opt in (DOI) are enabled, this will send
|
138 |
+
* a verification email to the recipient.
|
139 |
+
* @return Inx_Api_Action_SubscriptionCommand a new <i>Inx_Api_Action_SubscriptionCommand</i>.
|
140 |
+
* @since API 1.6.0
|
141 |
+
*/
|
142 |
+
public function createSubscriptionCmd2( $iListContextId,
|
143 |
+
$blSubscriptionProcessingEnabled );
|
144 |
+
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from the
|
148 |
+
* specified standard list.
|
149 |
+
*
|
150 |
+
* @param int $iListContextId the id of the standard list context from which to unsubscribe from.
|
151 |
+
* @param bool $blSnsubscriptionProcessingEnabled true if unsubscription processing is enabled, false if
|
152 |
+
* direct (forced) unsubscription is used. If processing and double opt out (DOO) are enabled,
|
153 |
+
* this will send a verification email to the recipient.
|
154 |
+
* @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
|
155 |
+
* @since API 1.6.0
|
156 |
+
*/
|
157 |
+
public function createUnsubscriptionCmd2( $iListContextId,
|
158 |
+
$blSnsubscriptionProcessingEnabled );
|
159 |
+
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Creates an <i>Inx_Api_Action_UnsubscriptionCommand</i> which unsubscribes the recipient from all
|
163 |
+
* standard lists.
|
164 |
+
*
|
165 |
+
* @return Inx_Api_Action_UnsubscriptionCommand a new <i>Inx_Api_Action_UnsubscriptionCommand</i>.
|
166 |
+
* @since API 1.6.0
|
167 |
+
*/
|
168 |
+
public function createUnsubscribeAllCmd2();
|
169 |
+
|
170 |
+
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the last newsletter from the
|
174 |
+
* specified list context to the recipient.
|
175 |
+
*
|
176 |
+
* @param int $iListContextId the id of the standard or filter list context.
|
177 |
+
* @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
|
178 |
+
*/
|
179 |
+
public function createSendLastNewsletterCmd( $iListContextId );
|
180 |
+
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Creates an <i>Inx_Api_Action_SendMailCommand</i> which sends the specified mailing from the
|
184 |
+
* corresponding list context to the recipient.
|
185 |
+
*
|
186 |
+
* @param int $iListContextId the id of the standard or filter list context containing the mailing.
|
187 |
+
* @param int $iMailingId the id of the mailing to send.
|
188 |
+
* @return Inx_Api_Action_SendMailCommand a new <i>Inx_Api_Action_SendMailCommand</i>.
|
189 |
+
*/
|
190 |
+
public function createSendMailCmd( $iListContextId, $iMailingId );
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Creates an <i>Inx_Api_Action_SendActionMailCommand</i> which sends the specified action mailing
|
194 |
+
* from the corresponding list context to the recipient.
|
195 |
+
*
|
196 |
+
* @param int $iListContextId id of the standard or filter list context containing the action mailing.
|
197 |
+
* @param int $iActionMailingId the id of the action mailing to send.
|
198 |
+
* @return Inx_Api_Action_SendActionMailCommand a new <i>Inx_Api_Action_SendActionMailCommand</i>.
|
199 |
+
* @since API 1.10.0
|
200 |
+
*/
|
201 |
+
public function createSendActionMailCmd( $iListContextId, $iActionMailingId );
|
202 |
+
}
|
lib/Inx/Api/Action/DeleteRecipientCommand.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_DeleteRecipientCommand</i> to permanently delete a recipient from the system.
|
8 |
-
*
|
9 |
-
* @see Inx_Api_Action_CommandFactory
|
10 |
-
* @since API 1.2.0
|
11 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
12 |
-
* @package Inxmail
|
13 |
-
* @subpackage Action
|
14 |
-
*/
|
15 |
-
interface Inx_Api_Action_DeleteRecipientCommand extends Inx_Api_Action_Command
|
16 |
-
{
|
17 |
-
|
18 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_DeleteRecipientCommand</i> to permanently delete a recipient from the system.
|
8 |
+
*
|
9 |
+
* @see Inx_Api_Action_CommandFactory
|
10 |
+
* @since API 1.2.0
|
11 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
12 |
+
* @package Inxmail
|
13 |
+
* @subpackage Action
|
14 |
+
*/
|
15 |
+
interface Inx_Api_Action_DeleteRecipientCommand extends Inx_Api_Action_Command
|
16 |
+
{
|
17 |
+
|
18 |
+
}
|
lib/Inx/Api/Action/SendActionMailCommand.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Copyright (c) 2006 Inxmail GmbH. All Rights Reserved. This code is part of the Inxmail API documentation. It is
|
4 |
-
* distributed in the hope that it will be useful, but a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS,
|
5 |
-
* REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
6 |
-
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. INXMAIL GMBH ("INXMAIL") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
|
7 |
-
* DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
|
8 |
-
* EVENT WILL INXMAIL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
|
9 |
-
* CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
|
10 |
-
* OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF INXMAIL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
11 |
-
* You acknowledge that this software is not designed, licensed or intended for use in the design, construction,
|
12 |
-
* operation or maintenance of any nuclear facility.
|
13 |
-
*/
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage Action
|
18 |
-
*/
|
19 |
-
/**
|
20 |
-
* Use the <i>Inx_Api_Action_SendActionMailCommand</i> to send an action mailing to a recipient. The action
|
21 |
-
* mailing must be approved in order to be used.
|
22 |
-
*
|
23 |
-
* @see Inx_Api_Action_CommandFactory
|
24 |
-
* @since API 1.10.0
|
25 |
-
*/
|
26 |
-
interface Inx_Api_Action_SendActionMailCommand extends Inx_Api_Action_Command
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* Returns the id of the standard or filter list context associated with this command.
|
30 |
-
*
|
31 |
-
* @return int the id of the list context.
|
32 |
-
*/
|
33 |
-
public function getListContextId();
|
34 |
-
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Returns the id of the action mailing associated with this command.
|
38 |
-
*
|
39 |
-
* @return int the id of the action mailing.
|
40 |
-
*/
|
41 |
-
public function getMailingId();
|
42 |
-
|
43 |
}
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2006 Inxmail GmbH. All Rights Reserved. This code is part of the Inxmail API documentation. It is
|
4 |
+
* distributed in the hope that it will be useful, but a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS,
|
5 |
+
* REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
6 |
+
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. INXMAIL GMBH ("INXMAIL") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
|
7 |
+
* DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
|
8 |
+
* EVENT WILL INXMAIL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
|
9 |
+
* CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
|
10 |
+
* OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF INXMAIL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
11 |
+
* You acknowledge that this software is not designed, licensed or intended for use in the design, construction,
|
12 |
+
* operation or maintenance of any nuclear facility.
|
13 |
+
*/
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage Action
|
18 |
+
*/
|
19 |
+
/**
|
20 |
+
* Use the <i>Inx_Api_Action_SendActionMailCommand</i> to send an action mailing to a recipient. The action
|
21 |
+
* mailing must be approved in order to be used.
|
22 |
+
*
|
23 |
+
* @see Inx_Api_Action_CommandFactory
|
24 |
+
* @since API 1.10.0
|
25 |
+
*/
|
26 |
+
interface Inx_Api_Action_SendActionMailCommand extends Inx_Api_Action_Command
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* Returns the id of the standard or filter list context associated with this command.
|
30 |
+
*
|
31 |
+
* @return int the id of the list context.
|
32 |
+
*/
|
33 |
+
public function getListContextId();
|
34 |
+
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Returns the id of the action mailing associated with this command.
|
38 |
+
*
|
39 |
+
* @return int the id of the action mailing.
|
40 |
+
*/
|
41 |
+
public function getMailingId();
|
42 |
+
|
43 |
}
|
lib/Inx/Api/Action/SendMailCommand.php
CHANGED
@@ -1,56 +1,56 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_SendMailCommand</i> to send a mailing to a recipient.
|
8 |
-
* This command can be configured to either send a specific mailing or to send the last mailing
|
9 |
-
* (newsletter) in the recipients list.
|
10 |
-
*
|
11 |
-
* @see Inx_Api_Action_CommandFactory
|
12 |
-
* @since API 1.2.0
|
13 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage Action
|
16 |
-
*/
|
17 |
-
interface Inx_Api_Action_SendMailCommand extends Inx_Api_Action_Command
|
18 |
-
{
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Command type: Send a specific mailing.
|
22 |
-
*/
|
23 |
-
const CMD_TYPE_SPECIFIC_MAILING = 0;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Command type: Send the last newsletter.
|
27 |
-
*/
|
28 |
-
const CMD_TYPE_LAST_MAILING = 1;
|
29 |
-
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Returns the command type: Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING or
|
33 |
-
* Inx_Api_Action_SendMailCommand::CMD_TYPE_LAST_MAILING.
|
34 |
-
*
|
35 |
-
* @return int the command type.
|
36 |
-
*/
|
37 |
-
public function getCmdType();
|
38 |
-
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Returns the id of the standard or filter list context associated with this command.
|
42 |
-
*
|
43 |
-
* @return int the id of the list context
|
44 |
-
*/
|
45 |
-
public function getListContextId();
|
46 |
-
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Returns the id of the mailing associated with this command. Only specified if the command type is
|
50 |
-
* Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING.
|
51 |
-
*
|
52 |
-
* @return int the id of the mailing.
|
53 |
-
*/
|
54 |
-
public function getMailingId();
|
55 |
-
|
56 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_SendMailCommand</i> to send a mailing to a recipient.
|
8 |
+
* This command can be configured to either send a specific mailing or to send the last mailing
|
9 |
+
* (newsletter) in the recipients list.
|
10 |
+
*
|
11 |
+
* @see Inx_Api_Action_CommandFactory
|
12 |
+
* @since API 1.2.0
|
13 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage Action
|
16 |
+
*/
|
17 |
+
interface Inx_Api_Action_SendMailCommand extends Inx_Api_Action_Command
|
18 |
+
{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Command type: Send a specific mailing.
|
22 |
+
*/
|
23 |
+
const CMD_TYPE_SPECIFIC_MAILING = 0;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Command type: Send the last newsletter.
|
27 |
+
*/
|
28 |
+
const CMD_TYPE_LAST_MAILING = 1;
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns the command type: Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING or
|
33 |
+
* Inx_Api_Action_SendMailCommand::CMD_TYPE_LAST_MAILING.
|
34 |
+
*
|
35 |
+
* @return int the command type.
|
36 |
+
*/
|
37 |
+
public function getCmdType();
|
38 |
+
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Returns the id of the standard or filter list context associated with this command.
|
42 |
+
*
|
43 |
+
* @return int the id of the list context
|
44 |
+
*/
|
45 |
+
public function getListContextId();
|
46 |
+
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Returns the id of the mailing associated with this command. Only specified if the command type is
|
50 |
+
* Inx_Api_Action_SendMailCommand::CMD_TYPE_SPECIFIC_MAILING.
|
51 |
+
*
|
52 |
+
* @return int the id of the mailing.
|
53 |
+
*/
|
54 |
+
public function getMailingId();
|
55 |
+
|
56 |
+
}
|
lib/Inx/Api/Action/SetValueCommand.php
CHANGED
@@ -1,72 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_SetValueCommand</i> to set an attribute value. There are three ways to set the attribute value:
|
8 |
-
* <ul>
|
9 |
-
* <li>CMD_TYPE_ABSOLUTE: Absolute value (e.g. 5 or 1)
|
10 |
-
* <li>CMD_TYPE_RELATIVE: Relative value (e.g. 2 to increment the value by 2)
|
11 |
-
* <li>CMD_TYPE_FREE_EXPRESSION: Free expression (e.g. "=Date()" to set a date attribute to the current date)
|
12 |
-
* </ul>
|
13 |
-
* Note: The data type of a value must be the same as the data type of the specified attribute. Relative values can only
|
14 |
-
* be set for the following data types:
|
15 |
-
* <ul>
|
16 |
-
* <li>DataType.Integer
|
17 |
-
* <li>DataType.Double
|
18 |
-
* <li>DataType.Text
|
19 |
-
* </ul>
|
20 |
-
*
|
21 |
-
* @see Inx_Api_Action_CommandFactory
|
22 |
-
* @see Inx_Api_Recipient_Attribute
|
23 |
-
* @since API 1.2.0
|
24 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
25 |
-
* @package Inxmail
|
26 |
-
* @subpackage Action
|
27 |
-
*/
|
28 |
-
interface Inx_Api_Action_SetValueCommand extends Inx_Api_Action_Command
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Command type: Sets an absolute value.
|
32 |
-
*/
|
33 |
-
const CMD_TYPE_ABSOLUTE = 0;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Command type: Sets a relative value.
|
37 |
-
*/
|
38 |
-
const CMD_TYPE_RELATIVE = 1;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Command type: Sets a value from a free expression.
|
42 |
-
*/
|
43 |
-
const CMD_TYPE_FREE_EXPRESSION = 2;
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Returns the id of the affected user attribute.
|
48 |
-
*
|
49 |
-
* @return int the id of the affected user attribute.
|
50 |
-
*/
|
51 |
-
public function getAttributeId();
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Returns the command type:
|
56 |
-
* Inx_Api_Action_SetValueCommand::CMD_TYPE_ABSOLUTE,
|
57 |
-
* Inx_Api_Action_SetValueCommand::CMD_TYPE_RELATIVE or
|
58 |
-
* Inx_Api_Action_SetValueCommand::CMD_TYPE_FREE_EXPRESSION
|
59 |
-
*
|
60 |
-
* @return int the command type.
|
61 |
-
*/
|
62 |
-
public function getCmdType();
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Returns the expression/value to set for the attribute.
|
67 |
-
*
|
68 |
-
* @return string the expression/value.
|
69 |
-
*/
|
70 |
-
public function getExpression();
|
71 |
-
|
72 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_SetValueCommand</i> to set an attribute value. There are three ways to set the attribute value:
|
8 |
+
* <ul>
|
9 |
+
* <li>CMD_TYPE_ABSOLUTE: Absolute value (e.g. 5 or 1)
|
10 |
+
* <li>CMD_TYPE_RELATIVE: Relative value (e.g. 2 to increment the value by 2)
|
11 |
+
* <li>CMD_TYPE_FREE_EXPRESSION: Free expression (e.g. "=Date()" to set a date attribute to the current date)
|
12 |
+
* </ul>
|
13 |
+
* Note: The data type of a value must be the same as the data type of the specified attribute. Relative values can only
|
14 |
+
* be set for the following data types:
|
15 |
+
* <ul>
|
16 |
+
* <li>DataType.Integer
|
17 |
+
* <li>DataType.Double
|
18 |
+
* <li>DataType.Text
|
19 |
+
* </ul>
|
20 |
+
*
|
21 |
+
* @see Inx_Api_Action_CommandFactory
|
22 |
+
* @see Inx_Api_Recipient_Attribute
|
23 |
+
* @since API 1.2.0
|
24 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
25 |
+
* @package Inxmail
|
26 |
+
* @subpackage Action
|
27 |
+
*/
|
28 |
+
interface Inx_Api_Action_SetValueCommand extends Inx_Api_Action_Command
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Command type: Sets an absolute value.
|
32 |
+
*/
|
33 |
+
const CMD_TYPE_ABSOLUTE = 0;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Command type: Sets a relative value.
|
37 |
+
*/
|
38 |
+
const CMD_TYPE_RELATIVE = 1;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Command type: Sets a value from a free expression.
|
42 |
+
*/
|
43 |
+
const CMD_TYPE_FREE_EXPRESSION = 2;
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Returns the id of the affected user attribute.
|
48 |
+
*
|
49 |
+
* @return int the id of the affected user attribute.
|
50 |
+
*/
|
51 |
+
public function getAttributeId();
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Returns the command type:
|
56 |
+
* Inx_Api_Action_SetValueCommand::CMD_TYPE_ABSOLUTE,
|
57 |
+
* Inx_Api_Action_SetValueCommand::CMD_TYPE_RELATIVE or
|
58 |
+
* Inx_Api_Action_SetValueCommand::CMD_TYPE_FREE_EXPRESSION
|
59 |
+
*
|
60 |
+
* @return int the command type.
|
61 |
+
*/
|
62 |
+
public function getCmdType();
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns the expression/value to set for the attribute.
|
67 |
+
*
|
68 |
+
* @return string the expression/value.
|
69 |
+
*/
|
70 |
+
public function getExpression();
|
71 |
+
|
72 |
+
}
|
lib/Inx/Api/Action/SubUnsubscriptionCommand.php
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_SubUnsubscriptionCommand</i> to subscribe/unsubscribe a recipient to/from the specified standard
|
8 |
-
* list (CMD_TYPE_SUBSCRIBE and CMD_TYPE_UNSUBSCRIBE) or unsubscribe a recipient from all standard lists (MD_TYPE_UNSUBSCRIBE_ALL).
|
9 |
-
*
|
10 |
-
* @see Inx_Api_Action_CommandFactory
|
11 |
-
* @since API 1.2.0
|
12 |
-
* @version $Revision$ $Date$ $Author$
|
13 |
-
* @deprecated Use <i>Inx_Api_Action_SubscriptionCommand</i> and <i>Inx_Api_Action_UnsubscriptionCommand</i> instead.
|
14 |
-
*/
|
15 |
-
interface Inx_Api_Action_SubUnsubscriptionCommand extends Inx_Api_Action_Command
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* Command type: Subscribe to a standard list.
|
19 |
-
*/
|
20 |
-
const CMD_TYPE_SUBSCRIBE = 0;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Command type: Unsubscribe from a standard list.
|
24 |
-
*/
|
25 |
-
const CMD_TYPE_UNSUBSCRIBE = 1;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Command type: Unsubscribe from all standard lists.
|
29 |
-
*/
|
30 |
-
const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
|
31 |
-
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Returns the id of the list context. Only specified if the command type
|
35 |
-
* is CMD_TYPE_SUBSCRIBE or CMD_TYPE_UNSUBSCRIBE.
|
36 |
-
*
|
37 |
-
* @return int the id of the list context.
|
38 |
-
*/
|
39 |
-
public function getListContextId();
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Returns the command type:
|
44 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
|
45 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
|
46 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
|
47 |
-
*
|
48 |
-
* @return int the command type.
|
49 |
-
*/
|
50 |
-
public function getCmdType();
|
51 |
-
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Specifies if the subscription/unsubscription processing is enabled or the recipient will be
|
55 |
-
* subscribed/unsubscribed directly. If processing and double opt in (DOI) / double opt out (DOO) are enabled, this
|
56 |
-
* will send a verification email to the recipient.
|
57 |
-
*
|
58 |
-
* @return bool true if the subscription/unsubscription processing is enabled, false otherwise.
|
59 |
-
*/
|
60 |
-
public function isProcessingEnabled();
|
61 |
-
|
62 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_SubUnsubscriptionCommand</i> to subscribe/unsubscribe a recipient to/from the specified standard
|
8 |
+
* list (CMD_TYPE_SUBSCRIBE and CMD_TYPE_UNSUBSCRIBE) or unsubscribe a recipient from all standard lists (MD_TYPE_UNSUBSCRIBE_ALL).
|
9 |
+
*
|
10 |
+
* @see Inx_Api_Action_CommandFactory
|
11 |
+
* @since API 1.2.0
|
12 |
+
* @version $Revision$ $Date$ $Author$
|
13 |
+
* @deprecated Use <i>Inx_Api_Action_SubscriptionCommand</i> and <i>Inx_Api_Action_UnsubscriptionCommand</i> instead.
|
14 |
+
*/
|
15 |
+
interface Inx_Api_Action_SubUnsubscriptionCommand extends Inx_Api_Action_Command
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* Command type: Subscribe to a standard list.
|
19 |
+
*/
|
20 |
+
const CMD_TYPE_SUBSCRIBE = 0;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Command type: Unsubscribe from a standard list.
|
24 |
+
*/
|
25 |
+
const CMD_TYPE_UNSUBSCRIBE = 1;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Command type: Unsubscribe from all standard lists.
|
29 |
+
*/
|
30 |
+
const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns the id of the list context. Only specified if the command type
|
35 |
+
* is CMD_TYPE_SUBSCRIBE or CMD_TYPE_UNSUBSCRIBE.
|
36 |
+
*
|
37 |
+
* @return int the id of the list context.
|
38 |
+
*/
|
39 |
+
public function getListContextId();
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Returns the command type:
|
44 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
|
45 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
|
46 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
|
47 |
+
*
|
48 |
+
* @return int the command type.
|
49 |
+
*/
|
50 |
+
public function getCmdType();
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Specifies if the subscription/unsubscription processing is enabled or the recipient will be
|
55 |
+
* subscribed/unsubscribed directly. If processing and double opt in (DOI) / double opt out (DOO) are enabled, this
|
56 |
+
* will send a verification email to the recipient.
|
57 |
+
*
|
58 |
+
* @return bool true if the subscription/unsubscription processing is enabled, false otherwise.
|
59 |
+
*/
|
60 |
+
public function isProcessingEnabled();
|
61 |
+
|
62 |
}
|
lib/Inx/Api/Action/SubscriptionCommand.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_SubscriptionCommand</i> to subscribe the recipient to the specified standard list.
|
8 |
-
*
|
9 |
-
* @see Inx_Api_Action_CommandFactory
|
10 |
-
* @since API 1.2.0
|
11 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
12 |
-
* @package Inxmail
|
13 |
-
* @subpackage Action
|
14 |
-
*/
|
15 |
-
interface Inx_Api_Action_SubscriptionCommand extends Inx_Api_Action_Command
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* Command type: Subscribe to a standard list.
|
19 |
-
*/
|
20 |
-
const CMD_TYPE_SUBSCRIBE = 5;
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Returns the id of the list context. Only specified if the command type is CMD_TYPE_SUBSCRIBE.
|
26 |
-
*
|
27 |
-
* @return int the id of the list context.
|
28 |
-
*/
|
29 |
-
public function getListContextId();
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Returns the command type:
|
34 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
|
35 |
-
*
|
36 |
-
* @return int the command type.
|
37 |
-
*/
|
38 |
-
public function getCmdType();
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Specifies if the subscription processing is enabled or the recipient will be subscribed directly. If processing
|
43 |
-
* and double opt in (DOI) are enabled, this will send a verification email to the recipient.
|
44 |
-
*
|
45 |
-
* @return bool true if the subscription processing is enabled, false otherwise.
|
46 |
-
*/
|
47 |
-
public function isProcessingEnabled();
|
48 |
-
|
49 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_SubscriptionCommand</i> to subscribe the recipient to the specified standard list.
|
8 |
+
*
|
9 |
+
* @see Inx_Api_Action_CommandFactory
|
10 |
+
* @since API 1.2.0
|
11 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
12 |
+
* @package Inxmail
|
13 |
+
* @subpackage Action
|
14 |
+
*/
|
15 |
+
interface Inx_Api_Action_SubscriptionCommand extends Inx_Api_Action_Command
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* Command type: Subscribe to a standard list.
|
19 |
+
*/
|
20 |
+
const CMD_TYPE_SUBSCRIBE = 5;
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Returns the id of the list context. Only specified if the command type is CMD_TYPE_SUBSCRIBE.
|
26 |
+
*
|
27 |
+
* @return int the id of the list context.
|
28 |
+
*/
|
29 |
+
public function getListContextId();
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Returns the command type:
|
34 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_SUBSCRIBE,
|
35 |
+
*
|
36 |
+
* @return int the command type.
|
37 |
+
*/
|
38 |
+
public function getCmdType();
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Specifies if the subscription processing is enabled or the recipient will be subscribed directly. If processing
|
43 |
+
* and double opt in (DOI) are enabled, this will send a verification email to the recipient.
|
44 |
+
*
|
45 |
+
* @return bool true if the subscription processing is enabled, false otherwise.
|
46 |
+
*/
|
47 |
+
public function isProcessingEnabled();
|
48 |
+
|
49 |
}
|
lib/Inx/Api/Action/UnsubscriptionCommand.php
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Action
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Use the <i>Inx_Api_Action_UnsubscriptionCommand</i> to unsubscribe the recipient from the specified standard list or
|
8 |
-
* unsubscribe the recipient from all standard lists.
|
9 |
-
*
|
10 |
-
* @see Inx_Api_Action_CommandFactory
|
11 |
-
* @since API 1.2.0
|
12 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Action
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Action_UnsubscriptionCommand extends Inx_Api_Action_Command
|
17 |
-
{
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Command type: Unsubscribe from a standard list.
|
21 |
-
*/
|
22 |
-
const CMD_TYPE_UNSUBSCRIBE = 6;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Command type: Unsubscribe from all standard lists.
|
26 |
-
*/
|
27 |
-
const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
|
28 |
-
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Returns the id of the list context. Only specified if the command type
|
32 |
-
* is CMD_TYPE_UNSUBSCRIBE.
|
33 |
-
*
|
34 |
-
* @return int the id of the list context.
|
35 |
-
*/
|
36 |
-
public function getListContextId();
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Returns the command type:
|
41 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
|
42 |
-
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
|
43 |
-
*
|
44 |
-
* @return int the command type.
|
45 |
-
*/
|
46 |
-
public function getCmdType();
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Specifies if the unsubscription processing is enabled or the recipient will be unsubscribed directly. If
|
51 |
-
* processing and double opt out (DOO) are enabled, this will send a verification email to the recipient.
|
52 |
-
*
|
53 |
-
* @return bool true if the unsubscription processing is enabled, false otherwise.
|
54 |
-
*/
|
55 |
-
public function isProcessingEnabled();
|
56 |
-
|
57 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Action
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Use the <i>Inx_Api_Action_UnsubscriptionCommand</i> to unsubscribe the recipient from the specified standard list or
|
8 |
+
* unsubscribe the recipient from all standard lists.
|
9 |
+
*
|
10 |
+
* @see Inx_Api_Action_CommandFactory
|
11 |
+
* @since API 1.2.0
|
12 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Action
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Action_UnsubscriptionCommand extends Inx_Api_Action_Command
|
17 |
+
{
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Command type: Unsubscribe from a standard list.
|
21 |
+
*/
|
22 |
+
const CMD_TYPE_UNSUBSCRIBE = 6;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Command type: Unsubscribe from all standard lists.
|
26 |
+
*/
|
27 |
+
const CMD_TYPE_UNSUBSCRIBE_ALL = 2;
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns the id of the list context. Only specified if the command type
|
32 |
+
* is CMD_TYPE_UNSUBSCRIBE.
|
33 |
+
*
|
34 |
+
* @return int the id of the list context.
|
35 |
+
*/
|
36 |
+
public function getListContextId();
|
37 |
+
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Returns the command type:
|
41 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE or
|
42 |
+
* Inx_Api_Action_SubUnsubscriptionCommand::CMD_TYPE_UNSUBSCRIBE_ALL
|
43 |
+
*
|
44 |
+
* @return int the command type.
|
45 |
+
*/
|
46 |
+
public function getCmdType();
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Specifies if the unsubscription processing is enabled or the recipient will be unsubscribed directly. If
|
51 |
+
* processing and double opt out (DOO) are enabled, this will send a verification email to the recipient.
|
52 |
+
*
|
53 |
+
* @return bool true if the unsubscription processing is enabled, false otherwise.
|
54 |
+
*/
|
55 |
+
public function isProcessingEnabled();
|
56 |
+
|
57 |
}
|
lib/Inx/Api/Approval/Approver.php
CHANGED
@@ -1,100 +1,100 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Approval
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_Approval_Approver</i> represents a person that has to approve a mailing before it can be sent.
|
8 |
-
* <P>
|
9 |
-
* Note: The system wide approvers are only assigned to the system list. Therefore, the system list id is the only id in
|
10 |
-
* the array returned by <i>getLists()</i>.
|
11 |
-
* <p>
|
12 |
-
* Note: In order to commit changes, all attributes enlisted in this class must be assigned a non null value.
|
13 |
-
* <p>
|
14 |
-
* Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
|
15 |
-
* <p>
|
16 |
-
* For an example on how to use approvers, see the Inx_Api_Approval_ApproverManager documentation.
|
17 |
-
*
|
18 |
-
* @see Inx_Api_Approval_ApproverManager
|
19 |
-
* @since API 1.6.0
|
20 |
-
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
21 |
-
* @package Inxmail
|
22 |
-
* @subpackage Approval
|
23 |
-
*/
|
24 |
-
interface Inx_Api_Approval_Approver extends Inx_Api_BusinessObject
|
25 |
-
{
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Returns the name of the approver.
|
29 |
-
*
|
30 |
-
* @return string the name of the approver.
|
31 |
-
*/
|
32 |
-
public function getName();
|
33 |
-
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Sets a new for the approver.
|
37 |
-
*
|
38 |
-
* @param string $sName the new name of the approver.
|
39 |
-
*/
|
40 |
-
public function updateName( $sName );
|
41 |
-
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Returns the email address of the approver.
|
45 |
-
*
|
46 |
-
* @return string the email address of the approver.
|
47 |
-
*/
|
48 |
-
public function getEmail();
|
49 |
-
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Sets a new email address for the approver.
|
53 |
-
*
|
54 |
-
* @param string $sEmail the new email address of the approver.
|
55 |
-
*/
|
56 |
-
public function updateEmail( $sEmail );
|
57 |
-
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Returns the comment of the approver.
|
61 |
-
*
|
62 |
-
* @return string the comment of the approver.
|
63 |
-
*/
|
64 |
-
public function getComment();
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Sets a new comment for the approver.
|
69 |
-
*
|
70 |
-
* @param string $sComment the new comment of the approver.
|
71 |
-
*/
|
72 |
-
public function updateComment( $sComment );
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Returns an id list of all lists the approver is assigned to.
|
77 |
-
* <P>
|
78 |
-
* Note: System wide approvers return only the system list id.
|
79 |
-
*
|
80 |
-
* @return array an id list of all lists the approver is assigned to, or the system list id if the approver is assigned to
|
81 |
-
* all lists.
|
82 |
-
*/
|
83 |
-
public function getLists();
|
84 |
-
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Sets the lists this approver is assigned to.
|
88 |
-
* <P>
|
89 |
-
* Note: Use the id of the system list as the only id in the array if the approver should be assigned to all lists.
|
90 |
-
* The following snippet retrieves the system list id:
|
91 |
-
* <pre>
|
92 |
-
* $oListContextManager = $oSession->getListContextManager();
|
93 |
-
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
94 |
-
* </pre>
|
95 |
-
*
|
96 |
-
* @param array $lists array of list ids.
|
97 |
-
*/
|
98 |
-
public function updateLists( $lists );
|
99 |
-
|
100 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Approval
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_Approval_Approver</i> represents a person that has to approve a mailing before it can be sent.
|
8 |
+
* <P>
|
9 |
+
* Note: The system wide approvers are only assigned to the system list. Therefore, the system list id is the only id in
|
10 |
+
* the array returned by <i>getLists()</i>.
|
11 |
+
* <p>
|
12 |
+
* Note: In order to commit changes, all attributes enlisted in this class must be assigned a non null value.
|
13 |
+
* <p>
|
14 |
+
* Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
|
15 |
+
* <p>
|
16 |
+
* For an example on how to use approvers, see the Inx_Api_Approval_ApproverManager documentation.
|
17 |
+
*
|
18 |
+
* @see Inx_Api_Approval_ApproverManager
|
19 |
+
* @since API 1.6.0
|
20 |
+
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
21 |
+
* @package Inxmail
|
22 |
+
* @subpackage Approval
|
23 |
+
*/
|
24 |
+
interface Inx_Api_Approval_Approver extends Inx_Api_BusinessObject
|
25 |
+
{
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the name of the approver.
|
29 |
+
*
|
30 |
+
* @return string the name of the approver.
|
31 |
+
*/
|
32 |
+
public function getName();
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets a new for the approver.
|
37 |
+
*
|
38 |
+
* @param string $sName the new name of the approver.
|
39 |
+
*/
|
40 |
+
public function updateName( $sName );
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Returns the email address of the approver.
|
45 |
+
*
|
46 |
+
* @return string the email address of the approver.
|
47 |
+
*/
|
48 |
+
public function getEmail();
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Sets a new email address for the approver.
|
53 |
+
*
|
54 |
+
* @param string $sEmail the new email address of the approver.
|
55 |
+
*/
|
56 |
+
public function updateEmail( $sEmail );
|
57 |
+
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Returns the comment of the approver.
|
61 |
+
*
|
62 |
+
* @return string the comment of the approver.
|
63 |
+
*/
|
64 |
+
public function getComment();
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Sets a new comment for the approver.
|
69 |
+
*
|
70 |
+
* @param string $sComment the new comment of the approver.
|
71 |
+
*/
|
72 |
+
public function updateComment( $sComment );
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Returns an id list of all lists the approver is assigned to.
|
77 |
+
* <P>
|
78 |
+
* Note: System wide approvers return only the system list id.
|
79 |
+
*
|
80 |
+
* @return array an id list of all lists the approver is assigned to, or the system list id if the approver is assigned to
|
81 |
+
* all lists.
|
82 |
+
*/
|
83 |
+
public function getLists();
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Sets the lists this approver is assigned to.
|
88 |
+
* <P>
|
89 |
+
* Note: Use the id of the system list as the only id in the array if the approver should be assigned to all lists.
|
90 |
+
* The following snippet retrieves the system list id:
|
91 |
+
* <pre>
|
92 |
+
* $oListContextManager = $oSession->getListContextManager();
|
93 |
+
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
94 |
+
* </pre>
|
95 |
+
*
|
96 |
+
* @param array $lists array of list ids.
|
97 |
+
*/
|
98 |
+
public function updateLists( $lists );
|
99 |
+
|
100 |
+
}
|
lib/Inx/Api/Approval/ApproverManager.php
CHANGED
@@ -1,46 +1,46 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Approval
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Approval_ApproverManager</i> is used for the retrieval and creation of approvers.
|
8 |
-
* The following code snippet creates a new approver responsible for the list with the id 12:
|
9 |
-
*
|
10 |
-
* <pre>
|
11 |
-
* $approverMgr = $session->getApproverManager();
|
12 |
-
* $approver = approverMgr->createApprover();
|
13 |
-
* $approver->updateName( "Max Mustermann" );
|
14 |
-
* $approver->updateComment( "Approver for List 12" );
|
15 |
-
* $approver->updateLists( array( 12 ) );
|
16 |
-
* $approver->commitUpdate();
|
17 |
-
* </pre>
|
18 |
-
* Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
|
19 |
-
* <p>
|
20 |
-
* For more information on approvers, see the <i>Inx_Api_Approval_Approver</i> documentation.
|
21 |
-
*
|
22 |
-
* @since API 1.6.0
|
23 |
-
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
24 |
-
* @package Inxmail
|
25 |
-
* @subpackage Approval
|
26 |
-
*/
|
27 |
-
interface Inx_Api_Approval_ApproverManager extends Inx_Api_BOManager
|
28 |
-
{
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Selects all approvers assigned to the given list and all system wide approvers.
|
32 |
-
*
|
33 |
-
* @param Inx_Api_List_ListContext $olistContext all approvers assigned to this list will be retrieved.
|
34 |
-
* @return Inx_Api_BOResultSet a result set containing the approvers.
|
35 |
-
*/
|
36 |
-
public function select( $olistContext );
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Creates a new approver.
|
41 |
-
*
|
42 |
-
* @return Inx_Api_Aprroval_Approver the new approver.
|
43 |
-
*/
|
44 |
-
public function createApprover();
|
45 |
-
|
46 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Approval
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Approval_ApproverManager</i> is used for the retrieval and creation of approvers.
|
8 |
+
* The following code snippet creates a new approver responsible for the list with the id 12:
|
9 |
+
*
|
10 |
+
* <pre>
|
11 |
+
* $approverMgr = $session->getApproverManager();
|
12 |
+
* $approver = approverMgr->createApprover();
|
13 |
+
* $approver->updateName( "Max Mustermann" );
|
14 |
+
* $approver->updateComment( "Approver for List 12" );
|
15 |
+
* $approver->updateLists( array( 12 ) );
|
16 |
+
* $approver->commitUpdate();
|
17 |
+
* </pre>
|
18 |
+
* Note: The usage of <i>Inx_Api_Approval_Approver</i>s requires the api user right: <i>Inx_Api_UserRights::PROPERTY_SYSTEM_USE</i>
|
19 |
+
* <p>
|
20 |
+
* For more information on approvers, see the <i>Inx_Api_Approval_Approver</i> documentation.
|
21 |
+
*
|
22 |
+
* @since API 1.6.0
|
23 |
+
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
24 |
+
* @package Inxmail
|
25 |
+
* @subpackage Approval
|
26 |
+
*/
|
27 |
+
interface Inx_Api_Approval_ApproverManager extends Inx_Api_BOManager
|
28 |
+
{
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Selects all approvers assigned to the given list and all system wide approvers.
|
32 |
+
*
|
33 |
+
* @param Inx_Api_List_ListContext $olistContext all approvers assigned to this list will be retrieved.
|
34 |
+
* @return Inx_Api_BOResultSet a result set containing the approvers.
|
35 |
+
*/
|
36 |
+
public function select( $olistContext );
|
37 |
+
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Creates a new approver.
|
41 |
+
*
|
42 |
+
* @return Inx_Api_Aprroval_Approver the new approver.
|
43 |
+
*/
|
44 |
+
public function createApprover();
|
45 |
+
|
46 |
+
}
|
lib/Inx/Api/Blacklist/BlacklistEntry.php
CHANGED
@@ -1,102 +1,102 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Blacklist
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_Blacklist_BlacklistEntry</i> can block individual addresses or complete address ranges so
|
8 |
-
* they can not be added to the Inxmail recipient list, neither by import nor by subscription or in any other ways.
|
9 |
-
* A few examples:
|
10 |
-
* <ul>
|
11 |
-
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
12 |
-
* <LI>*@firm.com - All personnel of this firm is blocked.
|
13 |
-
* <LI>*.tv - No addresses from Tuvalu.
|
14 |
-
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
15 |
-
* <LI>martin@* - All Martins are blocked.
|
16 |
-
* </ul>
|
17 |
-
* Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
18 |
-
* <p>
|
19 |
-
* For an example on how to use the blacklist, see the <i>Inx_Api_Blacklist_BlacklistManager</i> documentation.
|
20 |
-
*
|
21 |
-
* @see Inx_Api_Blacklist_BlacklistManager
|
22 |
-
* @since API 1.1.0
|
23 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
24 |
-
* @package Inxmail
|
25 |
-
* @subpackage Blacklist
|
26 |
-
*/
|
27 |
-
interface Inx_Api_Blacklist_BlacklistEntry extends Inx_Api_BusinessObject
|
28 |
-
{
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Constant of pattern attribute. Used to indicate a change of this attribute and to define the order in which
|
32 |
-
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
33 |
-
*
|
34 |
-
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
35 |
-
*/
|
36 |
-
const ATTRIBUTE_PATTERN = 0;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Constant of descriptionn attribute. Used to indicate a change of this attribute and to define the order in which
|
40 |
-
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
41 |
-
*
|
42 |
-
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
43 |
-
*/
|
44 |
-
const ATTRIBUTE_DESCRIPTION = 1;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Constant of hit count attribute. Used to indicate a change of this attribute and to define the order in which
|
48 |
-
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
49 |
-
*
|
50 |
-
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
51 |
-
*/
|
52 |
-
const ATTRIBUTE_HIT_COUNT = 2;
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Returns the email address pattern.
|
57 |
-
*
|
58 |
-
* @return string the email address pattern
|
59 |
-
*/
|
60 |
-
public function getPattern();
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Changes the email address pattern.
|
65 |
-
* A few examples:
|
66 |
-
* <ul>
|
67 |
-
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
68 |
-
* <LI>*@firm.com - All personnel of this firm is blocked.
|
69 |
-
* <LI>*.tv - No addresses from Tuvalu.
|
70 |
-
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
71 |
-
* <LI>martin@* - All Martins are blocked.
|
72 |
-
* </ul>
|
73 |
-
*
|
74 |
-
* @param string $sPattern the new email address pattern
|
75 |
-
*/
|
76 |
-
public function updatePattern( $sPattern );
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Returns the entry description.
|
81 |
-
*
|
82 |
-
* @return string the entry description.
|
83 |
-
*/
|
84 |
-
public function getDescription();
|
85 |
-
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Changes the entry description.
|
89 |
-
*
|
90 |
-
* @param string $sDescription the new entry description.
|
91 |
-
*/
|
92 |
-
public function updateDescription( $sDescription );
|
93 |
-
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Returns the number of addresses which were blocked by this entry.
|
97 |
-
*
|
98 |
-
* @return int the number of addresses which were blocked by this entry.
|
99 |
-
*/
|
100 |
-
public function getHitCount();
|
101 |
-
|
102 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Blacklist
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_Blacklist_BlacklistEntry</i> can block individual addresses or complete address ranges so
|
8 |
+
* they can not be added to the Inxmail recipient list, neither by import nor by subscription or in any other ways.
|
9 |
+
* A few examples:
|
10 |
+
* <ul>
|
11 |
+
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
12 |
+
* <LI>*@firm.com - All personnel of this firm is blocked.
|
13 |
+
* <LI>*.tv - No addresses from Tuvalu.
|
14 |
+
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
15 |
+
* <LI>martin@* - All Martins are blocked.
|
16 |
+
* </ul>
|
17 |
+
* Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
18 |
+
* <p>
|
19 |
+
* For an example on how to use the blacklist, see the <i>Inx_Api_Blacklist_BlacklistManager</i> documentation.
|
20 |
+
*
|
21 |
+
* @see Inx_Api_Blacklist_BlacklistManager
|
22 |
+
* @since API 1.1.0
|
23 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
24 |
+
* @package Inxmail
|
25 |
+
* @subpackage Blacklist
|
26 |
+
*/
|
27 |
+
interface Inx_Api_Blacklist_BlacklistEntry extends Inx_Api_BusinessObject
|
28 |
+
{
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Constant of pattern attribute. Used to indicate a change of this attribute and to define the order in which
|
32 |
+
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
33 |
+
*
|
34 |
+
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
35 |
+
*/
|
36 |
+
const ATTRIBUTE_PATTERN = 0;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constant of descriptionn attribute. Used to indicate a change of this attribute and to define the order in which
|
40 |
+
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
41 |
+
*
|
42 |
+
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
43 |
+
*/
|
44 |
+
const ATTRIBUTE_DESCRIPTION = 1;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Constant of hit count attribute. Used to indicate a change of this attribute and to define the order in which
|
48 |
+
* <i>Inx_Api_Blacklist_BlacklistEntry</i> objects are fetched.
|
49 |
+
*
|
50 |
+
* @see Inx_Api_Blacklist_BlacklistManager::selectAll(int, int)
|
51 |
+
*/
|
52 |
+
const ATTRIBUTE_HIT_COUNT = 2;
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Returns the email address pattern.
|
57 |
+
*
|
58 |
+
* @return string the email address pattern
|
59 |
+
*/
|
60 |
+
public function getPattern();
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Changes the email address pattern.
|
65 |
+
* A few examples:
|
66 |
+
* <ul>
|
67 |
+
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
68 |
+
* <LI>*@firm.com - All personnel of this firm is blocked.
|
69 |
+
* <LI>*.tv - No addresses from Tuvalu.
|
70 |
+
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
71 |
+
* <LI>martin@* - All Martins are blocked.
|
72 |
+
* </ul>
|
73 |
+
*
|
74 |
+
* @param string $sPattern the new email address pattern
|
75 |
+
*/
|
76 |
+
public function updatePattern( $sPattern );
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Returns the entry description.
|
81 |
+
*
|
82 |
+
* @return string the entry description.
|
83 |
+
*/
|
84 |
+
public function getDescription();
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Changes the entry description.
|
89 |
+
*
|
90 |
+
* @param string $sDescription the new entry description.
|
91 |
+
*/
|
92 |
+
public function updateDescription( $sDescription );
|
93 |
+
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Returns the number of addresses which were blocked by this entry.
|
97 |
+
*
|
98 |
+
* @return int the number of addresses which were blocked by this entry.
|
99 |
+
*/
|
100 |
+
public function getHitCount();
|
101 |
+
|
102 |
+
}
|
lib/Inx/Api/Blacklist/BlacklistManager.php
CHANGED
@@ -1,109 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Blacklist
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Sometimes you might want to exclude particular e-mail addresses or whole address ranges from Inxmail.
|
8 |
-
* For this purpose, there is a 'blacklist' of addresses, which can not be added to the Inxmail recipient list, neither
|
9 |
-
* by import nor by subscription or in any other ways.
|
10 |
-
* <p>
|
11 |
-
* You can activate the blacklist feature from the <code>SystemListContext</code>. The following snippet shows how this
|
12 |
-
* can be achieved:
|
13 |
-
* <pre>
|
14 |
-
* $oListContextManager = $oSession->getListContextManager();
|
15 |
-
* $oSystemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
-
*
|
17 |
-
* $oSystemListContext->enableFeature( Inx_Api_Features::BLACKLIST_FEATURE_ID );
|
18 |
-
* </pre>
|
19 |
-
* Using an <i>Inx_Api_Blacklist_BlacklistEntry</i>, you can block individual addresses or complete address ranges.
|
20 |
-
* A few examples:
|
21 |
-
* <ul>
|
22 |
-
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
23 |
-
* <LI>*@firm.com - All personnel of this firm is blocked.
|
24 |
-
* <LI>*.tv - No addresses from Tuvalu.
|
25 |
-
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
26 |
-
* <LI>martin@* - All Martins are blocked.
|
27 |
-
* </ul>
|
28 |
-
* The following snippet shows how to create a blacklist entry that blocks all addresses ending on 'test.com':
|
29 |
-
*
|
30 |
-
* <pre>
|
31 |
-
* $oBlacklistManager = $oSession->getBlacklistManager();
|
32 |
-
*
|
33 |
-
* $oBlacklistEntry = $oBlacklistManager->createBlacklistEntry();
|
34 |
-
* $oBlacklistEntry->updateDescription( "All *test.com users" );
|
35 |
-
* $oBlacklistEntry->updatePattern( "*test.com" );
|
36 |
-
* $oBlacklistEntry->commitUpdate();
|
37 |
-
* </pre>
|
38 |
-
* Note: The selectAfter, selectBefore and selectBetween methods expect an ISO 8601 formatted date string.
|
39 |
-
* This date string can be created as in the following snippet:
|
40 |
-
* <pre>
|
41 |
-
* $dateString = date('c');
|
42 |
-
* </pre>
|
43 |
-
* Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
44 |
-
* <p>
|
45 |
-
* For more information on blacklist entries, see the <i>Inx_Api_Blacklist_BlacklistEntry</i> documentation.
|
46 |
-
*
|
47 |
-
* @see Inx_Api_Blacklist_BlacklistEntry
|
48 |
-
* @since API 1.1.0
|
49 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
50 |
-
* @package Inxmail
|
51 |
-
* @subpackage Blacklist
|
52 |
-
*/
|
53 |
-
interface Inx_Api_Blacklist_BlacklistManager extends Inx_Api_BOManager
|
54 |
-
{
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Creates a new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
|
58 |
-
*
|
59 |
-
* @return Inx_Api_Blacklist_BlacklistEntry the new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
|
60 |
-
*/
|
61 |
-
public function createBlacklistEntry();
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Returns the <i>Inx_Api_Blacklist_BlacklistEntry</i> with the specified pattern.
|
66 |
-
* The pattern is case insensitive.
|
67 |
-
*
|
68 |
-
* @param string $sPattern the pattern to find
|
69 |
-
* @return Inx_Api_Blacklist_BlacklistEntry the entry, or null if no entry was found.
|
70 |
-
*/
|
71 |
-
public function findByPattern( $sPattern );
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Returns a result set containing all blacklist entries in the system which were created or changed after the
|
76 |
-
* specified date.
|
77 |
-
*
|
78 |
-
* @param string $searchDate all entries after this date will be selected. The date has to be formatted as ISO 8601.
|
79 |
-
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
80 |
-
* @throws SecurityException if the session user doesn't have the following permission:
|
81 |
-
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
82 |
-
*/
|
83 |
-
public function selectAfter( $searchDate );
|
84 |
-
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Returns a result set containing all blacklist entries in the system which were created or changed before the
|
88 |
-
* specified date.
|
89 |
-
*
|
90 |
-
* @param string $searchDate all entries before this date will be selected. The date has to be formatted as ISO 8601.
|
91 |
-
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
92 |
-
* @throws SecurityException if the session user doesn't have the following permission:
|
93 |
-
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
94 |
-
*/
|
95 |
-
public function selectBefore( $searchDate );
|
96 |
-
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Returns a result set containing all blacklist entries in the system which were created or changed between the
|
100 |
-
* specified dates.
|
101 |
-
*
|
102 |
-
* @param startDate the start date for the search. The date has to be formatted as ISO 8601.
|
103 |
-
* @param stopDate the end date for the search. The date has to be formatted as ISO 8601.
|
104 |
-
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
105 |
-
* @throws SecurityException if the session user doesn't have the following permission:
|
106 |
-
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
107 |
-
*/
|
108 |
-
public function selectBetween( $startDate, $stopDate );
|
109 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Blacklist
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Sometimes you might want to exclude particular e-mail addresses or whole address ranges from Inxmail.
|
8 |
+
* For this purpose, there is a 'blacklist' of addresses, which can not be added to the Inxmail recipient list, neither
|
9 |
+
* by import nor by subscription or in any other ways.
|
10 |
+
* <p>
|
11 |
+
* You can activate the blacklist feature from the <code>SystemListContext</code>. The following snippet shows how this
|
12 |
+
* can be achieved:
|
13 |
+
* <pre>
|
14 |
+
* $oListContextManager = $oSession->getListContextManager();
|
15 |
+
* $oSystemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
+
*
|
17 |
+
* $oSystemListContext->enableFeature( Inx_Api_Features::BLACKLIST_FEATURE_ID );
|
18 |
+
* </pre>
|
19 |
+
* Using an <i>Inx_Api_Blacklist_BlacklistEntry</i>, you can block individual addresses or complete address ranges.
|
20 |
+
* A few examples:
|
21 |
+
* <ul>
|
22 |
+
* <LI>name@firm.com - The address 'name@firm.com' is blocked.
|
23 |
+
* <LI>*@firm.com - All personnel of this firm is blocked.
|
24 |
+
* <LI>*.tv - No addresses from Tuvalu.
|
25 |
+
* <LI>spam* - All addresses beginning with 'spam' are blocked.
|
26 |
+
* <LI>martin@* - All Martins are blocked.
|
27 |
+
* </ul>
|
28 |
+
* The following snippet shows how to create a blacklist entry that blocks all addresses ending on 'test.com':
|
29 |
+
*
|
30 |
+
* <pre>
|
31 |
+
* $oBlacklistManager = $oSession->getBlacklistManager();
|
32 |
+
*
|
33 |
+
* $oBlacklistEntry = $oBlacklistManager->createBlacklistEntry();
|
34 |
+
* $oBlacklistEntry->updateDescription( "All *test.com users" );
|
35 |
+
* $oBlacklistEntry->updatePattern( "*test.com" );
|
36 |
+
* $oBlacklistEntry->commitUpdate();
|
37 |
+
* </pre>
|
38 |
+
* Note: The selectAfter, selectBefore and selectBetween methods expect an ISO 8601 formatted date string.
|
39 |
+
* This date string can be created as in the following snippet:
|
40 |
+
* <pre>
|
41 |
+
* $dateString = date('c');
|
42 |
+
* </pre>
|
43 |
+
* Note: The usage of the blacklist requires the api user right: <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
44 |
+
* <p>
|
45 |
+
* For more information on blacklist entries, see the <i>Inx_Api_Blacklist_BlacklistEntry</i> documentation.
|
46 |
+
*
|
47 |
+
* @see Inx_Api_Blacklist_BlacklistEntry
|
48 |
+
* @since API 1.1.0
|
49 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
50 |
+
* @package Inxmail
|
51 |
+
* @subpackage Blacklist
|
52 |
+
*/
|
53 |
+
interface Inx_Api_Blacklist_BlacklistManager extends Inx_Api_BOManager
|
54 |
+
{
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Creates a new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
|
58 |
+
*
|
59 |
+
* @return Inx_Api_Blacklist_BlacklistEntry the new <i>Inx_Api_Blacklist_BlacklistEntry</i>.
|
60 |
+
*/
|
61 |
+
public function createBlacklistEntry();
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns the <i>Inx_Api_Blacklist_BlacklistEntry</i> with the specified pattern.
|
66 |
+
* The pattern is case insensitive.
|
67 |
+
*
|
68 |
+
* @param string $sPattern the pattern to find
|
69 |
+
* @return Inx_Api_Blacklist_BlacklistEntry the entry, or null if no entry was found.
|
70 |
+
*/
|
71 |
+
public function findByPattern( $sPattern );
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Returns a result set containing all blacklist entries in the system which were created or changed after the
|
76 |
+
* specified date.
|
77 |
+
*
|
78 |
+
* @param string $searchDate all entries after this date will be selected. The date has to be formatted as ISO 8601.
|
79 |
+
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
80 |
+
* @throws SecurityException if the session user doesn't have the following permission:
|
81 |
+
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
82 |
+
*/
|
83 |
+
public function selectAfter( $searchDate );
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Returns a result set containing all blacklist entries in the system which were created or changed before the
|
88 |
+
* specified date.
|
89 |
+
*
|
90 |
+
* @param string $searchDate all entries before this date will be selected. The date has to be formatted as ISO 8601.
|
91 |
+
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
92 |
+
* @throws SecurityException if the session user doesn't have the following permission:
|
93 |
+
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
94 |
+
*/
|
95 |
+
public function selectBefore( $searchDate );
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Returns a result set containing all blacklist entries in the system which were created or changed between the
|
100 |
+
* specified dates.
|
101 |
+
*
|
102 |
+
* @param startDate the start date for the search. The date has to be formatted as ISO 8601.
|
103 |
+
* @param stopDate the end date for the search. The date has to be formatted as ISO 8601.
|
104 |
+
* @return an <i>Inx_Api_BOResultSet</i> containing all blacklist entries matching the condition.
|
105 |
+
* @throws SecurityException if the session user doesn't have the following permission:
|
106 |
+
* <i>Inx_Api_UserRights::BLACKLIST_FEATURE_USE</i>
|
107 |
+
*/
|
108 |
+
public function selectBetween( $startDate, $stopDate );
|
109 |
+
}
|
lib/Inx/Api/ConnectException.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_ConnectException</i> is thrown when a connection to the server cannot be established
|
7 |
-
* via the static methods provided by <i>Session</i>.
|
8 |
-
* Possible reasons for this exception include:
|
9 |
-
* <ul>
|
10 |
-
* <li>An invalid application URL was provided
|
11 |
-
* <li>The server is not reachable
|
12 |
-
* </ul>
|
13 |
-
*
|
14 |
-
* @package Inxmail
|
15 |
-
*/
|
16 |
-
class Inx_Api_ConnectException extends Exception
|
17 |
-
{
|
18 |
-
|
19 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_ConnectException</i> is thrown when a connection to the server cannot be established
|
7 |
+
* via the static methods provided by <i>Session</i>.
|
8 |
+
* Possible reasons for this exception include:
|
9 |
+
* <ul>
|
10 |
+
* <li>An invalid application URL was provided
|
11 |
+
* <li>The server is not reachable
|
12 |
+
* </ul>
|
13 |
+
*
|
14 |
+
* @package Inxmail
|
15 |
+
*/
|
16 |
+
class Inx_Api_ConnectException extends Exception
|
17 |
+
{
|
18 |
+
|
19 |
}
|
lib/Inx/Api/DataException.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_DataException</i> is thrown when a <i>BusinessObject</i> cannot be found on the server.
|
7 |
-
* Example: Calling <code>commitUpdate()</code> on a <code>BusinessObject</code> that was deleted will result in a
|
8 |
-
* <code>DataException</code>.
|
9 |
-
*
|
10 |
-
* @see Inx_Api_BusinessObject#commitUpdate()
|
11 |
-
* @see Inx_Api_BusinessObject#reload()
|
12 |
-
* @see Inx_Api_BOResultSet#get(int)
|
13 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
14 |
-
* @package Inxmail
|
15 |
-
*/
|
16 |
-
class Inx_Api_DataException extends Exception
|
17 |
-
{
|
18 |
-
|
19 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_DataException</i> is thrown when a <i>BusinessObject</i> cannot be found on the server.
|
7 |
+
* Example: Calling <code>commitUpdate()</code> on a <code>BusinessObject</code> that was deleted will result in a
|
8 |
+
* <code>DataException</code>.
|
9 |
+
*
|
10 |
+
* @see Inx_Api_BusinessObject#commitUpdate()
|
11 |
+
* @see Inx_Api_BusinessObject#reload()
|
12 |
+
* @see Inx_Api_BOResultSet#get(int)
|
13 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
14 |
+
* @package Inxmail
|
15 |
+
*/
|
16 |
+
class Inx_Api_DataException extends Exception
|
17 |
+
{
|
18 |
+
|
19 |
+
}
|
lib/Inx/Api/DesignTemplate/DesignCollection.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage DesignTemplate
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_DesignTemplate_DesignCollection</i> represents a set of templates which are stored in an itc file.
|
8 |
-
* Templates can be used to create complex multipart mailings which are based on a common structure defined by the template.
|
9 |
-
* Templates simplify the creation of such mailings by using a specialized editor which aids in the structuring of the mailing.
|
10 |
-
* <p>
|
11 |
-
* The following design collection data can be retrieved:
|
12 |
-
* <ul>
|
13 |
-
* <li><i>Collection name</i>: the technical name of the design collection.
|
14 |
-
* <li><i>Display name</i>: the display name of the design collection.
|
15 |
-
* <li><i>Collection vendor</i>: the name of the design collection vendor.
|
16 |
-
* <li><i>Vendor URL</i>: the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
|
17 |
-
* <li><i>Collection version</i>: the version of the design collection.
|
18 |
-
* <li><i>Last modification date</i>: the date when the design collection was imported (the last time).
|
19 |
-
* <li><i>Contained templates</i>: the templates contained by the design collection.
|
20 |
-
* </ul>
|
21 |
-
* <p>
|
22 |
-
* Note: All data provided by <i>Inx_Api_DesignTemplate_DesignCollection</i> is read only!
|
23 |
-
* <p>
|
24 |
-
* For an example on how to import and use design collections, see the <i>Inx_Api_DesignTemplate_DesignCollectionManager</i>
|
25 |
-
* documentation.
|
26 |
-
*
|
27 |
-
* @see Inx_Api_DesignTemplate_DesignCollectionManager
|
28 |
-
* @see Inx_Api_DesignTemplate_Template
|
29 |
-
* @since API 1.4.0
|
30 |
-
* @version $Revision: 9553 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
31 |
-
* @package Inxmail
|
32 |
-
* @subpackage DesignTemplate
|
33 |
-
*/
|
34 |
-
interface Inx_Api_DesignTemplate_DesignCollection extends Inx_Api_BusinessObject
|
35 |
-
{
|
36 |
-
/**
|
37 |
-
* Returns the technical name of the design collection.
|
38 |
-
*
|
39 |
-
* @return string the technical name of the design collection.
|
40 |
-
*/
|
41 |
-
public function getName();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Returns the display name of the design collection.
|
45 |
-
*
|
46 |
-
* @return string the display name of the design collection.
|
47 |
-
* @since API 1.9.0
|
48 |
-
*/
|
49 |
-
public function getDisplayName();
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Returns the name of the design collection vendor.
|
53 |
-
*
|
54 |
-
* @return string the name of the design collection vendor.
|
55 |
-
*/
|
56 |
-
public function getVendor();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Returns the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
|
60 |
-
*
|
61 |
-
* @return string the URL of the design collection vendor.
|
62 |
-
*/
|
63 |
-
public function getVendorURL();
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Returns the version of the design collection.
|
67 |
-
*
|
68 |
-
* @return string the version of the design collection.
|
69 |
-
*/
|
70 |
-
public function getVersion();
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Returns the date when the design collection was imported (the last time).
|
74 |
-
*
|
75 |
-
* @return string the date of the last modification of the design collection.
|
76 |
-
* The date will be returned as ISO 8601 formatted datetime string.
|
77 |
-
*/
|
78 |
-
public function getLastModificationDate();
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Returns all templates contained by this design collection.
|
82 |
-
*
|
83 |
-
* @return an array of all <i>Inx_Api_DesignTemplate_Template</i>s contained by this design collection.
|
84 |
-
*/
|
85 |
-
public function getTemplates();
|
86 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage DesignTemplate
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_DesignTemplate_DesignCollection</i> represents a set of templates which are stored in an itc file.
|
8 |
+
* Templates can be used to create complex multipart mailings which are based on a common structure defined by the template.
|
9 |
+
* Templates simplify the creation of such mailings by using a specialized editor which aids in the structuring of the mailing.
|
10 |
+
* <p>
|
11 |
+
* The following design collection data can be retrieved:
|
12 |
+
* <ul>
|
13 |
+
* <li><i>Collection name</i>: the technical name of the design collection.
|
14 |
+
* <li><i>Display name</i>: the display name of the design collection.
|
15 |
+
* <li><i>Collection vendor</i>: the name of the design collection vendor.
|
16 |
+
* <li><i>Vendor URL</i>: the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
|
17 |
+
* <li><i>Collection version</i>: the version of the design collection.
|
18 |
+
* <li><i>Last modification date</i>: the date when the design collection was imported (the last time).
|
19 |
+
* <li><i>Contained templates</i>: the templates contained by the design collection.
|
20 |
+
* </ul>
|
21 |
+
* <p>
|
22 |
+
* Note: All data provided by <i>Inx_Api_DesignTemplate_DesignCollection</i> is read only!
|
23 |
+
* <p>
|
24 |
+
* For an example on how to import and use design collections, see the <i>Inx_Api_DesignTemplate_DesignCollectionManager</i>
|
25 |
+
* documentation.
|
26 |
+
*
|
27 |
+
* @see Inx_Api_DesignTemplate_DesignCollectionManager
|
28 |
+
* @see Inx_Api_DesignTemplate_Template
|
29 |
+
* @since API 1.4.0
|
30 |
+
* @version $Revision: 9553 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
31 |
+
* @package Inxmail
|
32 |
+
* @subpackage DesignTemplate
|
33 |
+
*/
|
34 |
+
interface Inx_Api_DesignTemplate_DesignCollection extends Inx_Api_BusinessObject
|
35 |
+
{
|
36 |
+
/**
|
37 |
+
* Returns the technical name of the design collection.
|
38 |
+
*
|
39 |
+
* @return string the technical name of the design collection.
|
40 |
+
*/
|
41 |
+
public function getName();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Returns the display name of the design collection.
|
45 |
+
*
|
46 |
+
* @return string the display name of the design collection.
|
47 |
+
* @since API 1.9.0
|
48 |
+
*/
|
49 |
+
public function getDisplayName();
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Returns the name of the design collection vendor.
|
53 |
+
*
|
54 |
+
* @return string the name of the design collection vendor.
|
55 |
+
*/
|
56 |
+
public function getVendor();
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Returns the uniform resource locator (URL) of the vendor (i.e. the vendors web site).
|
60 |
+
*
|
61 |
+
* @return string the URL of the design collection vendor.
|
62 |
+
*/
|
63 |
+
public function getVendorURL();
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns the version of the design collection.
|
67 |
+
*
|
68 |
+
* @return string the version of the design collection.
|
69 |
+
*/
|
70 |
+
public function getVersion();
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns the date when the design collection was imported (the last time).
|
74 |
+
*
|
75 |
+
* @return string the date of the last modification of the design collection.
|
76 |
+
* The date will be returned as ISO 8601 formatted datetime string.
|
77 |
+
*/
|
78 |
+
public function getLastModificationDate();
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Returns all templates contained by this design collection.
|
82 |
+
*
|
83 |
+
* @return an array of all <i>Inx_Api_DesignTemplate_Template</i>s contained by this design collection.
|
84 |
+
*/
|
85 |
+
public function getTemplates();
|
86 |
}
|
lib/Inx/Api/DesignTemplate/DesignCollectionManager.php
CHANGED
@@ -1,127 +1,127 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage DesignTemplate
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_DesignTemplate_DesignCollectionMananger</i> can be used to access <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
|
8 |
-
* You can import design collections from itc files into a specific list or all lists (by using the <i>SystemListContext</i>).
|
9 |
-
* You can also retrieve the collections available in a specific list or all lists (by ommitting the list parameter).
|
10 |
-
* <p>
|
11 |
-
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s are returned in an <i>Inx_Api_BOResultSet</i> that may be used to access
|
12 |
-
* the individual collections.
|
13 |
-
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s may contain multiple templates with possibly multiple text and HTML styles.
|
14 |
-
* These styles can be used to create new mailings based on the chosen template.
|
15 |
-
* <p>
|
16 |
-
* The following snippet shows how to generate a mailing based on a newly imported design collection:
|
17 |
-
*
|
18 |
-
* <pre>
|
19 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
20 |
-
* $oMailing = $oSession->getMailingManager()->createMailing( $oListContext );
|
21 |
-
* $oMailing->setContentHandler( "Inx_Api_Mailing_XsltMultiPartContentHandler" );
|
22 |
-
*
|
23 |
-
* $oDesignCollectionManager = $oSession->getDesignCollectionManager();
|
24 |
-
*
|
25 |
-
* $stream = fopen( "test.itc", "rb");
|
26 |
-
*
|
27 |
-
* $oDesignCollection = $oDesignCollectionManager->importDesignCollection( $stream, $oListContext );
|
28 |
-
* fclose($stream);
|
29 |
-
* $aTemplates = $oDesignCollection->getTemplates();
|
30 |
-
*
|
31 |
-
* $oContentHandler = $oMailing->getContentHandler();
|
32 |
-
* $aStyles = $aTemplates[0]->getHTMLStyles();
|
33 |
-
* $oContentHandler->updateStyle( $aStyles[0] );
|
34 |
-
*
|
35 |
-
* $oMailing->commitUpdate();
|
36 |
-
* </pre>
|
37 |
-
*
|
38 |
-
* </p>
|
39 |
-
* <p>
|
40 |
-
* The following snippet shows how to list all available HTML styles of all design collections in a certain list:
|
41 |
-
*
|
42 |
-
* <pre>
|
43 |
-
* $oDesignCollectionManager = $oSession->getDesignCollectionManager();
|
44 |
-
*
|
45 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
46 |
-
*
|
47 |
-
* $oBOResultSet = $oDesignCollectionManager->select($oListContext);
|
48 |
-
*
|
49 |
-
* for( $i = 0; $i<$oBOResultSet->getSize(); $i++)
|
50 |
-
* {
|
51 |
-
* $oDesignCollection = $oBOResultSet->get($i);
|
52 |
-
* echo $oDesignCollection->getVendor();
|
53 |
-
* echo $oDesignCollection->getVendorURL();
|
54 |
-
* ...
|
55 |
-
* $aTemplates = $oDesignCollection->getTemplates();
|
56 |
-
* for($j = 0; $j<count($aTemplates); $j++)
|
57 |
-
* {
|
58 |
-
* $oTemplate = $aTemplates[j];
|
59 |
-
* echo $oTemplate->getName();
|
60 |
-
* echo $oTemplate->getId();
|
61 |
-
* $aHtmlStyles = $oTemplate->getHTMLStyles();
|
62 |
-
* for ($k = 0; $k<count($aHtmlStyles); $k++)
|
63 |
-
* {
|
64 |
-
* echo $aHtmlStyles[k]->getTemplateID();
|
65 |
-
* echo $aHtmlStyles[k]->getStyleName();
|
66 |
-
* }
|
67 |
-
* }
|
68 |
-
* }
|
69 |
-
*
|
70 |
-
* $oBOResultSet->close();
|
71 |
-
* </pre>
|
72 |
-
*
|
73 |
-
* </p>
|
74 |
-
* Note: The usage of <i>Inx_Api_DesignTemplate_DesignCollection</i>s requires the api user right:
|
75 |
-
* <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
|
76 |
-
* <p>
|
77 |
-
* For more information on design collections, see the <i>Inx_Api_DesignTemplate_DesignCollection</i> documentation.
|
78 |
-
*
|
79 |
-
* @see Inx_Api_DesignTemplate_DesignCollection
|
80 |
-
* @since API 1.4.0
|
81 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
82 |
-
* @package Inxmail
|
83 |
-
* @subpackage DesignTemplate
|
84 |
-
*/
|
85 |
-
|
86 |
-
interface Inx_Api_DesignTemplate_DesignCollectionManager extends Inx_Api_BOManager
|
87 |
-
{
|
88 |
-
/**
|
89 |
-
* Imports the desired itc file into the specified list to be used there. Importing an itc into the system list will
|
90 |
-
* make the design collection available in all lists. The following snippet retrieves the system list context:
|
91 |
-
* <PRE>
|
92 |
-
* $oListContextManager = $oSession->getListContextManager();
|
93 |
-
* $oListContextc = $oListContextManager->findByName( Inx_Api_SystemListContext::NAME );
|
94 |
-
* </PRE>
|
95 |
-
*
|
96 |
-
* @param resource $rbItcFile the itc file handle from which the itc file will be read.
|
97 |
-
* @param Inx_Api_List_ListContext $oCxt the list to import the design collection into.
|
98 |
-
* @return Inx_Api_DesignTemplate_DesignCollection the generated <i>Inx_Api_DesignTemplate_DesignCollection</i>.
|
99 |
-
* @throws Inx_Api_IOException if the resource cannot be read.
|
100 |
-
* @throws Inx_Api_DesignTemplate_ImportException if an error occurred while importing the itc file.
|
101 |
-
* @throws Inx_Api_FeatureNotAvailableException if the design template feature is not available in the given list.
|
102 |
-
* This exception is thrown since API 1.9.0.
|
103 |
-
*/
|
104 |
-
public function importDesignCollection( $rbItcFile, Inx_Api_List_ListContext $oCxt );
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Returns the <i>Inx_Api_DesignTemplate_DesignCollection</i>s available in the specified list.
|
108 |
-
* To retrieve all design collections from all lists, pass on a <i>null</i> value.
|
109 |
-
*
|
110 |
-
* @param Inx_Api_List_ListContext $oListContext all design collections available in this list will be returned.
|
111 |
-
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing the fetched
|
112 |
-
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
|
113 |
-
*/
|
114 |
-
public function select( Inx_Api_List_ListContext $oListContext );
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Returns the preview image, provided by the design collection. Can be null, if no image was provided.
|
120 |
-
* This method does not return an actual screenshot of a mailing generated with this
|
121 |
-
* <i>Inx_Api_DesignTemplate_Style</i>, but an image provided and generated by the design collection author.
|
122 |
-
*
|
123 |
-
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> containing the image data.
|
124 |
-
* @throws Inx_Api_NullPointerException when the passed style is <i>null</i>.
|
125 |
-
*/
|
126 |
-
public function createPreviewImageStream( Inx_Api_DesignTemplate_Style $oStyle );
|
127 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage DesignTemplate
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_DesignTemplate_DesignCollectionMananger</i> can be used to access <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
|
8 |
+
* You can import design collections from itc files into a specific list or all lists (by using the <i>SystemListContext</i>).
|
9 |
+
* You can also retrieve the collections available in a specific list or all lists (by ommitting the list parameter).
|
10 |
+
* <p>
|
11 |
+
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s are returned in an <i>Inx_Api_BOResultSet</i> that may be used to access
|
12 |
+
* the individual collections.
|
13 |
+
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s may contain multiple templates with possibly multiple text and HTML styles.
|
14 |
+
* These styles can be used to create new mailings based on the chosen template.
|
15 |
+
* <p>
|
16 |
+
* The following snippet shows how to generate a mailing based on a newly imported design collection:
|
17 |
+
*
|
18 |
+
* <pre>
|
19 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
20 |
+
* $oMailing = $oSession->getMailingManager()->createMailing( $oListContext );
|
21 |
+
* $oMailing->setContentHandler( "Inx_Api_Mailing_XsltMultiPartContentHandler" );
|
22 |
+
*
|
23 |
+
* $oDesignCollectionManager = $oSession->getDesignCollectionManager();
|
24 |
+
*
|
25 |
+
* $stream = fopen( "test.itc", "rb");
|
26 |
+
*
|
27 |
+
* $oDesignCollection = $oDesignCollectionManager->importDesignCollection( $stream, $oListContext );
|
28 |
+
* fclose($stream);
|
29 |
+
* $aTemplates = $oDesignCollection->getTemplates();
|
30 |
+
*
|
31 |
+
* $oContentHandler = $oMailing->getContentHandler();
|
32 |
+
* $aStyles = $aTemplates[0]->getHTMLStyles();
|
33 |
+
* $oContentHandler->updateStyle( $aStyles[0] );
|
34 |
+
*
|
35 |
+
* $oMailing->commitUpdate();
|
36 |
+
* </pre>
|
37 |
+
*
|
38 |
+
* </p>
|
39 |
+
* <p>
|
40 |
+
* The following snippet shows how to list all available HTML styles of all design collections in a certain list:
|
41 |
+
*
|
42 |
+
* <pre>
|
43 |
+
* $oDesignCollectionManager = $oSession->getDesignCollectionManager();
|
44 |
+
*
|
45 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
46 |
+
*
|
47 |
+
* $oBOResultSet = $oDesignCollectionManager->select($oListContext);
|
48 |
+
*
|
49 |
+
* for( $i = 0; $i<$oBOResultSet->getSize(); $i++)
|
50 |
+
* {
|
51 |
+
* $oDesignCollection = $oBOResultSet->get($i);
|
52 |
+
* echo $oDesignCollection->getVendor();
|
53 |
+
* echo $oDesignCollection->getVendorURL();
|
54 |
+
* ...
|
55 |
+
* $aTemplates = $oDesignCollection->getTemplates();
|
56 |
+
* for($j = 0; $j<count($aTemplates); $j++)
|
57 |
+
* {
|
58 |
+
* $oTemplate = $aTemplates[j];
|
59 |
+
* echo $oTemplate->getName();
|
60 |
+
* echo $oTemplate->getId();
|
61 |
+
* $aHtmlStyles = $oTemplate->getHTMLStyles();
|
62 |
+
* for ($k = 0; $k<count($aHtmlStyles); $k++)
|
63 |
+
* {
|
64 |
+
* echo $aHtmlStyles[k]->getTemplateID();
|
65 |
+
* echo $aHtmlStyles[k]->getStyleName();
|
66 |
+
* }
|
67 |
+
* }
|
68 |
+
* }
|
69 |
+
*
|
70 |
+
* $oBOResultSet->close();
|
71 |
+
* </pre>
|
72 |
+
*
|
73 |
+
* </p>
|
74 |
+
* Note: The usage of <i>Inx_Api_DesignTemplate_DesignCollection</i>s requires the api user right:
|
75 |
+
* <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
|
76 |
+
* <p>
|
77 |
+
* For more information on design collections, see the <i>Inx_Api_DesignTemplate_DesignCollection</i> documentation.
|
78 |
+
*
|
79 |
+
* @see Inx_Api_DesignTemplate_DesignCollection
|
80 |
+
* @since API 1.4.0
|
81 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
82 |
+
* @package Inxmail
|
83 |
+
* @subpackage DesignTemplate
|
84 |
+
*/
|
85 |
+
|
86 |
+
interface Inx_Api_DesignTemplate_DesignCollectionManager extends Inx_Api_BOManager
|
87 |
+
{
|
88 |
+
/**
|
89 |
+
* Imports the desired itc file into the specified list to be used there. Importing an itc into the system list will
|
90 |
+
* make the design collection available in all lists. The following snippet retrieves the system list context:
|
91 |
+
* <PRE>
|
92 |
+
* $oListContextManager = $oSession->getListContextManager();
|
93 |
+
* $oListContextc = $oListContextManager->findByName( Inx_Api_SystemListContext::NAME );
|
94 |
+
* </PRE>
|
95 |
+
*
|
96 |
+
* @param resource $rbItcFile the itc file handle from which the itc file will be read.
|
97 |
+
* @param Inx_Api_List_ListContext $oCxt the list to import the design collection into.
|
98 |
+
* @return Inx_Api_DesignTemplate_DesignCollection the generated <i>Inx_Api_DesignTemplate_DesignCollection</i>.
|
99 |
+
* @throws Inx_Api_IOException if the resource cannot be read.
|
100 |
+
* @throws Inx_Api_DesignTemplate_ImportException if an error occurred while importing the itc file.
|
101 |
+
* @throws Inx_Api_FeatureNotAvailableException if the design template feature is not available in the given list.
|
102 |
+
* This exception is thrown since API 1.9.0.
|
103 |
+
*/
|
104 |
+
public function importDesignCollection( $rbItcFile, Inx_Api_List_ListContext $oCxt );
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Returns the <i>Inx_Api_DesignTemplate_DesignCollection</i>s available in the specified list.
|
108 |
+
* To retrieve all design collections from all lists, pass on a <i>null</i> value.
|
109 |
+
*
|
110 |
+
* @param Inx_Api_List_ListContext $oListContext all design collections available in this list will be returned.
|
111 |
+
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing the fetched
|
112 |
+
* <i>Inx_Api_DesignTemplate_DesignCollection</i>s.
|
113 |
+
*/
|
114 |
+
public function select( Inx_Api_List_ListContext $oListContext );
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Returns the preview image, provided by the design collection. Can be null, if no image was provided.
|
120 |
+
* This method does not return an actual screenshot of a mailing generated with this
|
121 |
+
* <i>Inx_Api_DesignTemplate_Style</i>, but an image provided and generated by the design collection author.
|
122 |
+
*
|
123 |
+
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> containing the image data.
|
124 |
+
* @throws Inx_Api_NullPointerException when the passed style is <i>null</i>.
|
125 |
+
*/
|
126 |
+
public function createPreviewImageStream( Inx_Api_DesignTemplate_Style $oStyle );
|
127 |
+
}
|
lib/Inx/Api/DesignTemplate/ImportException.php
CHANGED
@@ -1,111 +1,111 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage DesignTemplate
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_DesignTemplate_ImportException</i> is thrown, when an error occurs while importing an itc file.
|
9 |
-
* <p>
|
10 |
-
* There are several types of this exception:
|
11 |
-
* <ul>
|
12 |
-
* <li>NO_ITC_FILE: the provided file is no valid itc file.
|
13 |
-
* <li>IMPORT_ERROR: the import failed due to a non specific error.
|
14 |
-
* <li>XML_ERROR: the XML data of the itc file is not valid.
|
15 |
-
* <li>SYSTEM_ERROR: a major system error occurred.
|
16 |
-
* </ul>
|
17 |
-
* For further insight on the cause of the error, check the warnings, errors and fatals of this exception, using
|
18 |
-
* the corresponding method.
|
19 |
-
*
|
20 |
-
* @see Inx_Api_DesignTemplate_DesignCollectionManager::importDesignCollection($resource, $oListContext)
|
21 |
-
* @since API 1.4.0
|
22 |
-
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
23 |
-
* @package Inxmail
|
24 |
-
* @subpackage DesignTemplate
|
25 |
-
*/
|
26 |
-
class Inx_Api_DesignTemplate_ImportException extends Exception
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* The provided import file is no valid itc file.
|
30 |
-
*/
|
31 |
-
const NO_ITC_FILE = -1;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* A non specific error occurred during the import.
|
35 |
-
* For further insight on the cause of the error, check the warnings, errors and fatals of this exception.
|
36 |
-
*/
|
37 |
-
const IMPORT_ERROR = -2;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* A major system error occurred during the import. Please check what happened exactly to prevent further failures.
|
41 |
-
* Tips for error analysis:
|
42 |
-
* <ul>
|
43 |
-
* <li>Check the warnings, errors and fatals of this exception
|
44 |
-
* <li>Check the customer log of your inxmail server (if possible)
|
45 |
-
* <li>Check the tomcat log of your inxmail server (if possible)
|
46 |
-
* </ul>
|
47 |
-
*/
|
48 |
-
const SYSTEM_ERROR = -5;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* The XML data of the itc file is not valid and cannot be parsed.
|
52 |
-
*/
|
53 |
-
const XML_ERROR = -6;
|
54 |
-
|
55 |
-
private $aWarnings;
|
56 |
-
|
57 |
-
private $aErrors;
|
58 |
-
|
59 |
-
private $aFatals;
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Creates an <i>Inx_Api_DesignTemplate_ImportException</i> with the given type, detail message, warnings,
|
63 |
-
* errors and fatals.
|
64 |
-
*
|
65 |
-
* @param int $iCode the type of the exception. Can be one of the constants defined by this exception.
|
66 |
-
* @param string $sMessage the detail message of the exception.
|
67 |
-
* @param array $aWarnings the warning messages (string) of the exception.
|
68 |
-
* @param array $aErrors the error messages (string) of the exception.
|
69 |
-
* @param array $aFatals the fatal messages (string) of the exception.
|
70 |
-
*/
|
71 |
-
public function __construct( $sMessage, $iCode, $aWarnings, $aErrors,
|
72 |
-
$aFatals )
|
73 |
-
{
|
74 |
-
parent::__construct( $sMessage, $iCode );
|
75 |
-
|
76 |
-
$this->aWarnings = $aWarnings;
|
77 |
-
$this->aErrors = $aErrors;
|
78 |
-
$this->aFatals = $aFatals;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Returns the error level messages produced by exceptions during the import.
|
83 |
-
*
|
84 |
-
* @return array the error level messages (string).
|
85 |
-
*/
|
86 |
-
public function getErrors()
|
87 |
-
{
|
88 |
-
return $this->aErrors;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Returns the fatal level messages produced by exceptions during the import.
|
93 |
-
*
|
94 |
-
* @return array the fatal level messages (string).
|
95 |
-
*/
|
96 |
-
public function getFatals()
|
97 |
-
{
|
98 |
-
return $this->aFatals;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Returns the warning level messages produced by exceptions during the import.
|
103 |
-
*
|
104 |
-
* @return array the warning level messages (string).
|
105 |
-
*/
|
106 |
-
public function getWarnings()
|
107 |
-
{
|
108 |
-
return $this->aWarnings;
|
109 |
-
}
|
110 |
-
|
111 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage DesignTemplate
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_DesignTemplate_ImportException</i> is thrown, when an error occurs while importing an itc file.
|
9 |
+
* <p>
|
10 |
+
* There are several types of this exception:
|
11 |
+
* <ul>
|
12 |
+
* <li>NO_ITC_FILE: the provided file is no valid itc file.
|
13 |
+
* <li>IMPORT_ERROR: the import failed due to a non specific error.
|
14 |
+
* <li>XML_ERROR: the XML data of the itc file is not valid.
|
15 |
+
* <li>SYSTEM_ERROR: a major system error occurred.
|
16 |
+
* </ul>
|
17 |
+
* For further insight on the cause of the error, check the warnings, errors and fatals of this exception, using
|
18 |
+
* the corresponding method.
|
19 |
+
*
|
20 |
+
* @see Inx_Api_DesignTemplate_DesignCollectionManager::importDesignCollection($resource, $oListContext)
|
21 |
+
* @since API 1.4.0
|
22 |
+
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
23 |
+
* @package Inxmail
|
24 |
+
* @subpackage DesignTemplate
|
25 |
+
*/
|
26 |
+
class Inx_Api_DesignTemplate_ImportException extends Exception
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* The provided import file is no valid itc file.
|
30 |
+
*/
|
31 |
+
const NO_ITC_FILE = -1;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* A non specific error occurred during the import.
|
35 |
+
* For further insight on the cause of the error, check the warnings, errors and fatals of this exception.
|
36 |
+
*/
|
37 |
+
const IMPORT_ERROR = -2;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* A major system error occurred during the import. Please check what happened exactly to prevent further failures.
|
41 |
+
* Tips for error analysis:
|
42 |
+
* <ul>
|
43 |
+
* <li>Check the warnings, errors and fatals of this exception
|
44 |
+
* <li>Check the customer log of your inxmail server (if possible)
|
45 |
+
* <li>Check the tomcat log of your inxmail server (if possible)
|
46 |
+
* </ul>
|
47 |
+
*/
|
48 |
+
const SYSTEM_ERROR = -5;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* The XML data of the itc file is not valid and cannot be parsed.
|
52 |
+
*/
|
53 |
+
const XML_ERROR = -6;
|
54 |
+
|
55 |
+
private $aWarnings;
|
56 |
+
|
57 |
+
private $aErrors;
|
58 |
+
|
59 |
+
private $aFatals;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Creates an <i>Inx_Api_DesignTemplate_ImportException</i> with the given type, detail message, warnings,
|
63 |
+
* errors and fatals.
|
64 |
+
*
|
65 |
+
* @param int $iCode the type of the exception. Can be one of the constants defined by this exception.
|
66 |
+
* @param string $sMessage the detail message of the exception.
|
67 |
+
* @param array $aWarnings the warning messages (string) of the exception.
|
68 |
+
* @param array $aErrors the error messages (string) of the exception.
|
69 |
+
* @param array $aFatals the fatal messages (string) of the exception.
|
70 |
+
*/
|
71 |
+
public function __construct( $sMessage, $iCode, $aWarnings, $aErrors,
|
72 |
+
$aFatals )
|
73 |
+
{
|
74 |
+
parent::__construct( $sMessage, $iCode );
|
75 |
+
|
76 |
+
$this->aWarnings = $aWarnings;
|
77 |
+
$this->aErrors = $aErrors;
|
78 |
+
$this->aFatals = $aFatals;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns the error level messages produced by exceptions during the import.
|
83 |
+
*
|
84 |
+
* @return array the error level messages (string).
|
85 |
+
*/
|
86 |
+
public function getErrors()
|
87 |
+
{
|
88 |
+
return $this->aErrors;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Returns the fatal level messages produced by exceptions during the import.
|
93 |
+
*
|
94 |
+
* @return array the fatal level messages (string).
|
95 |
+
*/
|
96 |
+
public function getFatals()
|
97 |
+
{
|
98 |
+
return $this->aFatals;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Returns the warning level messages produced by exceptions during the import.
|
103 |
+
*
|
104 |
+
* @return array the warning level messages (string).
|
105 |
+
*/
|
106 |
+
public function getWarnings()
|
107 |
+
{
|
108 |
+
return $this->aWarnings;
|
109 |
+
}
|
110 |
+
|
111 |
+
}
|
lib/Inx/Api/DesignTemplate/Style.php
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage DesignTemplate
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_DesignTemplate_Style</i> defines the visual representation of a particular template or mailing.
|
9 |
-
* The style will be used to render the mailing.
|
10 |
-
* <p>
|
11 |
-
* For more information on templates, see the <i>Inx_Api_DesignTemplate_Template</i> documentation.
|
12 |
-
*
|
13 |
-
* @see Inx_Api_DesignTemplate_Template
|
14 |
-
* @since API 1.4.0
|
15 |
-
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage DesignTemplate
|
18 |
-
*/
|
19 |
-
interface Inx_Api_DesignTemplate_Style
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Returns the id of the template, which contains this style.
|
23 |
-
* @return int the id of the template, which contains this style.
|
24 |
-
*/
|
25 |
-
public function getTemplateId();
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Returns the name of this style.
|
29 |
-
* @return string the name of this style.
|
30 |
-
*/
|
31 |
-
public function getStyleName();
|
32 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage DesignTemplate
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_DesignTemplate_Style</i> defines the visual representation of a particular template or mailing.
|
9 |
+
* The style will be used to render the mailing.
|
10 |
+
* <p>
|
11 |
+
* For more information on templates, see the <i>Inx_Api_DesignTemplate_Template</i> documentation.
|
12 |
+
*
|
13 |
+
* @see Inx_Api_DesignTemplate_Template
|
14 |
+
* @since API 1.4.0
|
15 |
+
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage DesignTemplate
|
18 |
+
*/
|
19 |
+
interface Inx_Api_DesignTemplate_Style
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Returns the id of the template, which contains this style.
|
23 |
+
* @return int the id of the template, which contains this style.
|
24 |
+
*/
|
25 |
+
public function getTemplateId();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the name of this style.
|
29 |
+
* @return string the name of this style.
|
30 |
+
*/
|
31 |
+
public function getStyleName();
|
32 |
+
}
|
lib/Inx/Api/DesignTemplate/Template.php
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage DesignTemplate
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_DesignTemplate_Template</i> provides a common structure for complex multipart mailings.
|
8 |
-
* A template may contain multiple (but at least one) text and HTML style which is used to render the mailing.
|
9 |
-
* Multiple <i>Inx_Api_DesignTemplate_Template</i>s can be stored in an <i>Inx_Api_DesignTemplate_DesignCollection</i>.
|
10 |
-
*
|
11 |
-
* @see Inx_Api_DesignTemplate_Style
|
12 |
-
* @see Inx_Api_DesignTemplate_DesignCollection
|
13 |
-
* @since API 1.4.0
|
14 |
-
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
15 |
-
* @package Inxmail
|
16 |
-
* @subpackage DesignTemplate
|
17 |
-
*/
|
18 |
-
interface Inx_Api_DesignTemplate_Template
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Returns the name of the template.
|
22 |
-
*
|
23 |
-
* @return string the name of the template.
|
24 |
-
*/
|
25 |
-
public function getName();
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Returns the id of the template.
|
29 |
-
*
|
30 |
-
* @return int the id of the template.
|
31 |
-
*/
|
32 |
-
public function getId();
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Returns all text <code>Style</code>s in this template. The default text style, which should be used for a
|
36 |
-
* multipart mailing, if there is no appropriate text style for the chosen HTML style, is the first in the array.
|
37 |
-
*
|
38 |
-
* @return array all text <i>Inx_Api_DesignTemplate_Style</i>s of this template.
|
39 |
-
* The default text style is the first in the array.
|
40 |
-
*/
|
41 |
-
public function getTextStyles();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Returns all HTML <i>Inx_Api_DesignTemplate_Style</i>s in this template.
|
45 |
-
* Note, that to generate a multipart mailing, the HTML style should be passed on to the <i>Inx_Api_Mailing_XsltContentHandler</i>.
|
46 |
-
*
|
47 |
-
* @return array all HTML styles of this template.
|
48 |
-
*/
|
49 |
-
public function getHTMLStyles();
|
50 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage DesignTemplate
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_DesignTemplate_Template</i> provides a common structure for complex multipart mailings.
|
8 |
+
* A template may contain multiple (but at least one) text and HTML style which is used to render the mailing.
|
9 |
+
* Multiple <i>Inx_Api_DesignTemplate_Template</i>s can be stored in an <i>Inx_Api_DesignTemplate_DesignCollection</i>.
|
10 |
+
*
|
11 |
+
* @see Inx_Api_DesignTemplate_Style
|
12 |
+
* @see Inx_Api_DesignTemplate_DesignCollection
|
13 |
+
* @since API 1.4.0
|
14 |
+
* @version $Revision: 9497 $Date: 2007-01-25 15:00:09 $ $Author: nds$
|
15 |
+
* @package Inxmail
|
16 |
+
* @subpackage DesignTemplate
|
17 |
+
*/
|
18 |
+
interface Inx_Api_DesignTemplate_Template
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Returns the name of the template.
|
22 |
+
*
|
23 |
+
* @return string the name of the template.
|
24 |
+
*/
|
25 |
+
public function getName();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the id of the template.
|
29 |
+
*
|
30 |
+
* @return int the id of the template.
|
31 |
+
*/
|
32 |
+
public function getId();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns all text <code>Style</code>s in this template. The default text style, which should be used for a
|
36 |
+
* multipart mailing, if there is no appropriate text style for the chosen HTML style, is the first in the array.
|
37 |
+
*
|
38 |
+
* @return array all text <i>Inx_Api_DesignTemplate_Style</i>s of this template.
|
39 |
+
* The default text style is the first in the array.
|
40 |
+
*/
|
41 |
+
public function getTextStyles();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Returns all HTML <i>Inx_Api_DesignTemplate_Style</i>s in this template.
|
45 |
+
* Note, that to generate a multipart mailing, the HTML style should be passed on to the <i>Inx_Api_Mailing_XsltContentHandler</i>.
|
46 |
+
*
|
47 |
+
* @return array all HTML styles of this template.
|
48 |
+
*/
|
49 |
+
public function getHTMLStyles();
|
50 |
+
}
|
lib/Inx/Api/FeatureNotAvailableException.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_FeatureNotAvailableException</i> is thrown when a feature is not available or not enabled in a list.
|
7 |
-
* <p>
|
8 |
-
* Example: Calling <i>Inx_Api__List_ListContext->enableFeature(Features::SUBSCRIPTION_FEATURE_ID)</i> on a dynamic
|
9 |
-
* list will raise a <i>FeatureNotAvailableException</i>. The same is true wehn calling
|
10 |
-
* <i>Inx_Api_Subscription_SubscriptionManager->processSubscription()</i> for a list with disabled subscription feature.
|
11 |
-
*
|
12 |
-
* @see Inx_Api_List_ListContext#enableFeature(int)
|
13 |
-
* @see Inx_Api_List_ListContext#disableFeature(int)
|
14 |
-
* @see Inx_Api_Subscription_SubscriptionManager#processSubscription(Inx_Api_List_StandardListContext, String)
|
15 |
-
* @see Inx_Api_Subscription_SubscriptionManager#processUnsubscription(Inx_Api_List_StandardListContext, String)
|
16 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
17 |
-
* @package Inxmail
|
18 |
-
*/
|
19 |
-
class Inx_Api_FeatureNotAvailableException extends Inx_Api_APIException
|
20 |
-
{
|
21 |
-
|
22 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_FeatureNotAvailableException</i> is thrown when a feature is not available or not enabled in a list.
|
7 |
+
* <p>
|
8 |
+
* Example: Calling <i>Inx_Api__List_ListContext->enableFeature(Features::SUBSCRIPTION_FEATURE_ID)</i> on a dynamic
|
9 |
+
* list will raise a <i>FeatureNotAvailableException</i>. The same is true wehn calling
|
10 |
+
* <i>Inx_Api_Subscription_SubscriptionManager->processSubscription()</i> for a list with disabled subscription feature.
|
11 |
+
*
|
12 |
+
* @see Inx_Api_List_ListContext#enableFeature(int)
|
13 |
+
* @see Inx_Api_List_ListContext#disableFeature(int)
|
14 |
+
* @see Inx_Api_Subscription_SubscriptionManager#processSubscription(Inx_Api_List_StandardListContext, String)
|
15 |
+
* @see Inx_Api_Subscription_SubscriptionManager#processUnsubscription(Inx_Api_List_StandardListContext, String)
|
16 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
17 |
+
* @package Inxmail
|
18 |
+
*/
|
19 |
+
class Inx_Api_FeatureNotAvailableException extends Inx_Api_APIException
|
20 |
+
{
|
21 |
+
|
22 |
+
}
|
lib/Inx/Api/Features.php
CHANGED
@@ -1,136 +1,136 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* Agents, like "Mailing", "Subscription" or "Resource" are called "Features"
|
7 |
-
* in the API language. Which features are available can be obtained
|
8 |
-
* from the <i>Inx_Api_Features</i> interface.
|
9 |
-
*
|
10 |
-
* Features are enabled and disabled from the Inx_Api_List_ListContext, as following example
|
11 |
-
* demonstrates, which enables the "Subscription" agent in the choosen mailing list:
|
12 |
-
*
|
13 |
-
* <PRE>
|
14 |
-
* $oListContext = $oListManager->findByName( $sListName );
|
15 |
-
* $oListContext->enableFeature( Inx_Api_Features::SUBSCRIPTION_FEATURE_ID );
|
16 |
-
* </PRE>
|
17 |
-
*
|
18 |
-
*
|
19 |
-
* Not every feature is accessible for every type of list. For example, subscription
|
20 |
-
* feature is available in standard lists, only. The mailing feature can be used in
|
21 |
-
* standard and filter lists.
|
22 |
-
*
|
23 |
-
* @see Inx_Api_List_ListContext#isFeatureEnabled(int)
|
24 |
-
* @see Inx_Api_List_ListContext#enableFeature(int)
|
25 |
-
* @see Inx_Api_List_ListContext#disableFeature(int)
|
26 |
-
* @since API 1.0
|
27 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
28 |
-
* @package Inxmail
|
29 |
-
*/
|
30 |
-
interface Inx_Api_Features
|
31 |
-
{
|
32 |
-
|
33 |
-
/**
|
34 |
-
* The subscription feature is available in:
|
35 |
-
* <ul>
|
36 |
-
* <li> standard lists </li>
|
37 |
-
* </ul>
|
38 |
-
* @since API 1.0
|
39 |
-
*/
|
40 |
-
const SUBSCRIPTION_FEATURE_ID = 10000;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* The mailing feature is available in:
|
44 |
-
* <ul>
|
45 |
-
* <li> standard lists
|
46 |
-
* <li> and filter lists
|
47 |
-
* </ul>
|
48 |
-
* @since API 1.0
|
49 |
-
*/
|
50 |
-
const MAILING_FEATURE_ID = 10001;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* The resource feature is available in:
|
54 |
-
* <ul>
|
55 |
-
* <li> system list
|
56 |
-
* </ul>
|
57 |
-
* @since API 1.0
|
58 |
-
*/
|
59 |
-
const RESOURCE_FEATURE_ID = 10002;
|
60 |
-
|
61 |
-
/**
|
62 |
-
* The blacklist feature is available in:
|
63 |
-
* <ul>
|
64 |
-
* <li> system list
|
65 |
-
* </ul>
|
66 |
-
* @since API 1.1.0
|
67 |
-
*/
|
68 |
-
const BLACKLIST_FEATURE_ID = 10003;
|
69 |
-
|
70 |
-
/**
|
71 |
-
* The filter feature is available in:
|
72 |
-
* <ul>
|
73 |
-
* <li> system list
|
74 |
-
* </ul>
|
75 |
-
* @since API 1.1.0
|
76 |
-
*/
|
77 |
-
const FILTER_FEATURE_ID = 10004;
|
78 |
-
|
79 |
-
/**
|
80 |
-
* The report feature is available in:
|
81 |
-
* <ul>
|
82 |
-
* <li> standard lists
|
83 |
-
* <li> filter lists
|
84 |
-
* <li> and system list
|
85 |
-
* </ul>
|
86 |
-
* @since API 1.1.0
|
87 |
-
*/
|
88 |
-
const REPORT_FEATURE_ID = 10005;
|
89 |
-
|
90 |
-
/**
|
91 |
-
* The action feature is available in:
|
92 |
-
* <ul>
|
93 |
-
* <li> system list
|
94 |
-
* </ul>
|
95 |
-
*
|
96 |
-
* @since API 1.1.2
|
97 |
-
*/
|
98 |
-
const ACTION_FEATURE_ID = 10006;
|
99 |
-
|
100 |
-
/**
|
101 |
-
* The textmodule, mailing template and design template feature is available in:
|
102 |
-
* <ul>
|
103 |
-
* <li> standard lists
|
104 |
-
* <li> filter lists
|
105 |
-
* <li> and system list
|
106 |
-
* </ul>
|
107 |
-
*
|
108 |
-
* @since API 1.4.0
|
109 |
-
*/
|
110 |
-
const TEXTMODULE_FEATURE_ID = 10007;
|
111 |
-
|
112 |
-
|
113 |
-
/**
|
114 |
-
* The testprofiles feature is available in:
|
115 |
-
* <ul>
|
116 |
-
* <li> standard lists
|
117 |
-
* <li> filter lists
|
118 |
-
* <li> and system list
|
119 |
-
* </ul>
|
120 |
-
*
|
121 |
-
* @since API 1.6.0
|
122 |
-
*/
|
123 |
-
const TESTPROFILES_FEATURE_ID = 10008;
|
124 |
-
|
125 |
-
/**
|
126 |
-
* The template feature is available in:
|
127 |
-
* <ul>
|
128 |
-
* <li>standard lists
|
129 |
-
* <li>filter lists
|
130 |
-
* <li>and system list
|
131 |
-
*
|
132 |
-
* @since API 1.7.0
|
133 |
-
*/
|
134 |
-
const TEMPLATE_FEATURE_ID = 10009;
|
135 |
-
|
136 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* Agents, like "Mailing", "Subscription" or "Resource" are called "Features"
|
7 |
+
* in the API language. Which features are available can be obtained
|
8 |
+
* from the <i>Inx_Api_Features</i> interface.
|
9 |
+
*
|
10 |
+
* Features are enabled and disabled from the Inx_Api_List_ListContext, as following example
|
11 |
+
* demonstrates, which enables the "Subscription" agent in the choosen mailing list:
|
12 |
+
*
|
13 |
+
* <PRE>
|
14 |
+
* $oListContext = $oListManager->findByName( $sListName );
|
15 |
+
* $oListContext->enableFeature( Inx_Api_Features::SUBSCRIPTION_FEATURE_ID );
|
16 |
+
* </PRE>
|
17 |
+
*
|
18 |
+
*
|
19 |
+
* Not every feature is accessible for every type of list. For example, subscription
|
20 |
+
* feature is available in standard lists, only. The mailing feature can be used in
|
21 |
+
* standard and filter lists.
|
22 |
+
*
|
23 |
+
* @see Inx_Api_List_ListContext#isFeatureEnabled(int)
|
24 |
+
* @see Inx_Api_List_ListContext#enableFeature(int)
|
25 |
+
* @see Inx_Api_List_ListContext#disableFeature(int)
|
26 |
+
* @since API 1.0
|
27 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
28 |
+
* @package Inxmail
|
29 |
+
*/
|
30 |
+
interface Inx_Api_Features
|
31 |
+
{
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The subscription feature is available in:
|
35 |
+
* <ul>
|
36 |
+
* <li> standard lists </li>
|
37 |
+
* </ul>
|
38 |
+
* @since API 1.0
|
39 |
+
*/
|
40 |
+
const SUBSCRIPTION_FEATURE_ID = 10000;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* The mailing feature is available in:
|
44 |
+
* <ul>
|
45 |
+
* <li> standard lists
|
46 |
+
* <li> and filter lists
|
47 |
+
* </ul>
|
48 |
+
* @since API 1.0
|
49 |
+
*/
|
50 |
+
const MAILING_FEATURE_ID = 10001;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* The resource feature is available in:
|
54 |
+
* <ul>
|
55 |
+
* <li> system list
|
56 |
+
* </ul>
|
57 |
+
* @since API 1.0
|
58 |
+
*/
|
59 |
+
const RESOURCE_FEATURE_ID = 10002;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* The blacklist feature is available in:
|
63 |
+
* <ul>
|
64 |
+
* <li> system list
|
65 |
+
* </ul>
|
66 |
+
* @since API 1.1.0
|
67 |
+
*/
|
68 |
+
const BLACKLIST_FEATURE_ID = 10003;
|
69 |
+
|
70 |
+
/**
|
71 |
+
* The filter feature is available in:
|
72 |
+
* <ul>
|
73 |
+
* <li> system list
|
74 |
+
* </ul>
|
75 |
+
* @since API 1.1.0
|
76 |
+
*/
|
77 |
+
const FILTER_FEATURE_ID = 10004;
|
78 |
+
|
79 |
+
/**
|
80 |
+
* The report feature is available in:
|
81 |
+
* <ul>
|
82 |
+
* <li> standard lists
|
83 |
+
* <li> filter lists
|
84 |
+
* <li> and system list
|
85 |
+
* </ul>
|
86 |
+
* @since API 1.1.0
|
87 |
+
*/
|
88 |
+
const REPORT_FEATURE_ID = 10005;
|
89 |
+
|
90 |
+
/**
|
91 |
+
* The action feature is available in:
|
92 |
+
* <ul>
|
93 |
+
* <li> system list
|
94 |
+
* </ul>
|
95 |
+
*
|
96 |
+
* @since API 1.1.2
|
97 |
+
*/
|
98 |
+
const ACTION_FEATURE_ID = 10006;
|
99 |
+
|
100 |
+
/**
|
101 |
+
* The textmodule, mailing template and design template feature is available in:
|
102 |
+
* <ul>
|
103 |
+
* <li> standard lists
|
104 |
+
* <li> filter lists
|
105 |
+
* <li> and system list
|
106 |
+
* </ul>
|
107 |
+
*
|
108 |
+
* @since API 1.4.0
|
109 |
+
*/
|
110 |
+
const TEXTMODULE_FEATURE_ID = 10007;
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* The testprofiles feature is available in:
|
115 |
+
* <ul>
|
116 |
+
* <li> standard lists
|
117 |
+
* <li> filter lists
|
118 |
+
* <li> and system list
|
119 |
+
* </ul>
|
120 |
+
*
|
121 |
+
* @since API 1.6.0
|
122 |
+
*/
|
123 |
+
const TESTPROFILES_FEATURE_ID = 10008;
|
124 |
+
|
125 |
+
/**
|
126 |
+
* The template feature is available in:
|
127 |
+
* <ul>
|
128 |
+
* <li>standard lists
|
129 |
+
* <li>filter lists
|
130 |
+
* <li>and system list
|
131 |
+
*
|
132 |
+
* @since API 1.7.0
|
133 |
+
*/
|
134 |
+
const TEMPLATE_FEATURE_ID = 10009;
|
135 |
+
|
136 |
+
}
|
lib/Inx/Api/Filter/Filter.php
CHANGED
@@ -1,165 +1,165 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Filter
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_Filter_Filter</i> is used to define target groups of recipients that share common properties.
|
8 |
-
* For example: All recipients born after 1970. To accomplish this, a <code>Filter</code> uses a statement.
|
9 |
-
* The statement syntax is described in the documentation for {@link #updateStatement(String)}.
|
10 |
-
* <p>
|
11 |
-
* For an example on how to create filters, see the <i>Inx_Api_Filter_FilterManager</i> documentation.
|
12 |
-
*
|
13 |
-
* @see Inx_Api_Filter_FilterManager
|
14 |
-
* @since API 1.1.0
|
15 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage Filter
|
18 |
-
*/
|
19 |
-
interface Inx_Api_Filter_Filter extends Inx_Api_BusinessObject
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Constant for the name attribute. Used as order attribute in <i>select</i> statements.
|
23 |
-
*
|
24 |
-
* @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
25 |
-
*/
|
26 |
-
const ATTRIBUTE_NAME = 0;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Constant for the statement attribute.
|
30 |
-
*/
|
31 |
-
const ATTRIBUTE_STATEMENT = 1;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Constant for the creation datetime attribute. Used as order attribute in <i>select</i> statements.
|
35 |
-
*
|
36 |
-
* @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
37 |
-
*/
|
38 |
-
const ATTRIBUTE_CREATION_DATETIME = 2;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Constant for the list context attribute.
|
42 |
-
*/
|
43 |
-
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Returns the unique name of this filter.
|
48 |
-
*
|
49 |
-
* @return string the unique name of this filter.
|
50 |
-
*/
|
51 |
-
public function getName();
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Sets the unique name of this filter.
|
56 |
-
*
|
57 |
-
* @param string $sName the unique name of this filter.
|
58 |
-
*/
|
59 |
-
public function updateName( $sName );
|
60 |
-
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Returns the statment of this filter. The statement defines the target group of recipients.
|
64 |
-
*
|
65 |
-
* @return string the statment of this filter.
|
66 |
-
*/
|
67 |
-
public function getStatement();
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Sets the filter statement. The statement defines the target group of recipients.
|
72 |
-
* <p>
|
73 |
-
* A filter statement consists of at least one condition that recipients must match. Multiple conditions may be
|
74 |
-
* composed to a filter using the AND/OR operators. There are four possible condition types which may be used:
|
75 |
-
* <ul>
|
76 |
-
* <li><i>Column condition</i>: Compares the value of a column.
|
77 |
-
* <li><i>Recipient reaction condition</i>: Checks if a recipient opened a mailing or clicked a link.
|
78 |
-
* <li><i>Filter membership condition</i>: Checks if a recipient is member of a filter.
|
79 |
-
* <li><i>Free expression</i>: Special checks and comparisons.
|
80 |
-
* </ul>
|
81 |
-
* <p>
|
82 |
-
* The following operators may be used to compare columns to a given value or check their content:
|
83 |
-
* <ul>
|
84 |
-
* <li>column = value - checks for equality
|
85 |
-
* <li>column <> value - checks for inequality
|
86 |
-
* <li>column < value - checks if column value is less than given value
|
87 |
-
* <li>column <= value - checks if column value is less than or equal to given value
|
88 |
-
* <li>column > value - checks if column value is greater than given value
|
89 |
-
* <li>column >= value - checks if column value is greater than or equal to given value
|
90 |
-
* <li>column IS_EMPTY - checks if column value is empty
|
91 |
-
* <li>column NOT_IS_EMPTY - checks if column value is not empty
|
92 |
-
* </ul>
|
93 |
-
* The check values have to be specified in the same data type as the column value. The different date types must be
|
94 |
-
* specified as follows:
|
95 |
-
* <ul>
|
96 |
-
* <li><i>Text</i>: "Text" (be sure to escape the double quotes or use single quotes for the filter)
|
97 |
-
* <li><i>Datetime</i>: #01.01.1970 13:37:42# (be sure to put a single whitespace between date and time)
|
98 |
-
* <li><i>Date</i>: #01.01.1970#
|
99 |
-
* <li><i>Time</i>: #13:37:42#
|
100 |
-
* <li><i>Integer</i>: 42
|
101 |
-
* <li><i>Floating point</i>: 47.11
|
102 |
-
* <li><i>Boolean</i>: TRUE or FALSE (attention: case sensitive!)
|
103 |
-
* </ul>
|
104 |
-
* To specify the column which shall be compared it is best to use the Column("columnName") operator.
|
105 |
-
* <p>
|
106 |
-
* Using free expressions you can create more powerful statements. The operators which can be used in free
|
107 |
-
* expressions are:
|
108 |
-
* <ul>
|
109 |
-
* <li>column LIKE value: checks for equality (case insensitive)
|
110 |
-
* <li>column NOT_LIKE value: checks for inequality (case insensitive)
|
111 |
-
* <li>column STARTS_WITH value: checks if column value starts with given value
|
112 |
-
* <li>column NOT_STARTS_WITH value: checks if column value does not start with given value
|
113 |
-
* <li>column ENDS_WITH value: checks if column value ends with given value
|
114 |
-
* <li>column NOT_ENDS_WITH value: checks if column value does not end with given value
|
115 |
-
* <li>column CONTAINS value: checks if column value contains given value
|
116 |
-
* <li>column NOT_CONTAINS value: checks if column value does not contain given value
|
117 |
-
* </ul>
|
118 |
-
* All of these operators may be used along with text columns. The check values of free expressions may contain
|
119 |
-
* wildcards to match a specific pattern.<br>
|
120 |
-
* <strong>Note:</strong> The wilcard character used in free expressions is NOT the asterisk (*) but the percentage
|
121 |
-
* sign (%).
|
122 |
-
* <p>
|
123 |
-
* Recipient reaction conditions may be used to select recipients who reacted on a specific mailing or link. The
|
124 |
-
* operators used for recipient reaction conditions are:
|
125 |
-
* <ul>
|
126 |
-
* <li><i>HasOpened(mailingId)</i>: checks if the recipient opened the specified mailing
|
127 |
-
* <li><i>HasClickedAnyLink(mailingId)</i>: checks if the recipient clicked any link in the specified mailing
|
128 |
-
* <li><i>HasClicked(linkId)</i>: checks if the recipient clicked the specified link
|
129 |
-
* </ul>
|
130 |
-
* <p>
|
131 |
-
* Filter membership conditions may be used to select recipients who are (or aren't) member of another filter. The
|
132 |
-
* operators used for these checks are:
|
133 |
-
* <ul>
|
134 |
-
* <li><i>BelongsToGroup(filterName)</i>: checks if the recipient is a member of the specified filter.
|
135 |
-
* <li><i>BelongsNotToGroup(filterName)</i>: checks if the recipient is not a member of the specified filter.
|
136 |
-
* </ul>
|
137 |
-
* <p>
|
138 |
-
* Please note that date values for the filter have to be specified in german 24-hour date format. To accomplish this,
|
139 |
-
* the date() function with the following date pattern can be used:
|
140 |
-
* <pre>
|
141 |
-
* $filterDate = date("d.m.Y H:i:s");
|
142 |
-
* </pre>
|
143 |
-
*
|
144 |
-
* @param string $sStmt the filter statment.
|
145 |
-
*/
|
146 |
-
public function updateStatement( $sStmt );
|
147 |
-
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Returns the id of the list which this filter belongs to.
|
151 |
-
*
|
152 |
-
* @return int the id of the list which this filter belongs to.
|
153 |
-
*/
|
154 |
-
public function getListContextId();
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Returns the creation datetime of this filter.
|
159 |
-
*
|
160 |
-
* @return string the creation datetime of this filter. The creation datetime will be returned as ISO 8601
|
161 |
-
* formatted datetime string.
|
162 |
-
*/
|
163 |
-
public function getCreationDatetime();
|
164 |
-
|
165 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Filter
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_Filter_Filter</i> is used to define target groups of recipients that share common properties.
|
8 |
+
* For example: All recipients born after 1970. To accomplish this, a <code>Filter</code> uses a statement.
|
9 |
+
* The statement syntax is described in the documentation for {@link #updateStatement(String)}.
|
10 |
+
* <p>
|
11 |
+
* For an example on how to create filters, see the <i>Inx_Api_Filter_FilterManager</i> documentation.
|
12 |
+
*
|
13 |
+
* @see Inx_Api_Filter_FilterManager
|
14 |
+
* @since API 1.1.0
|
15 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage Filter
|
18 |
+
*/
|
19 |
+
interface Inx_Api_Filter_Filter extends Inx_Api_BusinessObject
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Constant for the name attribute. Used as order attribute in <i>select</i> statements.
|
23 |
+
*
|
24 |
+
* @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
25 |
+
*/
|
26 |
+
const ATTRIBUTE_NAME = 0;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constant for the statement attribute.
|
30 |
+
*/
|
31 |
+
const ATTRIBUTE_STATEMENT = 1;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constant for the creation datetime attribute. Used as order attribute in <i>select</i> statements.
|
35 |
+
*
|
36 |
+
* @see Inx_Api_Filter_FilterManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
37 |
+
*/
|
38 |
+
const ATTRIBUTE_CREATION_DATETIME = 2;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Constant for the list context attribute.
|
42 |
+
*/
|
43 |
+
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Returns the unique name of this filter.
|
48 |
+
*
|
49 |
+
* @return string the unique name of this filter.
|
50 |
+
*/
|
51 |
+
public function getName();
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Sets the unique name of this filter.
|
56 |
+
*
|
57 |
+
* @param string $sName the unique name of this filter.
|
58 |
+
*/
|
59 |
+
public function updateName( $sName );
|
60 |
+
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Returns the statment of this filter. The statement defines the target group of recipients.
|
64 |
+
*
|
65 |
+
* @return string the statment of this filter.
|
66 |
+
*/
|
67 |
+
public function getStatement();
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Sets the filter statement. The statement defines the target group of recipients.
|
72 |
+
* <p>
|
73 |
+
* A filter statement consists of at least one condition that recipients must match. Multiple conditions may be
|
74 |
+
* composed to a filter using the AND/OR operators. There are four possible condition types which may be used:
|
75 |
+
* <ul>
|
76 |
+
* <li><i>Column condition</i>: Compares the value of a column.
|
77 |
+
* <li><i>Recipient reaction condition</i>: Checks if a recipient opened a mailing or clicked a link.
|
78 |
+
* <li><i>Filter membership condition</i>: Checks if a recipient is member of a filter.
|
79 |
+
* <li><i>Free expression</i>: Special checks and comparisons.
|
80 |
+
* </ul>
|
81 |
+
* <p>
|
82 |
+
* The following operators may be used to compare columns to a given value or check their content:
|
83 |
+
* <ul>
|
84 |
+
* <li>column = value - checks for equality
|
85 |
+
* <li>column <> value - checks for inequality
|
86 |
+
* <li>column < value - checks if column value is less than given value
|
87 |
+
* <li>column <= value - checks if column value is less than or equal to given value
|
88 |
+
* <li>column > value - checks if column value is greater than given value
|
89 |
+
* <li>column >= value - checks if column value is greater than or equal to given value
|
90 |
+
* <li>column IS_EMPTY - checks if column value is empty
|
91 |
+
* <li>column NOT_IS_EMPTY - checks if column value is not empty
|
92 |
+
* </ul>
|
93 |
+
* The check values have to be specified in the same data type as the column value. The different date types must be
|
94 |
+
* specified as follows:
|
95 |
+
* <ul>
|
96 |
+
* <li><i>Text</i>: "Text" (be sure to escape the double quotes or use single quotes for the filter)
|
97 |
+
* <li><i>Datetime</i>: #01.01.1970 13:37:42# (be sure to put a single whitespace between date and time)
|
98 |
+
* <li><i>Date</i>: #01.01.1970#
|
99 |
+
* <li><i>Time</i>: #13:37:42#
|
100 |
+
* <li><i>Integer</i>: 42
|
101 |
+
* <li><i>Floating point</i>: 47.11
|
102 |
+
* <li><i>Boolean</i>: TRUE or FALSE (attention: case sensitive!)
|
103 |
+
* </ul>
|
104 |
+
* To specify the column which shall be compared it is best to use the Column("columnName") operator.
|
105 |
+
* <p>
|
106 |
+
* Using free expressions you can create more powerful statements. The operators which can be used in free
|
107 |
+
* expressions are:
|
108 |
+
* <ul>
|
109 |
+
* <li>column LIKE value: checks for equality (case insensitive)
|
110 |
+
* <li>column NOT_LIKE value: checks for inequality (case insensitive)
|
111 |
+
* <li>column STARTS_WITH value: checks if column value starts with given value
|
112 |
+
* <li>column NOT_STARTS_WITH value: checks if column value does not start with given value
|
113 |
+
* <li>column ENDS_WITH value: checks if column value ends with given value
|
114 |
+
* <li>column NOT_ENDS_WITH value: checks if column value does not end with given value
|
115 |
+
* <li>column CONTAINS value: checks if column value contains given value
|
116 |
+
* <li>column NOT_CONTAINS value: checks if column value does not contain given value
|
117 |
+
* </ul>
|
118 |
+
* All of these operators may be used along with text columns. The check values of free expressions may contain
|
119 |
+
* wildcards to match a specific pattern.<br>
|
120 |
+
* <strong>Note:</strong> The wilcard character used in free expressions is NOT the asterisk (*) but the percentage
|
121 |
+
* sign (%).
|
122 |
+
* <p>
|
123 |
+
* Recipient reaction conditions may be used to select recipients who reacted on a specific mailing or link. The
|
124 |
+
* operators used for recipient reaction conditions are:
|
125 |
+
* <ul>
|
126 |
+
* <li><i>HasOpened(mailingId)</i>: checks if the recipient opened the specified mailing
|
127 |
+
* <li><i>HasClickedAnyLink(mailingId)</i>: checks if the recipient clicked any link in the specified mailing
|
128 |
+
* <li><i>HasClicked(linkId)</i>: checks if the recipient clicked the specified link
|
129 |
+
* </ul>
|
130 |
+
* <p>
|
131 |
+
* Filter membership conditions may be used to select recipients who are (or aren't) member of another filter. The
|
132 |
+
* operators used for these checks are:
|
133 |
+
* <ul>
|
134 |
+
* <li><i>BelongsToGroup(filterName)</i>: checks if the recipient is a member of the specified filter.
|
135 |
+
* <li><i>BelongsNotToGroup(filterName)</i>: checks if the recipient is not a member of the specified filter.
|
136 |
+
* </ul>
|
137 |
+
* <p>
|
138 |
+
* Please note that date values for the filter have to be specified in german 24-hour date format. To accomplish this,
|
139 |
+
* the date() function with the following date pattern can be used:
|
140 |
+
* <pre>
|
141 |
+
* $filterDate = date("d.m.Y H:i:s");
|
142 |
+
* </pre>
|
143 |
+
*
|
144 |
+
* @param string $sStmt the filter statment.
|
145 |
+
*/
|
146 |
+
public function updateStatement( $sStmt );
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Returns the id of the list which this filter belongs to.
|
151 |
+
*
|
152 |
+
* @return int the id of the list which this filter belongs to.
|
153 |
+
*/
|
154 |
+
public function getListContextId();
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Returns the creation datetime of this filter.
|
159 |
+
*
|
160 |
+
* @return string the creation datetime of this filter. The creation datetime will be returned as ISO 8601
|
161 |
+
* formatted datetime string.
|
162 |
+
*/
|
163 |
+
public function getCreationDatetime();
|
164 |
+
|
165 |
+
}
|
lib/Inx/Api/Filter/FilterManager.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Filter
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.
|
8 |
-
* Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in
|
9 |
-
* product X', 'Recipients born after 1970', and so on.
|
10 |
-
* <p>
|
11 |
-
* The <i>Inx_Api_Filter_FilterManager</i> can be used to create and retrieve <code>Filter</code>s (target groups).
|
12 |
-
* The following snippet creates a global <i>Inx_Api_Filter_Filter</i>:
|
13 |
-
*
|
14 |
-
* <pre>
|
15 |
-
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
-
* $oFilterManager = $oSession->getFilterManager();
|
17 |
-
* $oFilter = $oFilterManager->createFilter( $oSystemListContext );
|
18 |
-
*
|
19 |
-
* $oFilter->updateName( "New Yorker" );
|
20 |
-
* $oFilter->updateStatement( "city LIKE \"New York\"" );
|
21 |
-
* $oFilter->commitUpdate();
|
22 |
-
* </pre>
|
23 |
-
* <p>
|
24 |
-
* An <i>Inx_Api_Filter_Filter</i> can be assigned to an individual <i>Inx_Api_Mailing_Mailing</i>, as demonstrated
|
25 |
-
* in the following snippet:
|
26 |
-
*
|
27 |
-
* <pre>
|
28 |
-
* $oMailing = ...
|
29 |
-
*
|
30 |
-
* $oMailing->updateFilterId( $oFilter->getId() );
|
31 |
-
* $oMailing->commitUpdate();
|
32 |
-
* </pre>
|
33 |
-
* <p>
|
34 |
-
* The retrieval of <i>Inx_Api_Filter_Filter</i>s can be accomplished using the <i>selectAll()</i> method to retrieve all
|
35 |
-
* filters, or one of the methods that expect an <i>Inx_Api_List_ListContext</i> to retrieve only the filters assigned to a
|
36 |
-
* specific list.
|
37 |
-
* The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:
|
38 |
-
*
|
39 |
-
* <pre>
|
40 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
41 |
-
* $oFilterManager = $oSession->getFilterManager();
|
42 |
-
*
|
43 |
-
* $oBOResultSet = $oFilterManager->select( $oListContext,
|
44 |
-
* Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC );
|
45 |
-
*
|
46 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
47 |
-
* {
|
48 |
-
* $oFilter = $oBOResultSet->get( $i );
|
49 |
-
* echo $oFilter->getName()."<br>";
|
50 |
-
* }
|
51 |
-
*
|
52 |
-
* $oBOResultSet->close();
|
53 |
-
* </pre>
|
54 |
-
* <p>
|
55 |
-
* Note: The usage of <i>Inx_Api_Filter_Filter</i>s requires the api user right: <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
|
56 |
-
* <p>
|
57 |
-
* For more information on filters and the filter statement syntax, see the <i>Inx_Api_Filter_Filter</i> documentation.
|
58 |
-
*
|
59 |
-
* @see Inx_Api_Filter_Filter
|
60 |
-
* @since API 1.1.0
|
61 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
62 |
-
* @package Inxmail
|
63 |
-
* @subpackage Filter
|
64 |
-
*/
|
65 |
-
interface Inx_Api_Filter_FilterManager extends Inx_Api_BOManager
|
66 |
-
{
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Creates a new filter that belongs to the specified list.
|
70 |
-
* To create a global filter, use the system list.
|
71 |
-
* The following snippet shows how to retrieve the <i>Inx_Api_List_SystemListContext</i>:
|
72 |
-
* <pre>
|
73 |
-
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
74 |
-
* </pre>
|
75 |
-
*
|
76 |
-
* @param Inx_Api_List_ListContext $oListContext the owning list of the filter.
|
77 |
-
* @return Inx_Api_Filter_Filter a new filter.
|
78 |
-
*/
|
79 |
-
public function createFilter( Inx_Api_List_ListContext $oListContext );
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Returns an <i>Inx_Api_BOResultSet</i> containing all filters which belong to the specified list ordered
|
83 |
-
* by the specified order attribute and type. To retrieve the global filters, use the system list.
|
84 |
-
*
|
85 |
-
* @param Inx_Api_List_ListContext $oListContext all filters belonging to this list will be retrieved.
|
86 |
-
* @param int $iOrderAttribute the order attribute (<i>Inx_Api_Filter_Filter::ATTRIBUTE_NAME</i> or
|
87 |
-
* <i>Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME</i>). May be ommitted.
|
88 |
-
* @param int $orderType the order type (<i>Inx_Api_Order::ASC</i>
|
89 |
-
* or <i>Inx_Api_Order::DESC</i>). May be ommitted.
|
90 |
-
* @return an <i>Inx_Api_BOResultSet</i> that contains the data produced by the given query.
|
91 |
-
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
92 |
-
* <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
|
93 |
-
*/
|
94 |
-
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = null, $orderType = null);
|
95 |
-
|
96 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Filter
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.
|
8 |
+
* Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in
|
9 |
+
* product X', 'Recipients born after 1970', and so on.
|
10 |
+
* <p>
|
11 |
+
* The <i>Inx_Api_Filter_FilterManager</i> can be used to create and retrieve <code>Filter</code>s (target groups).
|
12 |
+
* The following snippet creates a global <i>Inx_Api_Filter_Filter</i>:
|
13 |
+
*
|
14 |
+
* <pre>
|
15 |
+
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
+
* $oFilterManager = $oSession->getFilterManager();
|
17 |
+
* $oFilter = $oFilterManager->createFilter( $oSystemListContext );
|
18 |
+
*
|
19 |
+
* $oFilter->updateName( "New Yorker" );
|
20 |
+
* $oFilter->updateStatement( "city LIKE \"New York\"" );
|
21 |
+
* $oFilter->commitUpdate();
|
22 |
+
* </pre>
|
23 |
+
* <p>
|
24 |
+
* An <i>Inx_Api_Filter_Filter</i> can be assigned to an individual <i>Inx_Api_Mailing_Mailing</i>, as demonstrated
|
25 |
+
* in the following snippet:
|
26 |
+
*
|
27 |
+
* <pre>
|
28 |
+
* $oMailing = ...
|
29 |
+
*
|
30 |
+
* $oMailing->updateFilterId( $oFilter->getId() );
|
31 |
+
* $oMailing->commitUpdate();
|
32 |
+
* </pre>
|
33 |
+
* <p>
|
34 |
+
* The retrieval of <i>Inx_Api_Filter_Filter</i>s can be accomplished using the <i>selectAll()</i> method to retrieve all
|
35 |
+
* filters, or one of the methods that expect an <i>Inx_Api_List_ListContext</i> to retrieve only the filters assigned to a
|
36 |
+
* specific list.
|
37 |
+
* The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:
|
38 |
+
*
|
39 |
+
* <pre>
|
40 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
41 |
+
* $oFilterManager = $oSession->getFilterManager();
|
42 |
+
*
|
43 |
+
* $oBOResultSet = $oFilterManager->select( $oListContext,
|
44 |
+
* Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC );
|
45 |
+
*
|
46 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
47 |
+
* {
|
48 |
+
* $oFilter = $oBOResultSet->get( $i );
|
49 |
+
* echo $oFilter->getName()."<br>";
|
50 |
+
* }
|
51 |
+
*
|
52 |
+
* $oBOResultSet->close();
|
53 |
+
* </pre>
|
54 |
+
* <p>
|
55 |
+
* Note: The usage of <i>Inx_Api_Filter_Filter</i>s requires the api user right: <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
|
56 |
+
* <p>
|
57 |
+
* For more information on filters and the filter statement syntax, see the <i>Inx_Api_Filter_Filter</i> documentation.
|
58 |
+
*
|
59 |
+
* @see Inx_Api_Filter_Filter
|
60 |
+
* @since API 1.1.0
|
61 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
62 |
+
* @package Inxmail
|
63 |
+
* @subpackage Filter
|
64 |
+
*/
|
65 |
+
interface Inx_Api_Filter_FilterManager extends Inx_Api_BOManager
|
66 |
+
{
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Creates a new filter that belongs to the specified list.
|
70 |
+
* To create a global filter, use the system list.
|
71 |
+
* The following snippet shows how to retrieve the <i>Inx_Api_List_SystemListContext</i>:
|
72 |
+
* <pre>
|
73 |
+
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
74 |
+
* </pre>
|
75 |
+
*
|
76 |
+
* @param Inx_Api_List_ListContext $oListContext the owning list of the filter.
|
77 |
+
* @return Inx_Api_Filter_Filter a new filter.
|
78 |
+
*/
|
79 |
+
public function createFilter( Inx_Api_List_ListContext $oListContext );
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns an <i>Inx_Api_BOResultSet</i> containing all filters which belong to the specified list ordered
|
83 |
+
* by the specified order attribute and type. To retrieve the global filters, use the system list.
|
84 |
+
*
|
85 |
+
* @param Inx_Api_List_ListContext $oListContext all filters belonging to this list will be retrieved.
|
86 |
+
* @param int $iOrderAttribute the order attribute (<i>Inx_Api_Filter_Filter::ATTRIBUTE_NAME</i> or
|
87 |
+
* <i>Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME</i>). May be ommitted.
|
88 |
+
* @param int $orderType the order type (<i>Inx_Api_Order::ASC</i>
|
89 |
+
* or <i>Inx_Api_Order::DESC</i>). May be ommitted.
|
90 |
+
* @return an <i>Inx_Api_BOResultSet</i> that contains the data produced by the given query.
|
91 |
+
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
92 |
+
* <i>Inx_Api_UserRights::FILTER_FEATURE_USE</i>
|
93 |
+
*/
|
94 |
+
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = null, $orderType = null);
|
95 |
+
|
96 |
+
}
|
lib/Inx/Api/FilterStmtException.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
|
6 |
-
/**
|
7 |
-
* he <i>Inx_Api_FilterStmtException</i> is thrown when a filter statement is invalid. The main reasons for this
|
8 |
-
* exception are syntax errors.
|
9 |
-
*
|
10 |
-
* @see Inx_Api_Mailing_MailingManager#select(Inx_Api_List_ListContext, int, String, int, int)
|
11 |
-
* @since API 1.2
|
12 |
-
* @version $Revision: 9345 $ $Date: 2007-12-07 16:49:34 +0200 (Pn, 07 Grd 2007) $ $Author: aurimas $
|
13 |
-
* @package Inxmail
|
14 |
-
*/
|
15 |
-
class Inx_Api_FilterStmtException extends Exception
|
16 |
-
{
|
17 |
-
|
18 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* he <i>Inx_Api_FilterStmtException</i> is thrown when a filter statement is invalid. The main reasons for this
|
8 |
+
* exception are syntax errors.
|
9 |
+
*
|
10 |
+
* @see Inx_Api_Mailing_MailingManager#select(Inx_Api_List_ListContext, int, String, int, int)
|
11 |
+
* @since API 1.2
|
12 |
+
* @version $Revision: 9345 $ $Date: 2007-12-07 16:49:34 +0200 (Pn, 07 Grd 2007) $ $Author: aurimas $
|
13 |
+
* @package Inxmail
|
14 |
+
*/
|
15 |
+
class Inx_Api_FilterStmtException extends Exception
|
16 |
+
{
|
17 |
+
|
18 |
}
|
lib/Inx/Api/IOException.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* Signals that an I/O exception of some sort has occurred.
|
7 |
-
*
|
8 |
-
* @package Inxmail
|
9 |
-
*/
|
10 |
-
class Inx_Api_IOException extends Exception
|
11 |
-
{
|
12 |
-
|
13 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* Signals that an I/O exception of some sort has occurred.
|
7 |
+
*
|
8 |
+
* @package Inxmail
|
9 |
+
*/
|
10 |
+
class Inx_Api_IOException extends Exception
|
11 |
+
{
|
12 |
+
|
13 |
}
|
lib/Inx/Api/IllegalArgumentException.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_IllegalArgumentException</i> is thrown when wrong arguments are supplied.
|
7 |
-
* A common reason for this exception are data type issues.
|
8 |
-
* <p>
|
9 |
-
* Example: Calling <i>Mailing->sendSingleMail("sample@invalid.inv")</i> will raise this exception, because
|
10 |
-
* <i>sendSingleMail()</i> expects a recipient id of type integer, not an email address string.
|
11 |
-
* @version $Revision: 9348 $ $Date: 2007-12-10 09:33:56 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
12 |
-
* @package Inxmail
|
13 |
-
*/
|
14 |
-
class Inx_Api_IllegalArgumentException extends Exception
|
15 |
-
{
|
16 |
-
|
17 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_IllegalArgumentException</i> is thrown when wrong arguments are supplied.
|
7 |
+
* A common reason for this exception are data type issues.
|
8 |
+
* <p>
|
9 |
+
* Example: Calling <i>Mailing->sendSingleMail("sample@invalid.inv")</i> will raise this exception, because
|
10 |
+
* <i>sendSingleMail()</i> expects a recipient id of type integer, not an email address string.
|
11 |
+
* @version $Revision: 9348 $ $Date: 2007-12-10 09:33:56 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
12 |
+
* @package Inxmail
|
13 |
+
*/
|
14 |
+
class Inx_Api_IllegalArgumentException extends Exception
|
15 |
+
{
|
16 |
+
|
17 |
}
|
lib/Inx/Api/IllegalStateException.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_IllegalStateException</i> is thrown when a method cannot operate as expected,
|
7 |
-
* because the application is in the wrong state.
|
8 |
-
* This exception is often thrown by attribute getters when methods are invoked which are illegal
|
9 |
-
* for the given attribute getter.
|
10 |
-
* <p>
|
11 |
-
* Example: A Bounce attribute getter is incapable to retrieve any datetime attributes, although
|
12 |
-
* a method for doing so is provided. However, invokig this method will raise an illegal state
|
13 |
-
* exception, as this method may not be called for the given getter.
|
14 |
-
*
|
15 |
-
* @package Inxmail
|
16 |
-
*/
|
17 |
-
class Inx_Api_IllegalStateException extends Exception {
|
18 |
-
|
19 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_IllegalStateException</i> is thrown when a method cannot operate as expected,
|
7 |
+
* because the application is in the wrong state.
|
8 |
+
* This exception is often thrown by attribute getters when methods are invoked which are illegal
|
9 |
+
* for the given attribute getter.
|
10 |
+
* <p>
|
11 |
+
* Example: A Bounce attribute getter is incapable to retrieve any datetime attributes, although
|
12 |
+
* a method for doing so is provided. However, invokig this method will raise an illegal state
|
13 |
+
* exception, as this method may not be called for the given getter.
|
14 |
+
*
|
15 |
+
* @package Inxmail
|
16 |
+
*/
|
17 |
+
class Inx_Api_IllegalStateException extends Exception {
|
18 |
+
|
19 |
}
|
lib/Inx/Api/Inbox/InboxManager.php
CHANGED
@@ -1,99 +1,99 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The <i>Inx_Api_Inbox_InboxManager</i> can be used to retrieve inbox messages.
|
4 |
-
* There are different methods for the retrieval of inbox messages, for example you can retrieve messages by date.
|
5 |
-
* The following example returns an <i>Inx_Api_BOResultSet</i> containing all inbox messages in the system:
|
6 |
-
*
|
7 |
-
* <PRE>
|
8 |
-
* $oInboxManager = $oSession->getInboxManager();
|
9 |
-
* $oBOResultSet = $oInboxManager->selectAll();
|
10 |
-
*
|
11 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
12 |
-
* {
|
13 |
-
* $oInboxMessage = $oBOResultSet->get( $i );
|
14 |
-
* echo $oInboxMessage->getSubject() . '<br>';
|
15 |
-
* }
|
16 |
-
*
|
17 |
-
* $oBOResultSet->close();
|
18 |
-
* </PRE>
|
19 |
-
*
|
20 |
-
* Note: The <i>selectAll()</i> method retrieves no recipient information but the id.
|
21 |
-
* If you wish to retrieve the recipient state or some of the recipients attributes, use the
|
22 |
-
* <i>selectAll($oRecipientContext, $aAttributes)</i> method instead.
|
23 |
-
* <p>
|
24 |
-
* Note: The usage of the <i>Inbox</i> requires the api user right: <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
|
25 |
-
* <p>
|
26 |
-
* For more information on inbox messages, see the <i>Inx_Api_Inbox_InboxMessage</i> documentation.
|
27 |
-
*
|
28 |
-
* @see Inx_Api_Inbox_InboxMessage
|
29 |
-
* @since API 1.9.0
|
30 |
-
* @version $Revision:$ $Date:$ $Author:$
|
31 |
-
* @package Inxmail
|
32 |
-
* @subpackage Inbox
|
33 |
-
*/
|
34 |
-
interface Inx_Api_Inbox_InboxManager extends Inx_Api_BOManager
|
35 |
-
{
|
36 |
-
/**
|
37 |
-
* Returns a result set containing all inbox messages received before the specified date.
|
38 |
-
* The date has to be passed as ISO 8601 formatted datetime string.
|
39 |
-
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
40 |
-
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
41 |
-
*
|
42 |
-
* @param string $sSearchDate all inbox messages before this date will be selected.
|
43 |
-
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
44 |
-
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
45 |
-
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
46 |
-
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
47 |
-
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
48 |
-
*/
|
49 |
-
public function selectBefore( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Returns a result set containing all inbox messages received after the specified date.
|
54 |
-
* The date has to be passed as ISO 8601 formatted datetime string.
|
55 |
-
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
56 |
-
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
57 |
-
*
|
58 |
-
* @param string $sSearchDate all inbox messages after this date will be selected.
|
59 |
-
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
60 |
-
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
61 |
-
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
62 |
-
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
63 |
-
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
64 |
-
*/
|
65 |
-
public function selectAfter( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Returns a result set containing all inbox messages received between the specified date.
|
70 |
-
* The dates have to be passed as ISO 8601 formatted datetime string.
|
71 |
-
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
72 |
-
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
73 |
-
*
|
74 |
-
* @param string $sStartDate the start date of the search.
|
75 |
-
* @param string $sStopDate the end date of the search.
|
76 |
-
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
77 |
-
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
78 |
-
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
79 |
-
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
80 |
-
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
81 |
-
*/
|
82 |
-
public function selectBetween( $sStartDate, $sStopDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
83 |
-
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Returns a result set containing all inbox messages.
|
87 |
-
* If there are no messages, an empty result set will be returned.
|
88 |
-
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
89 |
-
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
90 |
-
*
|
91 |
-
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
92 |
-
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
93 |
-
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
94 |
-
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
95 |
-
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
96 |
-
*/
|
97 |
-
public function selectAllInboxMessages( Inx_Api_Recipient_RecipientContext $rc = null, $aAttributes = null );
|
98 |
-
|
99 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The <i>Inx_Api_Inbox_InboxManager</i> can be used to retrieve inbox messages.
|
4 |
+
* There are different methods for the retrieval of inbox messages, for example you can retrieve messages by date.
|
5 |
+
* The following example returns an <i>Inx_Api_BOResultSet</i> containing all inbox messages in the system:
|
6 |
+
*
|
7 |
+
* <PRE>
|
8 |
+
* $oInboxManager = $oSession->getInboxManager();
|
9 |
+
* $oBOResultSet = $oInboxManager->selectAll();
|
10 |
+
*
|
11 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
12 |
+
* {
|
13 |
+
* $oInboxMessage = $oBOResultSet->get( $i );
|
14 |
+
* echo $oInboxMessage->getSubject() . '<br>';
|
15 |
+
* }
|
16 |
+
*
|
17 |
+
* $oBOResultSet->close();
|
18 |
+
* </PRE>
|
19 |
+
*
|
20 |
+
* Note: The <i>selectAll()</i> method retrieves no recipient information but the id.
|
21 |
+
* If you wish to retrieve the recipient state or some of the recipients attributes, use the
|
22 |
+
* <i>selectAll($oRecipientContext, $aAttributes)</i> method instead.
|
23 |
+
* <p>
|
24 |
+
* Note: The usage of the <i>Inbox</i> requires the api user right: <i>Inx_Api_UserRights::ERRORMAIL_FEATURE_USE</i>
|
25 |
+
* <p>
|
26 |
+
* For more information on inbox messages, see the <i>Inx_Api_Inbox_InboxMessage</i> documentation.
|
27 |
+
*
|
28 |
+
* @see Inx_Api_Inbox_InboxMessage
|
29 |
+
* @since API 1.9.0
|
30 |
+
* @version $Revision:$ $Date:$ $Author:$
|
31 |
+
* @package Inxmail
|
32 |
+
* @subpackage Inbox
|
33 |
+
*/
|
34 |
+
interface Inx_Api_Inbox_InboxManager extends Inx_Api_BOManager
|
35 |
+
{
|
36 |
+
/**
|
37 |
+
* Returns a result set containing all inbox messages received before the specified date.
|
38 |
+
* The date has to be passed as ISO 8601 formatted datetime string.
|
39 |
+
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
40 |
+
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
41 |
+
*
|
42 |
+
* @param string $sSearchDate all inbox messages before this date will be selected.
|
43 |
+
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
44 |
+
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
45 |
+
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
46 |
+
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
47 |
+
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
48 |
+
*/
|
49 |
+
public function selectBefore( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Returns a result set containing all inbox messages received after the specified date.
|
54 |
+
* The date has to be passed as ISO 8601 formatted datetime string.
|
55 |
+
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
56 |
+
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
57 |
+
*
|
58 |
+
* @param string $sSearchDate all inbox messages after this date will be selected.
|
59 |
+
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
60 |
+
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
61 |
+
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
62 |
+
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
63 |
+
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
64 |
+
*/
|
65 |
+
public function selectAfter( $sSearchDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Returns a result set containing all inbox messages received between the specified date.
|
70 |
+
* The dates have to be passed as ISO 8601 formatted datetime string.
|
71 |
+
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
72 |
+
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
73 |
+
*
|
74 |
+
* @param string $sStartDate the start date of the search.
|
75 |
+
* @param string $sStopDate the end date of the search.
|
76 |
+
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
77 |
+
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
78 |
+
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
79 |
+
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
80 |
+
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
81 |
+
*/
|
82 |
+
public function selectBetween( $sStartDate, $sStopDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Returns a result set containing all inbox messages.
|
87 |
+
* If there are no messages, an empty result set will be returned.
|
88 |
+
* If the <i>RecipientContext</i> is not null and the <i>Attribute</i> array contains at least one element, the
|
89 |
+
* retrieved messages will contain information about the recipient state and the specified recipient attributes.
|
90 |
+
*
|
91 |
+
* @param Inx_Api_Recipient_RecipientContext $rc the <i>RecipientContext</i>.
|
92 |
+
* See <i>Inx_Api_Session::createRecipientContext()</i>.
|
93 |
+
* @param array $aAttributes an array of recipient attributes that will be fetched for later retrieval.
|
94 |
+
* See <i>Inx_Api_Recipient_RecipientMetaData</i>.
|
95 |
+
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all inbox messages matching the condition.
|
96 |
+
*/
|
97 |
+
public function selectAllInboxMessages( Inx_Api_Recipient_RecipientContext $rc = null, $aAttributes = null );
|
98 |
+
|
99 |
}
|
lib/Inx/Api/Inbox/InboxMessage.php
CHANGED
@@ -1,268 +1,268 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* An <i>Inx_Api_Inbox_InboxMessage</i> object contains information related to a message received through the inbox.
|
5 |
-
* With this object you can access data of a received reply, auto responder message, flame message or spam message.
|
6 |
-
* For example you can retrieve the id of the recipient or the content of the received message.
|
7 |
-
* <p>
|
8 |
-
* For an example on how to retrieve <i>InboxMessage</i>s, see the <i>Inx_Api_Inbox_InboxManager</i> documentation.
|
9 |
-
*
|
10 |
-
* @see Inx_Api_Inbox_InboxManager
|
11 |
-
* @since API 1.9.0
|
12 |
-
* @version $Revision:$ $Date:$ $Author:$
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Inbox
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Inbox_InboxMessage extends Inx_Api_BusinessObject
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* This category represents an auto responder message.
|
20 |
-
*
|
21 |
-
* @var int
|
22 |
-
*/
|
23 |
-
const CATEGORY_AUTO_RESPONDER = 0;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* This category represents a flame message. A flame message is a message with aggressive content and/or strong
|
27 |
-
* language.
|
28 |
-
*
|
29 |
-
* @var int
|
30 |
-
*/
|
31 |
-
const CATEGORY_FLAME = 1;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This category represents a mail categorized as undesirable by spam/virus checking software
|
35 |
-
*
|
36 |
-
* @var int
|
37 |
-
*/
|
38 |
-
const CATEGORY_SPAM = 2;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* This category represents an ordinary mail which does not match a specific category.
|
42 |
-
*
|
43 |
-
* @var int
|
44 |
-
*/
|
45 |
-
const CATEGORY_UNCATEGORIZED = 3;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* This category represents a mail of unknown type.
|
49 |
-
*
|
50 |
-
* @var int
|
51 |
-
*/
|
52 |
-
const CATEGORY_UNKNOWN = 4;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* State for missing recipient information. This state will be used when no <i>RecipientContext</i> and/or no
|
56 |
-
* attributes are specified in the query or in case of an unknown recipient.
|
57 |
-
*
|
58 |
-
* @var int
|
59 |
-
*/
|
60 |
-
const RECIPIENT_STATE_UNKNOWN = 0;
|
61 |
-
|
62 |
-
/**
|
63 |
-
* State for existent recipient.
|
64 |
-
*
|
65 |
-
* @var int
|
66 |
-
*/
|
67 |
-
const RECIPIENT_STATE_EXISTENT = 1;
|
68 |
-
|
69 |
-
/**
|
70 |
-
* State for non existing (deleted) recipient.
|
71 |
-
*
|
72 |
-
* @var int
|
73 |
-
*/
|
74 |
-
const RECIPIENT_STATE_DELETED = 2;
|
75 |
-
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Returns the category of this inbox message. May be one of:
|
79 |
-
* <ul>
|
80 |
-
* <li><i>CATEGORY_AUTO_RESPONDER</i>
|
81 |
-
* <li><i>CATEGORY_FLAME</i>
|
82 |
-
* <li><i>CATEGORY_SPAM</i>
|
83 |
-
* <li><i>CATEGORY_UNCATEGORIZED</i>
|
84 |
-
* <li><i>CATEGORY_UNKNOWN</i>
|
85 |
-
* </ul>
|
86 |
-
*
|
87 |
-
* @return int the category of this inbox message.
|
88 |
-
*/
|
89 |
-
public function getCategory();
|
90 |
-
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Returns the date when the message was received.
|
94 |
-
* The date will be returned as ISO 8601 formatted datetime string.
|
95 |
-
*
|
96 |
-
* @return string the date of the message reception.
|
97 |
-
*/
|
98 |
-
public function getReceptionDate();
|
99 |
-
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Returns the sender address.
|
103 |
-
*
|
104 |
-
* @return string the sender address as string.
|
105 |
-
*/
|
106 |
-
public function getSender();
|
107 |
-
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Returns the subject of the received message.
|
111 |
-
*
|
112 |
-
* @return string the subject of the received message as string.
|
113 |
-
*/
|
114 |
-
public function getSubject();
|
115 |
-
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Returns the message content as text.
|
119 |
-
*
|
120 |
-
* @return string the message as string.
|
121 |
-
*/
|
122 |
-
public function getTextContent();
|
123 |
-
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Returns the id of the recipient who sent the message.
|
127 |
-
*
|
128 |
-
* @return int the recipient id.
|
129 |
-
*/
|
130 |
-
public function getRecipientId();
|
131 |
-
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Returns the header of the message as string.
|
135 |
-
*
|
136 |
-
* @return string the header of the message as string.
|
137 |
-
*/
|
138 |
-
public function getHeaders();
|
139 |
-
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Returns the complete message as mime message stream.
|
143 |
-
*
|
144 |
-
* @return Inx_Api_InputStream the mime message as input stream.
|
145 |
-
*/
|
146 |
-
public function getMIMEMessageAsStream();
|
147 |
-
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Returns the matched e-mail address (i.e. the e-mail address of the recipient).
|
151 |
-
*
|
152 |
-
* @return string the e-mail address.
|
153 |
-
*/
|
154 |
-
public function getMatchedEmailAddress();
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Returns the state of the recipient for the message.<br>
|
159 |
-
* RecipientState values:
|
160 |
-
* <ul>
|
161 |
-
* <li><i>RECIPIENT_STATE_UNKNOWN</i> - no attributes are queried or recipient is unknown.
|
162 |
-
* <li><i>RECIPIENT_STATE_EXISTENT</i> - recipient exists.
|
163 |
-
* <li><i>RECIPIENT_STATE_DELETED</i> - recipient is deleted.
|
164 |
-
* </ul>
|
165 |
-
*
|
166 |
-
* @return int the recipient state.
|
167 |
-
*/
|
168 |
-
public function getRecipientState();
|
169 |
-
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Returns the integer value for the given recipient Attribute.<br>
|
173 |
-
*
|
174 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
175 |
-
* @return int the integer value.
|
176 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
177 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
|
178 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
179 |
-
*/
|
180 |
-
public function getInteger( Inx_Api_Recipient_Attribute $oAttribute );
|
181 |
-
|
182 |
-
|
183 |
-
/**
|
184 |
-
* Returns the string value for the given recipient Attribute.<br>
|
185 |
-
*
|
186 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
187 |
-
* @return string the string value.
|
188 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
189 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
|
190 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
191 |
-
*/
|
192 |
-
public function getString( Inx_Api_Recipient_Attribute $oAttribute );
|
193 |
-
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Returns the datetime value for the given recipient Attribute.
|
197 |
-
* The datetime will be returned as ISO 8601 formatted datetime string.
|
198 |
-
*
|
199 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
200 |
-
* @return string the datetime value.
|
201 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
202 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
|
203 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
204 |
-
*/
|
205 |
-
public function getDatetime( Inx_Api_Recipient_Attribute $oAttribute );
|
206 |
-
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Returns the date value for the given recipient Attribute.
|
210 |
-
* The date will be returned as ISO 8601 formatted date string.
|
211 |
-
*
|
212 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
213 |
-
* @return string the date value.
|
214 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
215 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
|
216 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
217 |
-
*/
|
218 |
-
public function getDate( Inx_Api_Recipient_Attribute $oAttribute );
|
219 |
-
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Returns the time value for the given recipient Attribute.
|
223 |
-
* The time will be returned as ISO 8601 formatted time string
|
224 |
-
*
|
225 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
226 |
-
* @return string the time value.
|
227 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
228 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
|
229 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
230 |
-
*/
|
231 |
-
public function getTime( Inx_Api_Recipient_Attribute $oAttribute );
|
232 |
-
|
233 |
-
|
234 |
-
/**
|
235 |
-
* Returns the float value for the given recipient Attribute.<br>
|
236 |
-
*
|
237 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
238 |
-
* @return float the float value.
|
239 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
240 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
|
241 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
242 |
-
*/
|
243 |
-
public function getDouble( Inx_Api_Recipient_Attribute $oAttribute );
|
244 |
-
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Returns the bool value for the given recipient Attribute.<br>
|
248 |
-
*
|
249 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
250 |
-
* @return bool the bool value.
|
251 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
252 |
-
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
|
253 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
254 |
-
*/
|
255 |
-
public function getBoolean( Inx_Api_Recipient_Attribute $oAttribute );
|
256 |
-
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Returns the value for the given recipient Attribute.<br>
|
260 |
-
*
|
261 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
262 |
-
* @return mixed the value.
|
263 |
-
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
264 |
-
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
265 |
-
*/
|
266 |
-
public function getObject( Inx_Api_Recipient_Attribute $oAttribute );
|
267 |
-
|
268 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* An <i>Inx_Api_Inbox_InboxMessage</i> object contains information related to a message received through the inbox.
|
5 |
+
* With this object you can access data of a received reply, auto responder message, flame message or spam message.
|
6 |
+
* For example you can retrieve the id of the recipient or the content of the received message.
|
7 |
+
* <p>
|
8 |
+
* For an example on how to retrieve <i>InboxMessage</i>s, see the <i>Inx_Api_Inbox_InboxManager</i> documentation.
|
9 |
+
*
|
10 |
+
* @see Inx_Api_Inbox_InboxManager
|
11 |
+
* @since API 1.9.0
|
12 |
+
* @version $Revision:$ $Date:$ $Author:$
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Inbox
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Inbox_InboxMessage extends Inx_Api_BusinessObject
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* This category represents an auto responder message.
|
20 |
+
*
|
21 |
+
* @var int
|
22 |
+
*/
|
23 |
+
const CATEGORY_AUTO_RESPONDER = 0;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* This category represents a flame message. A flame message is a message with aggressive content and/or strong
|
27 |
+
* language.
|
28 |
+
*
|
29 |
+
* @var int
|
30 |
+
*/
|
31 |
+
const CATEGORY_FLAME = 1;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* This category represents a mail categorized as undesirable by spam/virus checking software
|
35 |
+
*
|
36 |
+
* @var int
|
37 |
+
*/
|
38 |
+
const CATEGORY_SPAM = 2;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* This category represents an ordinary mail which does not match a specific category.
|
42 |
+
*
|
43 |
+
* @var int
|
44 |
+
*/
|
45 |
+
const CATEGORY_UNCATEGORIZED = 3;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* This category represents a mail of unknown type.
|
49 |
+
*
|
50 |
+
* @var int
|
51 |
+
*/
|
52 |
+
const CATEGORY_UNKNOWN = 4;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* State for missing recipient information. This state will be used when no <i>RecipientContext</i> and/or no
|
56 |
+
* attributes are specified in the query or in case of an unknown recipient.
|
57 |
+
*
|
58 |
+
* @var int
|
59 |
+
*/
|
60 |
+
const RECIPIENT_STATE_UNKNOWN = 0;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* State for existent recipient.
|
64 |
+
*
|
65 |
+
* @var int
|
66 |
+
*/
|
67 |
+
const RECIPIENT_STATE_EXISTENT = 1;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* State for non existing (deleted) recipient.
|
71 |
+
*
|
72 |
+
* @var int
|
73 |
+
*/
|
74 |
+
const RECIPIENT_STATE_DELETED = 2;
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Returns the category of this inbox message. May be one of:
|
79 |
+
* <ul>
|
80 |
+
* <li><i>CATEGORY_AUTO_RESPONDER</i>
|
81 |
+
* <li><i>CATEGORY_FLAME</i>
|
82 |
+
* <li><i>CATEGORY_SPAM</i>
|
83 |
+
* <li><i>CATEGORY_UNCATEGORIZED</i>
|
84 |
+
* <li><i>CATEGORY_UNKNOWN</i>
|
85 |
+
* </ul>
|
86 |
+
*
|
87 |
+
* @return int the category of this inbox message.
|
88 |
+
*/
|
89 |
+
public function getCategory();
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Returns the date when the message was received.
|
94 |
+
* The date will be returned as ISO 8601 formatted datetime string.
|
95 |
+
*
|
96 |
+
* @return string the date of the message reception.
|
97 |
+
*/
|
98 |
+
public function getReceptionDate();
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Returns the sender address.
|
103 |
+
*
|
104 |
+
* @return string the sender address as string.
|
105 |
+
*/
|
106 |
+
public function getSender();
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Returns the subject of the received message.
|
111 |
+
*
|
112 |
+
* @return string the subject of the received message as string.
|
113 |
+
*/
|
114 |
+
public function getSubject();
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Returns the message content as text.
|
119 |
+
*
|
120 |
+
* @return string the message as string.
|
121 |
+
*/
|
122 |
+
public function getTextContent();
|
123 |
+
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Returns the id of the recipient who sent the message.
|
127 |
+
*
|
128 |
+
* @return int the recipient id.
|
129 |
+
*/
|
130 |
+
public function getRecipientId();
|
131 |
+
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Returns the header of the message as string.
|
135 |
+
*
|
136 |
+
* @return string the header of the message as string.
|
137 |
+
*/
|
138 |
+
public function getHeaders();
|
139 |
+
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Returns the complete message as mime message stream.
|
143 |
+
*
|
144 |
+
* @return Inx_Api_InputStream the mime message as input stream.
|
145 |
+
*/
|
146 |
+
public function getMIMEMessageAsStream();
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Returns the matched e-mail address (i.e. the e-mail address of the recipient).
|
151 |
+
*
|
152 |
+
* @return string the e-mail address.
|
153 |
+
*/
|
154 |
+
public function getMatchedEmailAddress();
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Returns the state of the recipient for the message.<br>
|
159 |
+
* RecipientState values:
|
160 |
+
* <ul>
|
161 |
+
* <li><i>RECIPIENT_STATE_UNKNOWN</i> - no attributes are queried or recipient is unknown.
|
162 |
+
* <li><i>RECIPIENT_STATE_EXISTENT</i> - recipient exists.
|
163 |
+
* <li><i>RECIPIENT_STATE_DELETED</i> - recipient is deleted.
|
164 |
+
* </ul>
|
165 |
+
*
|
166 |
+
* @return int the recipient state.
|
167 |
+
*/
|
168 |
+
public function getRecipientState();
|
169 |
+
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Returns the integer value for the given recipient Attribute.<br>
|
173 |
+
*
|
174 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
175 |
+
* @return int the integer value.
|
176 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
177 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>int</i>.
|
178 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
179 |
+
*/
|
180 |
+
public function getInteger( Inx_Api_Recipient_Attribute $oAttribute );
|
181 |
+
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Returns the string value for the given recipient Attribute.<br>
|
185 |
+
*
|
186 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
187 |
+
* @return string the string value.
|
188 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
189 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>string</i>.
|
190 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
191 |
+
*/
|
192 |
+
public function getString( Inx_Api_Recipient_Attribute $oAttribute );
|
193 |
+
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Returns the datetime value for the given recipient Attribute.
|
197 |
+
* The datetime will be returned as ISO 8601 formatted datetime string.
|
198 |
+
*
|
199 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
200 |
+
* @return string the datetime value.
|
201 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
202 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>datetime</i>.
|
203 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
204 |
+
*/
|
205 |
+
public function getDatetime( Inx_Api_Recipient_Attribute $oAttribute );
|
206 |
+
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Returns the date value for the given recipient Attribute.
|
210 |
+
* The date will be returned as ISO 8601 formatted date string.
|
211 |
+
*
|
212 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
213 |
+
* @return string the date value.
|
214 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
215 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>date</i>.
|
216 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
217 |
+
*/
|
218 |
+
public function getDate( Inx_Api_Recipient_Attribute $oAttribute );
|
219 |
+
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Returns the time value for the given recipient Attribute.
|
223 |
+
* The time will be returned as ISO 8601 formatted time string
|
224 |
+
*
|
225 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
226 |
+
* @return string the time value.
|
227 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
228 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>time</i>.
|
229 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
230 |
+
*/
|
231 |
+
public function getTime( Inx_Api_Recipient_Attribute $oAttribute );
|
232 |
+
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Returns the float value for the given recipient Attribute.<br>
|
236 |
+
*
|
237 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
238 |
+
* @return float the float value.
|
239 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
240 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>float</i>.
|
241 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
242 |
+
*/
|
243 |
+
public function getDouble( Inx_Api_Recipient_Attribute $oAttribute );
|
244 |
+
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Returns the bool value for the given recipient Attribute.<br>
|
248 |
+
*
|
249 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
250 |
+
* @return bool the bool value.
|
251 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
252 |
+
* @throws Inx_Api_IllegalStateException if the requested attribute is not of type <i>bool</i>.
|
253 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
254 |
+
*/
|
255 |
+
public function getBoolean( Inx_Api_Recipient_Attribute $oAttribute );
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Returns the value for the given recipient Attribute.<br>
|
260 |
+
*
|
261 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the recipient attribute to be retrieved.
|
262 |
+
* @return mixed the value.
|
263 |
+
* @throws Inx_Api_IllegalArgumentException if the requested attribute was not fetched.
|
264 |
+
* @throws Inx_Api_UnknownRecipientException if the recipient state is unknown.
|
265 |
+
*/
|
266 |
+
public function getObject( Inx_Api_Recipient_Attribute $oAttribute );
|
267 |
+
|
268 |
}
|
lib/Inx/Api/IndexOutOfBoundsException.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_IndexOutOfBoundsException</i> is thrown when trying to access an invalid index of an
|
7 |
-
* indexed object. This applies mainly to the various RowSets and ResultSets used in the API.
|
8 |
-
* <p>
|
9 |
-
* Example:
|
10 |
-
* <pre>
|
11 |
-
* $rset = Inx_Api_Mailing_MailingManager->selectAll();
|
12 |
-
*
|
13 |
-
* for($i = -1; $i <= rest->size(); $i++)
|
14 |
-
* {
|
15 |
-
* echo $rset->get($i)->getName();
|
16 |
-
* }
|
17 |
-
* </pre>
|
18 |
-
* This code snippet contains two errors: The first index retrieved is -1 and the last index retrieved is
|
19 |
-
* rset->size(). -1 is no valid index as the first element of a ResultSet has the index 0. As the first
|
20 |
-
* valid index is 0, the last valid index is rset->size() - 1. Therefore, these errors will raise an
|
21 |
-
* <i>Inx_Api_IndexOutOfBoundsException</i>.
|
22 |
-
* @package Inxmail
|
23 |
-
*/
|
24 |
-
class Inx_Api_IndexOutOfBoundsException extends Exception
|
25 |
-
{
|
26 |
-
|
27 |
-
}
|
28 |
-
|
29 |
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_IndexOutOfBoundsException</i> is thrown when trying to access an invalid index of an
|
7 |
+
* indexed object. This applies mainly to the various RowSets and ResultSets used in the API.
|
8 |
+
* <p>
|
9 |
+
* Example:
|
10 |
+
* <pre>
|
11 |
+
* $rset = Inx_Api_Mailing_MailingManager->selectAll();
|
12 |
+
*
|
13 |
+
* for($i = -1; $i <= rest->size(); $i++)
|
14 |
+
* {
|
15 |
+
* echo $rset->get($i)->getName();
|
16 |
+
* }
|
17 |
+
* </pre>
|
18 |
+
* This code snippet contains two errors: The first index retrieved is -1 and the last index retrieved is
|
19 |
+
* rset->size(). -1 is no valid index as the first element of a ResultSet has the index 0. As the first
|
20 |
+
* valid index is 0, the last valid index is rset->size() - 1. Therefore, these errors will raise an
|
21 |
+
* <i>Inx_Api_IndexOutOfBoundsException</i>.
|
22 |
+
* @package Inxmail
|
23 |
+
*/
|
24 |
+
class Inx_Api_IndexOutOfBoundsException extends Exception
|
25 |
+
{
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
?>
|
lib/Inx/Api/IndexSelection.php
CHANGED
@@ -1,100 +1,100 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* This class represents the current state of a selection. It encapsulates a single selection interval.
|
7 |
-
*
|
8 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
9 |
-
* @package Inxmail
|
10 |
-
*/
|
11 |
-
class Inx_Api_IndexSelection
|
12 |
-
{
|
13 |
-
private $iBeginIndex;
|
14 |
-
|
15 |
-
private $iEndIndex;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Creates a selection.
|
19 |
-
* If $iBeginIndex and $iEndIndex are omitted, this will create an empty selection.
|
20 |
-
* If only $iEndIndex is omitted, the selection will contain only $iEndIndex.
|
21 |
-
* If both parameters are set, the selection will contain the set of indices between $iBeginIndex
|
22 |
-
* and $iEndIndex inclusive.
|
23 |
-
*
|
24 |
-
* @param int $iBeginIndex one end of the interval, may be omitted.
|
25 |
-
* @param int $iEndIndex other ent of the interval (inclusive), may be omitted.
|
26 |
-
*/
|
27 |
-
public function __construct($iBeginIndex = null, $iEndIndex = null)
|
28 |
-
{
|
29 |
-
if ($iBeginIndex===null && $iEndIndex===null) {
|
30 |
-
$this->iBeginIndex = -1;
|
31 |
-
$this->iEndIndex = -1;
|
32 |
-
} elseif($iBeginIndex!==null && $iEndIndex===null){
|
33 |
-
$this->setSelectionInterval( $iBeginIndex );
|
34 |
-
} elseif($iBeginIndex!==null && $iEndIndex!==null){
|
35 |
-
$this->setSelectionInterval( $iBeginIndex, $iEndIndex );
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Change the selection to be the set of indices between $iBeginIndex and $iEndIndex inclusive.
|
42 |
-
* $iEndIndex may be omitted, thus changing the selection to only contain $iBeginIndex.
|
43 |
-
*
|
44 |
-
* @param int $iBeginIndex one end of the interval.
|
45 |
-
* @param int $iEndIndex other end of the interval (inclusive), may be omitted.
|
46 |
-
*/
|
47 |
-
public function setSelectionInterval( $iBeginIndex = null, $iEndIndex = null )
|
48 |
-
{
|
49 |
-
if( $iBeginIndex < 0 || $iEndIndex < 0 ) {
|
50 |
-
throw new Exception( "Indices must be positive" );
|
51 |
-
}
|
52 |
-
if($iEndIndex===null) {
|
53 |
-
$iEndIndex = $iBeginIndex;
|
54 |
-
}
|
55 |
-
if( $iBeginIndex > $iEndIndex) {
|
56 |
-
$this->iBeginIndex = $iEndIndex;
|
57 |
-
$this->iEndIndex = $iBeginIndex;
|
58 |
-
} else {
|
59 |
-
$this->iBeginIndex = $iBeginIndex;
|
60 |
-
$this->iEndIndex = $iEndIndex;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Returns the number of selected elements.
|
67 |
-
*
|
68 |
-
* @return int the number of selected elements
|
69 |
-
*/
|
70 |
-
public function getSelectionCount()
|
71 |
-
{
|
72 |
-
if( $this->iBeginIndex == -1 )
|
73 |
-
return 0;
|
74 |
-
|
75 |
-
return $this->iEndIndex - $this->iBeginIndex + 1;
|
76 |
-
}
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Returns the first selected index or -1 if the selection is empty.
|
81 |
-
*
|
82 |
-
* @return int the first selected index
|
83 |
-
*/
|
84 |
-
public function getFirstIndex()
|
85 |
-
{
|
86 |
-
return $this->iBeginIndex;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Returns the last selected index or -1 if the selection is empty.
|
92 |
-
*
|
93 |
-
* @return int the last selected index
|
94 |
-
*/
|
95 |
-
public function getLastIndex()
|
96 |
-
{
|
97 |
-
return $this->iEndIndex;
|
98 |
-
}
|
99 |
-
|
100 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* This class represents the current state of a selection. It encapsulates a single selection interval.
|
7 |
+
*
|
8 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
9 |
+
* @package Inxmail
|
10 |
+
*/
|
11 |
+
class Inx_Api_IndexSelection
|
12 |
+
{
|
13 |
+
private $iBeginIndex;
|
14 |
+
|
15 |
+
private $iEndIndex;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Creates a selection.
|
19 |
+
* If $iBeginIndex and $iEndIndex are omitted, this will create an empty selection.
|
20 |
+
* If only $iEndIndex is omitted, the selection will contain only $iEndIndex.
|
21 |
+
* If both parameters are set, the selection will contain the set of indices between $iBeginIndex
|
22 |
+
* and $iEndIndex inclusive.
|
23 |
+
*
|
24 |
+
* @param int $iBeginIndex one end of the interval, may be omitted.
|
25 |
+
* @param int $iEndIndex other ent of the interval (inclusive), may be omitted.
|
26 |
+
*/
|
27 |
+
public function __construct($iBeginIndex = null, $iEndIndex = null)
|
28 |
+
{
|
29 |
+
if ($iBeginIndex===null && $iEndIndex===null) {
|
30 |
+
$this->iBeginIndex = -1;
|
31 |
+
$this->iEndIndex = -1;
|
32 |
+
} elseif($iBeginIndex!==null && $iEndIndex===null){
|
33 |
+
$this->setSelectionInterval( $iBeginIndex );
|
34 |
+
} elseif($iBeginIndex!==null && $iEndIndex!==null){
|
35 |
+
$this->setSelectionInterval( $iBeginIndex, $iEndIndex );
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Change the selection to be the set of indices between $iBeginIndex and $iEndIndex inclusive.
|
42 |
+
* $iEndIndex may be omitted, thus changing the selection to only contain $iBeginIndex.
|
43 |
+
*
|
44 |
+
* @param int $iBeginIndex one end of the interval.
|
45 |
+
* @param int $iEndIndex other end of the interval (inclusive), may be omitted.
|
46 |
+
*/
|
47 |
+
public function setSelectionInterval( $iBeginIndex = null, $iEndIndex = null )
|
48 |
+
{
|
49 |
+
if( $iBeginIndex < 0 || $iEndIndex < 0 ) {
|
50 |
+
throw new Exception( "Indices must be positive" );
|
51 |
+
}
|
52 |
+
if($iEndIndex===null) {
|
53 |
+
$iEndIndex = $iBeginIndex;
|
54 |
+
}
|
55 |
+
if( $iBeginIndex > $iEndIndex) {
|
56 |
+
$this->iBeginIndex = $iEndIndex;
|
57 |
+
$this->iEndIndex = $iBeginIndex;
|
58 |
+
} else {
|
59 |
+
$this->iBeginIndex = $iBeginIndex;
|
60 |
+
$this->iEndIndex = $iEndIndex;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns the number of selected elements.
|
67 |
+
*
|
68 |
+
* @return int the number of selected elements
|
69 |
+
*/
|
70 |
+
public function getSelectionCount()
|
71 |
+
{
|
72 |
+
if( $this->iBeginIndex == -1 )
|
73 |
+
return 0;
|
74 |
+
|
75 |
+
return $this->iEndIndex - $this->iBeginIndex + 1;
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Returns the first selected index or -1 if the selection is empty.
|
81 |
+
*
|
82 |
+
* @return int the first selected index
|
83 |
+
*/
|
84 |
+
public function getFirstIndex()
|
85 |
+
{
|
86 |
+
return $this->iBeginIndex;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Returns the last selected index or -1 if the selection is empty.
|
92 |
+
*
|
93 |
+
* @return int the last selected index
|
94 |
+
*/
|
95 |
+
public function getLastIndex()
|
96 |
+
{
|
97 |
+
return $this->iEndIndex;
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
lib/Inx/Api/InputStream.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* This abstract class is the superclass of all classes representing an input stream of bytes.
|
7 |
-
* Subclasses of InputStream must always provide a method that returns the next byte of input as well as a method
|
8 |
-
* used to close the stream.
|
9 |
-
*
|
10 |
-
* @package Inxmail
|
11 |
-
*/
|
12 |
-
abstract class Inx_Api_InputStream
|
13 |
-
{
|
14 |
-
abstract public function read();
|
15 |
-
abstract public function close();
|
16 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* This abstract class is the superclass of all classes representing an input stream of bytes.
|
7 |
+
* Subclasses of InputStream must always provide a method that returns the next byte of input as well as a method
|
8 |
+
* used to close the stream.
|
9 |
+
*
|
10 |
+
* @package Inxmail
|
11 |
+
*/
|
12 |
+
abstract class Inx_Api_InputStream
|
13 |
+
{
|
14 |
+
abstract public function read();
|
15 |
+
abstract public function close();
|
16 |
}
|
lib/Inx/Api/List/AdminListContext.php
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_List_AdminListContext</i> does not represent a usual mailing list.
|
8 |
-
* Mail server and user credentials, along with other administrative properties, can be defined in the administration list.
|
9 |
-
* <p>
|
10 |
-
* <b>At the moment the <i>Inx_Api_List_AdminListContext</i> has no functionality.</b>
|
11 |
-
*
|
12 |
-
* @since API 1.0
|
13 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage List
|
16 |
-
*/
|
17 |
-
interface Inx_Api_List_AdminListContext extends Inx_Api_List_ListContext
|
18 |
-
{
|
19 |
-
|
20 |
-
/**
|
21 |
-
* The predefined, immutable name of the administration list.
|
22 |
-
*/
|
23 |
-
const NAME = "administration";
|
24 |
-
|
25 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_List_AdminListContext</i> does not represent a usual mailing list.
|
8 |
+
* Mail server and user credentials, along with other administrative properties, can be defined in the administration list.
|
9 |
+
* <p>
|
10 |
+
* <b>At the moment the <i>Inx_Api_List_AdminListContext</i> has no functionality.</b>
|
11 |
+
*
|
12 |
+
* @since API 1.0
|
13 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage List
|
16 |
+
*/
|
17 |
+
interface Inx_Api_List_AdminListContext extends Inx_Api_List_ListContext
|
18 |
+
{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The predefined, immutable name of the administration list.
|
22 |
+
*/
|
23 |
+
const NAME = "administration";
|
24 |
+
|
25 |
+
}
|
lib/Inx/Api/List/FilterListContext.php
CHANGED
@@ -1,59 +1,59 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_List_FilterListContext</i> represents a mailing list with no permanent recipients.
|
8 |
-
* The recipients of a filter list are computed based on a filter.
|
9 |
-
* All recipients that match that filter are recipients of the filter list.
|
10 |
-
* The recipients are computed each time a mailing is sent.
|
11 |
-
* <p>
|
12 |
-
* For a detailed description of the filter statement syntax, see the documentation of
|
13 |
-
* <i>Inx_Api_Filter_Filter->updateStatement(String)</i>;
|
14 |
-
*
|
15 |
-
* @see Inx_Api_Filter_Filter::updateStatement(String)
|
16 |
-
* @since API 1.0
|
17 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
18 |
-
* @package Inxmail
|
19 |
-
* @subpackage List
|
20 |
-
*/
|
21 |
-
interface Inx_Api_List_FilterListContext extends Inx_Api_List_ListContext
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Constant for the filter statement attribute.
|
25 |
-
* Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
26 |
-
*
|
27 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
28 |
-
*/
|
29 |
-
const ATTRIBUTE_FILTER_STMT = 4;
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Changes the list name.
|
34 |
-
* The list will not be updated on the server until <i>commitUpdate()</i> has been called.
|
35 |
-
*
|
36 |
-
* @param string $sName the new list name.
|
37 |
-
*/
|
38 |
-
public function updateName( $sName );
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Returns the filter statement.
|
43 |
-
*
|
44 |
-
* @return string the filter statement.
|
45 |
-
*/
|
46 |
-
public function getFilterStmt();
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Changes the filter statement. The list will not be updated on server until <i>commitUpdate()</i> has been called.
|
51 |
-
* For a detailed description of the filter statement syntax, see the documentation of
|
52 |
-
* <i>Inx_Api_Filter_Filter->updateStatement(String)</i>
|
53 |
-
*
|
54 |
-
* @param string $sFilterStmt the new filter statement.
|
55 |
-
* @see Inx_Api_Filter_Filter::updateStatement(String)
|
56 |
-
*/
|
57 |
-
public function updateFilterStmt( $sFilterStmt );
|
58 |
-
|
59 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_List_FilterListContext</i> represents a mailing list with no permanent recipients.
|
8 |
+
* The recipients of a filter list are computed based on a filter.
|
9 |
+
* All recipients that match that filter are recipients of the filter list.
|
10 |
+
* The recipients are computed each time a mailing is sent.
|
11 |
+
* <p>
|
12 |
+
* For a detailed description of the filter statement syntax, see the documentation of
|
13 |
+
* <i>Inx_Api_Filter_Filter->updateStatement(String)</i>;
|
14 |
+
*
|
15 |
+
* @see Inx_Api_Filter_Filter::updateStatement(String)
|
16 |
+
* @since API 1.0
|
17 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
18 |
+
* @package Inxmail
|
19 |
+
* @subpackage List
|
20 |
+
*/
|
21 |
+
interface Inx_Api_List_FilterListContext extends Inx_Api_List_ListContext
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Constant for the filter statement attribute.
|
25 |
+
* Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
26 |
+
*
|
27 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
28 |
+
*/
|
29 |
+
const ATTRIBUTE_FILTER_STMT = 4;
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Changes the list name.
|
34 |
+
* The list will not be updated on the server until <i>commitUpdate()</i> has been called.
|
35 |
+
*
|
36 |
+
* @param string $sName the new list name.
|
37 |
+
*/
|
38 |
+
public function updateName( $sName );
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Returns the filter statement.
|
43 |
+
*
|
44 |
+
* @return string the filter statement.
|
45 |
+
*/
|
46 |
+
public function getFilterStmt();
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Changes the filter statement. The list will not be updated on server until <i>commitUpdate()</i> has been called.
|
51 |
+
* For a detailed description of the filter statement syntax, see the documentation of
|
52 |
+
* <i>Inx_Api_Filter_Filter->updateStatement(String)</i>
|
53 |
+
*
|
54 |
+
* @param string $sFilterStmt the new filter statement.
|
55 |
+
* @see Inx_Api_Filter_Filter::updateStatement(String)
|
56 |
+
*/
|
57 |
+
public function updateFilterStmt( $sFilterStmt );
|
58 |
+
|
59 |
+
}
|
lib/Inx/Api/List/ListContext.php
CHANGED
@@ -1,166 +1,166 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_List_ListContext</i> corresponds to a list in Inxmail, like a mailing list or the system list.
|
8 |
-
* The <i>Inx_Api_List_ListContextManager</i> is used to access and manipulate these lists.
|
9 |
-
* <p>
|
10 |
-
* A list is, in simple terms, a set of recipients for which mailings can be created.
|
11 |
-
* A list may offer various features (corresponding to agents in inxmail) which can be used to perform tasks like
|
12 |
-
* subscription management, creating text modules, generating reports, etc.
|
13 |
-
* <p>
|
14 |
-
* The available features can be determined from the <i>Inx_Api_Features<i> interface.
|
15 |
-
* Using the constants defined in that interface, you can enable or disable features.
|
16 |
-
* The following snippet enables the subscription feature, if it is not already enabled:
|
17 |
-
*
|
18 |
-
* <pre>
|
19 |
-
* $oListContext = ...
|
20 |
-
*
|
21 |
-
* if(!$oListContext->isFeatureEnabled(Inx_Api_Features::SUBSCRIPTION_FEATURE_ID))
|
22 |
-
* {
|
23 |
-
* $oListContext->enableFeature(Inx_Api_Features::SUBSCRIPTION_FEATURE_ID);
|
24 |
-
* }
|
25 |
-
* </pre>
|
26 |
-
*
|
27 |
-
* Be aware that not all features can be enabled for all lists.
|
28 |
-
* Which features can be enabled for which lists is also documented in the <i>Inx_Api_Features</i> interface.
|
29 |
-
* <p>
|
30 |
-
* An <i>Inx_Api_List_ListContext</i> can also be used to retrieve the list properties using the
|
31 |
-
* <i>findProperty($sPropertyName)</i> and <i>selectProperties()</i> methods.
|
32 |
-
* These properties define the behaviour of the list.
|
33 |
-
* For more information on properties, see the <i>Inx_Api_Property_Property</i> documentation.
|
34 |
-
* <p>
|
35 |
-
* For an example on how to create and retrieve lists, see the <i>Inx_Api_List_ListContextManager</i> documentation.
|
36 |
-
*
|
37 |
-
* @see Inx_Api_List_ListContextManager
|
38 |
-
* @see Inx_Api_Features
|
39 |
-
* @see Inx_Api_Property_Property
|
40 |
-
* @since API 1.0
|
41 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
42 |
-
* @package Inxmail
|
43 |
-
* @subpackage List
|
44 |
-
*/
|
45 |
-
interface Inx_Api_List_ListContext extends Inx_Api_BusinessObject
|
46 |
-
{
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Constant for the name attribute. Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
50 |
-
*
|
51 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
52 |
-
*/
|
53 |
-
const ATTRIBUTE_NAME = 1;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Constant for the description attribute. Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
57 |
-
*
|
58 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
59 |
-
*/
|
60 |
-
const ATTRIBUTE_DESCRIPTION = 2;
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Returns the list name. The list names are unique, while the characters are case insensitive. <br>
|
65 |
-
* The names of the system and administration lists are predefined and immutable.
|
66 |
-
*
|
67 |
-
* @see Inx_Api_List_SystemListContext::NAME
|
68 |
-
* @see Inx_Api_List_AdminListContext::NAME
|
69 |
-
* @return string the list name
|
70 |
-
*/
|
71 |
-
public function getName();
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Returns the list description.
|
76 |
-
*
|
77 |
-
* @return string the list description
|
78 |
-
*/
|
79 |
-
public function getDescription();
|
80 |
-
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Returns the creation datetime.
|
84 |
-
*
|
85 |
-
* @return string the creation datetime. The creation datetime is returned as ISO 8601 formatted datetime string.
|
86 |
-
*/
|
87 |
-
public function getCreationDatetime();
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Changes the list description.
|
92 |
-
*
|
93 |
-
* @param string $sDesc the new list description.
|
94 |
-
*/
|
95 |
-
public function updateDescription( $sDesc );
|
96 |
-
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Returns the property identified by the specified name.
|
100 |
-
*
|
101 |
-
* @param string $sPropertyName the name of the property to be retrieved.
|
102 |
-
* @return Inx_Api_Property_Property the property identified by the specified name.
|
103 |
-
* @throws Inx_Api_IllegalArgumentException if the property name is unknown.
|
104 |
-
* @see Inx_Api_Property_PropertyNames
|
105 |
-
*/
|
106 |
-
public function findProperty( $sPropertyName );
|
107 |
-
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Returns an <i>Inx_Api_BOResultSet</i> containing all properties of this list.
|
111 |
-
*
|
112 |
-
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all properties of this list
|
113 |
-
* @see Inx_Api_Property_Property
|
114 |
-
*/
|
115 |
-
public function selectProperties();
|
116 |
-
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Checks if the specified feature is enabled.
|
120 |
-
*
|
121 |
-
* @param int $iFeatureId the id of the feature to check.
|
122 |
-
* @return bool <i>true</i>, if the feature is enabled, <i>false</i> otherwise.
|
123 |
-
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
124 |
-
* @see Inx_Api_Features
|
125 |
-
*/
|
126 |
-
public function isFeatureEnabled( $iFeatureId );
|
127 |
-
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Enables the feature with the given id. Not every feature is accessible for every type of list.
|
131 |
-
* For example, the "Subscription" feature is available in standard lists, only.
|
132 |
-
* The "Mailing" feature can be used in standard and filter lists.
|
133 |
-
*
|
134 |
-
* @param int $iFeatureId the id of the feature to enable.
|
135 |
-
* @return bool <i>true</i>, if the feature has been enabled, <i>false</i>, if the feature was already enabled.
|
136 |
-
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
137 |
-
* @see Inx_Api_Features
|
138 |
-
*/
|
139 |
-
public function enableFeature( $iFeatureId );
|
140 |
-
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Disables the feature with the given id.
|
144 |
-
*
|
145 |
-
* @param int $iFeatureId the id of the feature to disable.
|
146 |
-
* @return bool <i>true</i>, if the feature has been disabled, <i>false</i>, if the feature was already disabled.
|
147 |
-
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
148 |
-
* @see Inx_Api_Features
|
149 |
-
*/
|
150 |
-
public function disableFeature( $iFeatureId );
|
151 |
-
|
152 |
-
|
153 |
-
/**
|
154 |
-
* Returns the number of recipients that are subscribed to the list. This method can return the actual list size if
|
155 |
-
* the parameter is true. Note: Refreshing the list size can produce a high load on the Inxmail Server. USE THIS
|
156 |
-
* METHOD WITH CAUTION!
|
157 |
-
*
|
158 |
-
* @param bool $computeNow <code>true</code> if the number of recipients shall be recomputed, <code>false</code>
|
159 |
-
* otherwise. May be ommitted (defaults to <i>false</i>).
|
160 |
-
* @return Inx_Api_List_ListSize the list size object.
|
161 |
-
* @throws Inx_Api_DataException if the list is deleted.
|
162 |
-
*/
|
163 |
-
public function getListSize( $computeNow=false );
|
164 |
-
|
165 |
-
}
|
166 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_List_ListContext</i> corresponds to a list in Inxmail, like a mailing list or the system list.
|
8 |
+
* The <i>Inx_Api_List_ListContextManager</i> is used to access and manipulate these lists.
|
9 |
+
* <p>
|
10 |
+
* A list is, in simple terms, a set of recipients for which mailings can be created.
|
11 |
+
* A list may offer various features (corresponding to agents in inxmail) which can be used to perform tasks like
|
12 |
+
* subscription management, creating text modules, generating reports, etc.
|
13 |
+
* <p>
|
14 |
+
* The available features can be determined from the <i>Inx_Api_Features<i> interface.
|
15 |
+
* Using the constants defined in that interface, you can enable or disable features.
|
16 |
+
* The following snippet enables the subscription feature, if it is not already enabled:
|
17 |
+
*
|
18 |
+
* <pre>
|
19 |
+
* $oListContext = ...
|
20 |
+
*
|
21 |
+
* if(!$oListContext->isFeatureEnabled(Inx_Api_Features::SUBSCRIPTION_FEATURE_ID))
|
22 |
+
* {
|
23 |
+
* $oListContext->enableFeature(Inx_Api_Features::SUBSCRIPTION_FEATURE_ID);
|
24 |
+
* }
|
25 |
+
* </pre>
|
26 |
+
*
|
27 |
+
* Be aware that not all features can be enabled for all lists.
|
28 |
+
* Which features can be enabled for which lists is also documented in the <i>Inx_Api_Features</i> interface.
|
29 |
+
* <p>
|
30 |
+
* An <i>Inx_Api_List_ListContext</i> can also be used to retrieve the list properties using the
|
31 |
+
* <i>findProperty($sPropertyName)</i> and <i>selectProperties()</i> methods.
|
32 |
+
* These properties define the behaviour of the list.
|
33 |
+
* For more information on properties, see the <i>Inx_Api_Property_Property</i> documentation.
|
34 |
+
* <p>
|
35 |
+
* For an example on how to create and retrieve lists, see the <i>Inx_Api_List_ListContextManager</i> documentation.
|
36 |
+
*
|
37 |
+
* @see Inx_Api_List_ListContextManager
|
38 |
+
* @see Inx_Api_Features
|
39 |
+
* @see Inx_Api_Property_Property
|
40 |
+
* @since API 1.0
|
41 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
42 |
+
* @package Inxmail
|
43 |
+
* @subpackage List
|
44 |
+
*/
|
45 |
+
interface Inx_Api_List_ListContext extends Inx_Api_BusinessObject
|
46 |
+
{
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Constant for the name attribute. Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
50 |
+
*
|
51 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
52 |
+
*/
|
53 |
+
const ATTRIBUTE_NAME = 1;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Constant for the description attribute. Used by the <i>Inx_Api_UpdateException</i> to indicate the error source.
|
57 |
+
*
|
58 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
59 |
+
*/
|
60 |
+
const ATTRIBUTE_DESCRIPTION = 2;
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Returns the list name. The list names are unique, while the characters are case insensitive. <br>
|
65 |
+
* The names of the system and administration lists are predefined and immutable.
|
66 |
+
*
|
67 |
+
* @see Inx_Api_List_SystemListContext::NAME
|
68 |
+
* @see Inx_Api_List_AdminListContext::NAME
|
69 |
+
* @return string the list name
|
70 |
+
*/
|
71 |
+
public function getName();
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Returns the list description.
|
76 |
+
*
|
77 |
+
* @return string the list description
|
78 |
+
*/
|
79 |
+
public function getDescription();
|
80 |
+
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Returns the creation datetime.
|
84 |
+
*
|
85 |
+
* @return string the creation datetime. The creation datetime is returned as ISO 8601 formatted datetime string.
|
86 |
+
*/
|
87 |
+
public function getCreationDatetime();
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Changes the list description.
|
92 |
+
*
|
93 |
+
* @param string $sDesc the new list description.
|
94 |
+
*/
|
95 |
+
public function updateDescription( $sDesc );
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Returns the property identified by the specified name.
|
100 |
+
*
|
101 |
+
* @param string $sPropertyName the name of the property to be retrieved.
|
102 |
+
* @return Inx_Api_Property_Property the property identified by the specified name.
|
103 |
+
* @throws Inx_Api_IllegalArgumentException if the property name is unknown.
|
104 |
+
* @see Inx_Api_Property_PropertyNames
|
105 |
+
*/
|
106 |
+
public function findProperty( $sPropertyName );
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Returns an <i>Inx_Api_BOResultSet</i> containing all properties of this list.
|
111 |
+
*
|
112 |
+
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all properties of this list
|
113 |
+
* @see Inx_Api_Property_Property
|
114 |
+
*/
|
115 |
+
public function selectProperties();
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Checks if the specified feature is enabled.
|
120 |
+
*
|
121 |
+
* @param int $iFeatureId the id of the feature to check.
|
122 |
+
* @return bool <i>true</i>, if the feature is enabled, <i>false</i> otherwise.
|
123 |
+
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
124 |
+
* @see Inx_Api_Features
|
125 |
+
*/
|
126 |
+
public function isFeatureEnabled( $iFeatureId );
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Enables the feature with the given id. Not every feature is accessible for every type of list.
|
131 |
+
* For example, the "Subscription" feature is available in standard lists, only.
|
132 |
+
* The "Mailing" feature can be used in standard and filter lists.
|
133 |
+
*
|
134 |
+
* @param int $iFeatureId the id of the feature to enable.
|
135 |
+
* @return bool <i>true</i>, if the feature has been enabled, <i>false</i>, if the feature was already enabled.
|
136 |
+
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
137 |
+
* @see Inx_Api_Features
|
138 |
+
*/
|
139 |
+
public function enableFeature( $iFeatureId );
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Disables the feature with the given id.
|
144 |
+
*
|
145 |
+
* @param int $iFeatureId the id of the feature to disable.
|
146 |
+
* @return bool <i>true</i>, if the feature has been disabled, <i>false</i>, if the feature was already disabled.
|
147 |
+
* @throws Inx_Api_FeatureNotAvailableException if the feature is not available for this list.
|
148 |
+
* @see Inx_Api_Features
|
149 |
+
*/
|
150 |
+
public function disableFeature( $iFeatureId );
|
151 |
+
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Returns the number of recipients that are subscribed to the list. This method can return the actual list size if
|
155 |
+
* the parameter is true. Note: Refreshing the list size can produce a high load on the Inxmail Server. USE THIS
|
156 |
+
* METHOD WITH CAUTION!
|
157 |
+
*
|
158 |
+
* @param bool $computeNow <code>true</code> if the number of recipients shall be recomputed, <code>false</code>
|
159 |
+
* otherwise. May be ommitted (defaults to <i>false</i>).
|
160 |
+
* @return Inx_Api_List_ListSize the list size object.
|
161 |
+
* @throws Inx_Api_DataException if the list is deleted.
|
162 |
+
*/
|
163 |
+
public function getListSize( $computeNow=false );
|
164 |
+
|
165 |
+
}
|
166 |
+
|
lib/Inx/Api/List/ListContextManager.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_List_ListContext</i> corresponds to a list in Inxmail, like a mailing list or the system list.
|
8 |
-
* The <i>Inx_Api_List_ListContextManager</i> is used to access and manipulate these lists.
|
9 |
-
* <p>
|
10 |
-
* There are four different types of lists:
|
11 |
-
* <ul>
|
12 |
-
* <li>Standard lists: <i>Inx_Api_List_StandardListContext</i>
|
13 |
-
* <li>Filter lists: <i>Inx_Api_List_FilterListContext</i>
|
14 |
-
* <li>The system list: <i>Inx_Api_List_SystemListContext</i>
|
15 |
-
* <li>The administration list: <i>Inx_Api_List_AdminListContext</i>
|
16 |
-
* </ul>
|
17 |
-
* New mailing lists are created using <i>createStandardList()</i> or <i>createFilterList()</i>.
|
18 |
-
* <p>
|
19 |
-
* The following snippet creates a new standard mailing list:
|
20 |
-
*
|
21 |
-
* <PRE>
|
22 |
-
* $oListContextManager = $session->getListContextManager();
|
23 |
-
* $oStandardListContext = $oListContextManager->createStandardList();
|
24 |
-
* $oStandardListContext->updateName( "New List" );
|
25 |
-
* $oStandardListContext->commitUpdate();
|
26 |
-
* </PRE>
|
27 |
-
*
|
28 |
-
* Special lists, like the system or administration list, can be retrieved using the <i>findByName($sName)</i> method.
|
29 |
-
* Both, <i>Inx_Api_List_SystemListContext</i> and <i>Inx_Api_List_AdminListContext</i> provide a constant with their predefined,
|
30 |
-
* immutable name which can be used to retrieve the list context.
|
31 |
-
* The following snippet illustrates this:
|
32 |
-
*
|
33 |
-
* <PRE>
|
34 |
-
* $oListContextManager = $oSession->getListContextManager();
|
35 |
-
* $systemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
36 |
-
* $adminListContext = $oListContextManager->findByName( Inx_Api_List_AdminListContext::NAME );
|
37 |
-
* </PRE>
|
38 |
-
* <p>
|
39 |
-
* For more information on lists, see the <i>Inx_Api_List_ListContext</i> documentation.
|
40 |
-
*
|
41 |
-
* @see Inx_Api_List_ListContext
|
42 |
-
* @since API 1.0
|
43 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
44 |
-
* @package Inxmail
|
45 |
-
* @subpackage List
|
46 |
-
*/
|
47 |
-
interface Inx_Api_List_ListContextManager extends Inx_Api_BOManager
|
48 |
-
{
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Returns the <i>Inx_Api_List_ListContext</i> with the specified list name.
|
52 |
-
* The list name is case insensitive.
|
53 |
-
*
|
54 |
-
* @param string $sListName the name of the list to find.
|
55 |
-
* @return Inx_Api_List_ListContext the list context, or null if no list can be found.
|
56 |
-
*/
|
57 |
-
public function findByName( $sListName );
|
58 |
-
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Creates an <i>Inx_Api_List_StandardListContext</i> object.
|
62 |
-
* The list will not be created on the server until <i>commitUpdate()</i> has been called.
|
63 |
-
*
|
64 |
-
* @return Inx_Api_List_StandardListContext an <i>Inx_Api_List_StandardListContext</i> object.
|
65 |
-
*/
|
66 |
-
public function createStandardList();
|
67 |
-
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Creates an <i>Inx_Api_List_FilterListContext</i> object.
|
71 |
-
* The list will not be created on the server until <i>commitUpdate()</i> has been called.
|
72 |
-
*
|
73 |
-
* @return Inx_Api_List_FilterListContext an <i>Inx_Api_List_FilterListContext</i> object.
|
74 |
-
*/
|
75 |
-
public function createFilterList();
|
76 |
-
|
77 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_List_ListContext</i> corresponds to a list in Inxmail, like a mailing list or the system list.
|
8 |
+
* The <i>Inx_Api_List_ListContextManager</i> is used to access and manipulate these lists.
|
9 |
+
* <p>
|
10 |
+
* There are four different types of lists:
|
11 |
+
* <ul>
|
12 |
+
* <li>Standard lists: <i>Inx_Api_List_StandardListContext</i>
|
13 |
+
* <li>Filter lists: <i>Inx_Api_List_FilterListContext</i>
|
14 |
+
* <li>The system list: <i>Inx_Api_List_SystemListContext</i>
|
15 |
+
* <li>The administration list: <i>Inx_Api_List_AdminListContext</i>
|
16 |
+
* </ul>
|
17 |
+
* New mailing lists are created using <i>createStandardList()</i> or <i>createFilterList()</i>.
|
18 |
+
* <p>
|
19 |
+
* The following snippet creates a new standard mailing list:
|
20 |
+
*
|
21 |
+
* <PRE>
|
22 |
+
* $oListContextManager = $session->getListContextManager();
|
23 |
+
* $oStandardListContext = $oListContextManager->createStandardList();
|
24 |
+
* $oStandardListContext->updateName( "New List" );
|
25 |
+
* $oStandardListContext->commitUpdate();
|
26 |
+
* </PRE>
|
27 |
+
*
|
28 |
+
* Special lists, like the system or administration list, can be retrieved using the <i>findByName($sName)</i> method.
|
29 |
+
* Both, <i>Inx_Api_List_SystemListContext</i> and <i>Inx_Api_List_AdminListContext</i> provide a constant with their predefined,
|
30 |
+
* immutable name which can be used to retrieve the list context.
|
31 |
+
* The following snippet illustrates this:
|
32 |
+
*
|
33 |
+
* <PRE>
|
34 |
+
* $oListContextManager = $oSession->getListContextManager();
|
35 |
+
* $systemListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
36 |
+
* $adminListContext = $oListContextManager->findByName( Inx_Api_List_AdminListContext::NAME );
|
37 |
+
* </PRE>
|
38 |
+
* <p>
|
39 |
+
* For more information on lists, see the <i>Inx_Api_List_ListContext</i> documentation.
|
40 |
+
*
|
41 |
+
* @see Inx_Api_List_ListContext
|
42 |
+
* @since API 1.0
|
43 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
44 |
+
* @package Inxmail
|
45 |
+
* @subpackage List
|
46 |
+
*/
|
47 |
+
interface Inx_Api_List_ListContextManager extends Inx_Api_BOManager
|
48 |
+
{
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Returns the <i>Inx_Api_List_ListContext</i> with the specified list name.
|
52 |
+
* The list name is case insensitive.
|
53 |
+
*
|
54 |
+
* @param string $sListName the name of the list to find.
|
55 |
+
* @return Inx_Api_List_ListContext the list context, or null if no list can be found.
|
56 |
+
*/
|
57 |
+
public function findByName( $sListName );
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Creates an <i>Inx_Api_List_StandardListContext</i> object.
|
62 |
+
* The list will not be created on the server until <i>commitUpdate()</i> has been called.
|
63 |
+
*
|
64 |
+
* @return Inx_Api_List_StandardListContext an <i>Inx_Api_List_StandardListContext</i> object.
|
65 |
+
*/
|
66 |
+
public function createStandardList();
|
67 |
+
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Creates an <i>Inx_Api_List_FilterListContext</i> object.
|
71 |
+
* The list will not be created on the server until <i>commitUpdate()</i> has been called.
|
72 |
+
*
|
73 |
+
* @return Inx_Api_List_FilterListContext an <i>Inx_Api_List_FilterListContext</i> object.
|
74 |
+
*/
|
75 |
+
public function createFilterList();
|
76 |
+
|
77 |
+
}
|
lib/Inx/Api/List/ListSize.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_List_ListSize</i> object contains the list size and the computation date of the size.
|
8 |
-
*
|
9 |
-
* @since API 1.4.3
|
10 |
-
* @package Inxmail
|
11 |
-
* @subpackage List
|
12 |
-
*/
|
13 |
-
interface Inx_Api_List_ListSize
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Returns the number of recipients that are subscribed to the list.
|
17 |
-
*
|
18 |
-
* @return int the list size as integer.
|
19 |
-
*/
|
20 |
-
public function getSize();
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Returns the creation datetime when the list size was computed.
|
24 |
-
*
|
25 |
-
* @return the creation datetime as ISO 8601 formatted datetime string.
|
26 |
-
*/
|
27 |
-
public function getCreationDate();
|
28 |
-
}
|
29 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_List_ListSize</i> object contains the list size and the computation date of the size.
|
8 |
+
*
|
9 |
+
* @since API 1.4.3
|
10 |
+
* @package Inxmail
|
11 |
+
* @subpackage List
|
12 |
+
*/
|
13 |
+
interface Inx_Api_List_ListSize
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Returns the number of recipients that are subscribed to the list.
|
17 |
+
*
|
18 |
+
* @return int the list size as integer.
|
19 |
+
*/
|
20 |
+
public function getSize();
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Returns the creation datetime when the list size was computed.
|
24 |
+
*
|
25 |
+
* @return the creation datetime as ISO 8601 formatted datetime string.
|
26 |
+
*/
|
27 |
+
public function getCreationDate();
|
28 |
+
}
|
29 |
+
?>
|
lib/Inx/Api/List/StandardListContext.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_List_StandardListContext</i> represents a normal mailing list.
|
8 |
-
* Recipients can subscribe or unsubscribe from the list using landing pages and links.
|
9 |
-
* Manual subscription and unsubscription of recipients can be accomplished using the
|
10 |
-
* <i>Inx_Api_Subscription_SubscriptionManager</i>.
|
11 |
-
*
|
12 |
-
* @since API 1.0
|
13 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage List
|
16 |
-
*/
|
17 |
-
interface Inx_Api_List_StandardListContext extends Inx_Api_List_ListContext
|
18 |
-
{
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Changes the list name. The list will not be updated on the server until <i>commitUpdate()</i> has been called.
|
22 |
-
*
|
23 |
-
* @param string $sName the new list name.
|
24 |
-
*/
|
25 |
-
public function updateName( $sName );
|
26 |
-
|
27 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_List_StandardListContext</i> represents a normal mailing list.
|
8 |
+
* Recipients can subscribe or unsubscribe from the list using landing pages and links.
|
9 |
+
* Manual subscription and unsubscription of recipients can be accomplished using the
|
10 |
+
* <i>Inx_Api_Subscription_SubscriptionManager</i>.
|
11 |
+
*
|
12 |
+
* @since API 1.0
|
13 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage List
|
16 |
+
*/
|
17 |
+
interface Inx_Api_List_StandardListContext extends Inx_Api_List_ListContext
|
18 |
+
{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Changes the list name. The list will not be updated on the server until <i>commitUpdate()</i> has been called.
|
22 |
+
*
|
23 |
+
* @param string $sName the new list name.
|
24 |
+
*/
|
25 |
+
public function updateName( $sName );
|
26 |
+
|
27 |
+
}
|
lib/Inx/Api/List/SystemListContext.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage List
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_List_SystemListContext</i> does not represent a usual mailing list.
|
8 |
-
* Recipients cannot subscribe to this list and it is not possible to write emails to the recipients of the system list.
|
9 |
-
* The system list stores all recipient data regardless of any mailing list association.
|
10 |
-
* <p>
|
11 |
-
* The property settings defined in the system list are global in that they apply to all mailing list.
|
12 |
-
* A lot of property settings can only be defined here.
|
13 |
-
*
|
14 |
-
* @since API 1.0
|
15 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage List
|
18 |
-
*/
|
19 |
-
interface Inx_Api_List_SystemListContext extends Inx_Api_List_ListContext
|
20 |
-
{
|
21 |
-
|
22 |
-
/**
|
23 |
-
* The predefined, immutable name of the system list.
|
24 |
-
*/
|
25 |
-
const NAME = "system";
|
26 |
-
|
27 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage List
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_List_SystemListContext</i> does not represent a usual mailing list.
|
8 |
+
* Recipients cannot subscribe to this list and it is not possible to write emails to the recipients of the system list.
|
9 |
+
* The system list stores all recipient data regardless of any mailing list association.
|
10 |
+
* <p>
|
11 |
+
* The property settings defined in the system list are global in that they apply to all mailing list.
|
12 |
+
* A lot of property settings can only be defined here.
|
13 |
+
*
|
14 |
+
* @since API 1.0
|
15 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage List
|
18 |
+
*/
|
19 |
+
interface Inx_Api_List_SystemListContext extends Inx_Api_List_ListContext
|
20 |
+
{
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The predefined, immutable name of the system list.
|
24 |
+
*/
|
25 |
+
const NAME = "system";
|
26 |
+
|
27 |
+
}
|
lib/Inx/Api/LockException.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_LockException</i> is thrown if a lockable object (e.g. Mailing) is already locked.
|
7 |
-
*
|
8 |
-
* @see Inx_Api_Mailing_Mailing#lock()
|
9 |
-
* @since API 1.0
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
*/
|
13 |
-
class Inx_Api_LockException extends Exception
|
14 |
-
{
|
15 |
-
|
16 |
-
private $_oLockTicket;
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Constructs a <i>Inx_Api_LockException</i> with the specified detail message and
|
21 |
-
* specific details from lock owner.
|
22 |
-
*
|
23 |
-
* @param string $sMsg the detail message.
|
24 |
-
* @param Inx_Api_LockTicket $oLockTicket the ticket of lock information.
|
25 |
-
*/
|
26 |
-
public function __construct( $sMsg, Inx_Api_LockTicket $oLockTicket )
|
27 |
-
{
|
28 |
-
$this->_oLockTicket = $oLockTicket;
|
29 |
-
parent::__construct($sMsg);
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Returns the lock ticket. The lock ticket contains specific details from the lock owner.
|
35 |
-
*
|
36 |
-
* @return Inx_Api_LockTicket the lock ticket.
|
37 |
-
*/
|
38 |
-
public function getLockTicket()
|
39 |
-
{
|
40 |
-
return $this->_oLockTicket;
|
41 |
-
}
|
42 |
-
|
43 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_LockException</i> is thrown if a lockable object (e.g. Mailing) is already locked.
|
7 |
+
*
|
8 |
+
* @see Inx_Api_Mailing_Mailing#lock()
|
9 |
+
* @since API 1.0
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
*/
|
13 |
+
class Inx_Api_LockException extends Exception
|
14 |
+
{
|
15 |
+
|
16 |
+
private $_oLockTicket;
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructs a <i>Inx_Api_LockException</i> with the specified detail message and
|
21 |
+
* specific details from lock owner.
|
22 |
+
*
|
23 |
+
* @param string $sMsg the detail message.
|
24 |
+
* @param Inx_Api_LockTicket $oLockTicket the ticket of lock information.
|
25 |
+
*/
|
26 |
+
public function __construct( $sMsg, Inx_Api_LockTicket $oLockTicket )
|
27 |
+
{
|
28 |
+
$this->_oLockTicket = $oLockTicket;
|
29 |
+
parent::__construct($sMsg);
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns the lock ticket. The lock ticket contains specific details from the lock owner.
|
35 |
+
*
|
36 |
+
* @return Inx_Api_LockTicket the lock ticket.
|
37 |
+
*/
|
38 |
+
public function getLockTicket()
|
39 |
+
{
|
40 |
+
return $this->_oLockTicket;
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
lib/Inx/Api/LockTicket.php
CHANGED
@@ -1,105 +1,105 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_LockTicket</i> contains specific informations about a lock of an object (e.g. Mailing).
|
7 |
-
* <p>
|
8 |
-
* The information provided includes:
|
9 |
-
* <ul>
|
10 |
-
* <li>The id of the user who holds the lock
|
11 |
-
* <li>The name of the user who holds the lock
|
12 |
-
* <li>The internet address of the lock owner
|
13 |
-
* <li>The creation date of the lock
|
14 |
-
* <li>Whether the object is locked by this session
|
15 |
-
* </ul>
|
16 |
-
*
|
17 |
-
* @see Inx_Api_Mailing_Mailing#getLockTicket()
|
18 |
-
* @since API 1.0
|
19 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
20 |
-
* @package Inxmail
|
21 |
-
*/
|
22 |
-
class Inx_Api_LockTicket
|
23 |
-
{
|
24 |
-
|
25 |
-
private $_iUserId;
|
26 |
-
|
27 |
-
private $_sUserName;
|
28 |
-
|
29 |
-
private $_sSource;
|
30 |
-
|
31 |
-
private $_sCreationDatetime;
|
32 |
-
|
33 |
-
private $_blForeignLock;
|
34 |
-
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Constructs a <i>Inx_Api_LockTicket</i> with the specified details of the lock owner.
|
38 |
-
*
|
39 |
-
* @param integer $iUserId the user id from of the lock owner.
|
40 |
-
* @param string $sUserName the user name of the lock owner.
|
41 |
-
* @param string $sSource the internet address of the lock owner.
|
42 |
-
* @param string $sCreationDatetime the creation date of the existing lock.
|
43 |
-
* @param boolean $blForeignLock true if locked by another session, false if locked by this session.
|
44 |
-
*/
|
45 |
-
public function __construct( $iUserId, $sUserName, $sSource, $sCreationDatetime,
|
46 |
-
$blForeignLock )
|
47 |
-
{
|
48 |
-
$this->_iUserId = $iUserId;
|
49 |
-
$this->_sUserName = $sUserName;
|
50 |
-
$this->_sSource = $sSource;
|
51 |
-
$this->_sCreationDatetime = $sCreationDatetime;
|
52 |
-
$this->_blForeignLock = $blForeignLock;
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Returns the creation date of the existing lock as ISO 8601 formatted date string.
|
58 |
-
*
|
59 |
-
* @return string the creation date of the existing lock.
|
60 |
-
*/
|
61 |
-
public function getCreationDatetime()
|
62 |
-
{
|
63 |
-
return $this->_sCreationDatetime;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Returns the internet address of the lock owner.
|
68 |
-
*
|
69 |
-
* @return string the internet address of the lock owner.
|
70 |
-
*/
|
71 |
-
public function getSource()
|
72 |
-
{
|
73 |
-
return $this->_sSource;
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Returns the user id of the lock owner.
|
78 |
-
*
|
79 |
-
* @return string the user id of the lock owner.
|
80 |
-
*/
|
81 |
-
public function getUserId()
|
82 |
-
{
|
83 |
-
return $this->_sUserId;
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Returns the user name of the lock owner.
|
88 |
-
*
|
89 |
-
* @return string the user name of the lock owner.
|
90 |
-
*/
|
91 |
-
public function getUserName()
|
92 |
-
{
|
93 |
-
return $this->_sUserName;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Checks if the object is locked by this session.
|
98 |
-
*
|
99 |
-
* @return boolean true if locked by another session, false if locked by this session.
|
100 |
-
*/
|
101 |
-
public function isForeignLock()
|
102 |
-
{
|
103 |
-
return $this->_blForeignLock;
|
104 |
-
}
|
105 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_LockTicket</i> contains specific informations about a lock of an object (e.g. Mailing).
|
7 |
+
* <p>
|
8 |
+
* The information provided includes:
|
9 |
+
* <ul>
|
10 |
+
* <li>The id of the user who holds the lock
|
11 |
+
* <li>The name of the user who holds the lock
|
12 |
+
* <li>The internet address of the lock owner
|
13 |
+
* <li>The creation date of the lock
|
14 |
+
* <li>Whether the object is locked by this session
|
15 |
+
* </ul>
|
16 |
+
*
|
17 |
+
* @see Inx_Api_Mailing_Mailing#getLockTicket()
|
18 |
+
* @since API 1.0
|
19 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
20 |
+
* @package Inxmail
|
21 |
+
*/
|
22 |
+
class Inx_Api_LockTicket
|
23 |
+
{
|
24 |
+
|
25 |
+
private $_iUserId;
|
26 |
+
|
27 |
+
private $_sUserName;
|
28 |
+
|
29 |
+
private $_sSource;
|
30 |
+
|
31 |
+
private $_sCreationDatetime;
|
32 |
+
|
33 |
+
private $_blForeignLock;
|
34 |
+
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Constructs a <i>Inx_Api_LockTicket</i> with the specified details of the lock owner.
|
38 |
+
*
|
39 |
+
* @param integer $iUserId the user id from of the lock owner.
|
40 |
+
* @param string $sUserName the user name of the lock owner.
|
41 |
+
* @param string $sSource the internet address of the lock owner.
|
42 |
+
* @param string $sCreationDatetime the creation date of the existing lock.
|
43 |
+
* @param boolean $blForeignLock true if locked by another session, false if locked by this session.
|
44 |
+
*/
|
45 |
+
public function __construct( $iUserId, $sUserName, $sSource, $sCreationDatetime,
|
46 |
+
$blForeignLock )
|
47 |
+
{
|
48 |
+
$this->_iUserId = $iUserId;
|
49 |
+
$this->_sUserName = $sUserName;
|
50 |
+
$this->_sSource = $sSource;
|
51 |
+
$this->_sCreationDatetime = $sCreationDatetime;
|
52 |
+
$this->_blForeignLock = $blForeignLock;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Returns the creation date of the existing lock as ISO 8601 formatted date string.
|
58 |
+
*
|
59 |
+
* @return string the creation date of the existing lock.
|
60 |
+
*/
|
61 |
+
public function getCreationDatetime()
|
62 |
+
{
|
63 |
+
return $this->_sCreationDatetime;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Returns the internet address of the lock owner.
|
68 |
+
*
|
69 |
+
* @return string the internet address of the lock owner.
|
70 |
+
*/
|
71 |
+
public function getSource()
|
72 |
+
{
|
73 |
+
return $this->_sSource;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Returns the user id of the lock owner.
|
78 |
+
*
|
79 |
+
* @return string the user id of the lock owner.
|
80 |
+
*/
|
81 |
+
public function getUserId()
|
82 |
+
{
|
83 |
+
return $this->_sUserId;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Returns the user name of the lock owner.
|
88 |
+
*
|
89 |
+
* @return string the user name of the lock owner.
|
90 |
+
*/
|
91 |
+
public function getUserName()
|
92 |
+
{
|
93 |
+
return $this->_sUserName;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Checks if the object is locked by this session.
|
98 |
+
*
|
99 |
+
* @return boolean true if locked by another session, false if locked by this session.
|
100 |
+
*/
|
101 |
+
public function isForeignLock()
|
102 |
+
{
|
103 |
+
return $this->_blForeignLock;
|
104 |
+
}
|
105 |
+
}
|
lib/Inx/Api/LoginException.php
CHANGED
@@ -1,56 +1,56 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_LoginException</i> is thrown by login methods if the login process failed.
|
7 |
-
*
|
8 |
-
* @see Inx_Api_Session#createLocalSession(String, String)
|
9 |
-
* @see Inx_Api_Session#createRemoteSession(String, String, String)
|
10 |
-
* @since API 1.0
|
11 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
-
* @package Inxmail
|
13 |
-
*/
|
14 |
-
class Inx_Api_LoginException extends Exception
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* System exception: The server isn't running, too many sessions are opened, no valid license can be found or the
|
18 |
-
* api is incompatible to the server version.
|
19 |
-
*/
|
20 |
-
const SYSTEM_EXCEPTION = 1000;
|
21 |
-
|
22 |
-
/** An illegal username or password was specfied. */
|
23 |
-
const ILLEGAL_USERNAME_OR_PASSWORD = 1001;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* The specified user is inactive, the login right for the specified user is missing or access is denied from the ip
|
27 |
-
* filter.
|
28 |
-
*/
|
29 |
-
const USER_EXCEPTION = 1002;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The password expiration is elapsed.
|
33 |
-
* @since 1.4.2
|
34 |
-
*/
|
35 |
-
const PWD_VALIDITY_EXPIRATION = 1003;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* The user is forced to change his password by the administrator.
|
39 |
-
* @since 1.4.2
|
40 |
-
*/
|
41 |
-
const PWD_FORCED_CHANGE = 1004;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* The specified user has insufficient permissions.
|
45 |
-
*
|
46 |
-
* @since 1.9.0
|
47 |
-
*/
|
48 |
-
const MISSING_PERMISSIONS = 1010;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* The specified Plugin (secret) could not be found.
|
52 |
-
*
|
53 |
-
* @since 1.9.0
|
54 |
-
*/
|
55 |
-
const MISSING_PLUGIN = 1011;
|
56 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_LoginException</i> is thrown by login methods if the login process failed.
|
7 |
+
*
|
8 |
+
* @see Inx_Api_Session#createLocalSession(String, String)
|
9 |
+
* @see Inx_Api_Session#createRemoteSession(String, String, String)
|
10 |
+
* @since API 1.0
|
11 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
+
* @package Inxmail
|
13 |
+
*/
|
14 |
+
class Inx_Api_LoginException extends Exception
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* System exception: The server isn't running, too many sessions are opened, no valid license can be found or the
|
18 |
+
* api is incompatible to the server version.
|
19 |
+
*/
|
20 |
+
const SYSTEM_EXCEPTION = 1000;
|
21 |
+
|
22 |
+
/** An illegal username or password was specfied. */
|
23 |
+
const ILLEGAL_USERNAME_OR_PASSWORD = 1001;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The specified user is inactive, the login right for the specified user is missing or access is denied from the ip
|
27 |
+
* filter.
|
28 |
+
*/
|
29 |
+
const USER_EXCEPTION = 1002;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The password expiration is elapsed.
|
33 |
+
* @since 1.4.2
|
34 |
+
*/
|
35 |
+
const PWD_VALIDITY_EXPIRATION = 1003;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* The user is forced to change his password by the administrator.
|
39 |
+
* @since 1.4.2
|
40 |
+
*/
|
41 |
+
const PWD_FORCED_CHANGE = 1004;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* The specified user has insufficient permissions.
|
45 |
+
*
|
46 |
+
* @since 1.9.0
|
47 |
+
*/
|
48 |
+
const MISSING_PERMISSIONS = 1010;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* The specified Plugin (secret) could not be found.
|
52 |
+
*
|
53 |
+
* @since 1.9.0
|
54 |
+
*/
|
55 |
+
const MISSING_PLUGIN = 1011;
|
56 |
+
}
|
lib/Inx/Api/Mailing/ContentHandler.php
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Mailing_ContentHandler</i> interface identifies content handlers.
|
8 |
-
* Content handlers are used to store and update the content of a mailing in a specific format.
|
9 |
-
* Some content handlers (like <i>Inx_Api_Mailing_XsltContentHandler</i>) provide special functionality like applying
|
10 |
-
* styles to a mailing (used by templates).
|
11 |
-
* <p>
|
12 |
-
* There are no requirements common for all content handlers, thus content handlers are free to provide only the
|
13 |
-
* methods needed for the current content type.
|
14 |
-
*
|
15 |
-
* @see Inx_Api_Mailing_Mailing::getContentHandler()
|
16 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
17 |
-
* @package Inxmail
|
18 |
-
* @subpackage Mailing
|
19 |
-
*/
|
20 |
-
interface Inx_Api_Mailing_ContentHandler
|
21 |
-
{
|
22 |
-
|
23 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Mailing_ContentHandler</i> interface identifies content handlers.
|
8 |
+
* Content handlers are used to store and update the content of a mailing in a specific format.
|
9 |
+
* Some content handlers (like <i>Inx_Api_Mailing_XsltContentHandler</i>) provide special functionality like applying
|
10 |
+
* styles to a mailing (used by templates).
|
11 |
+
* <p>
|
12 |
+
* There are no requirements common for all content handlers, thus content handlers are free to provide only the
|
13 |
+
* methods needed for the current content type.
|
14 |
+
*
|
15 |
+
* @see Inx_Api_Mailing_Mailing::getContentHandler()
|
16 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
17 |
+
* @package Inxmail
|
18 |
+
* @subpackage Mailing
|
19 |
+
*/
|
20 |
+
interface Inx_Api_Mailing_ContentHandler
|
21 |
+
{
|
22 |
+
|
23 |
+
}
|
lib/Inx/Api/Mailing/HtmlTextContentHandler.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Mailing_HtmlTextContentHandler</i> is a simple content handler used to store and update mailing
|
8 |
-
* content in HTML format.
|
9 |
-
* This content handler can only handle HTML content.
|
10 |
-
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_MultiPartContentHandler</i> instead.
|
11 |
-
*
|
12 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Mailing
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Mailing_HtmlTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
|
17 |
-
{
|
18 |
-
|
19 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Mailing_HtmlTextContentHandler</i> is a simple content handler used to store and update mailing
|
8 |
+
* content in HTML format.
|
9 |
+
* This content handler can only handle HTML content.
|
10 |
+
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_MultiPartContentHandler</i> instead.
|
11 |
+
*
|
12 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Mailing
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Mailing_HtmlTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
|
17 |
+
{
|
18 |
+
|
19 |
+
}
|
lib/Inx/Api/Mailing/MailingManager.php
CHANGED
@@ -1,238 +1,238 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Mailing_MailingManager</i> manages all mailings.
|
9 |
-
* The <i>MailingManager</i> can be used to perform the following tasks:
|
10 |
-
* <ul>
|
11 |
-
* <li>Retrieve mailings
|
12 |
-
* <li>Create mailings
|
13 |
-
* <li>Clone mailings
|
14 |
-
* <li>Create a renderer to generate a preview of the mailing
|
15 |
-
* </ul>
|
16 |
-
* <p>
|
17 |
-
* <strong>Mailing retrieval</strong>
|
18 |
-
* <p>
|
19 |
-
* There are several ways to retrieve mailings.
|
20 |
-
* The simplest way is to call <i>selectAll()</i> which will retrieve all mailings.
|
21 |
-
* To retrieve a single mailing, use the <i>get($iMailingId)</i> method.
|
22 |
-
* To retrieve all mailings of a specific list use one of the <i>select(...)</i> methods.
|
23 |
-
* Using this type of method gives you the ability to define search filters, like the mailing state.
|
24 |
-
* It is also possible to order the result.
|
25 |
-
* <p>
|
26 |
-
* The following snippet shows how to retrieve all mailings of a specific list, which are either in the
|
27 |
-
* <code>DRAFT</code> or the <code>TO_BE_APPROVE</code> state and print out their names:
|
28 |
-
*
|
29 |
-
* <pre>
|
30 |
-
* $oMailingManager = $oSession->getMailingManager();
|
31 |
-
* $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
|
32 |
-
* | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE);
|
33 |
-
*
|
34 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
35 |
-
* {
|
36 |
-
* $oMailing = $oBOResultSet->get($i);
|
37 |
-
* echo $oMailing->getName()."<br>";
|
38 |
-
* }
|
39 |
-
*
|
40 |
-
* $oBOResultSet->close();
|
41 |
-
* </pre>
|
42 |
-
*
|
43 |
-
* To retrieve all mailings of a specific list, disregarding their state, use the state filter <i>STATE_FILTER_ALL</i>.
|
44 |
-
* This filter produces the same result as a bitwise combination of all mailing states.
|
45 |
-
* <p>
|
46 |
-
* If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
|
47 |
-
* using filter expressions. The following snippet extends the previous select statement with a filter that restricts
|
48 |
-
* the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
|
49 |
-
*
|
50 |
-
* <pre>
|
51 |
-
* $oMailingManager = $oSession->getMailingManager();
|
52 |
-
*
|
53 |
-
* $filterDate = date("d.m.Y H:i:s", strtotime("-1 hour"));
|
54 |
-
* $filter = "Attribute(".Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME.") > #".$filterDate."#";
|
55 |
-
*
|
56 |
-
* $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
|
57 |
-
* | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE, $filter, Inx_Api_Mailing_Mailing::ATTRIBUTE_NAME,
|
58 |
-
* Inx_Api_Order::ASC);
|
59 |
-
*
|
60 |
-
* for($i = 0; $i < $oBOResultSet->size(); $i++)
|
61 |
-
* {
|
62 |
-
* $oMailing = $oBOResultSet->get($i);
|
63 |
-
* echo $oMailing->getName()."<br>";
|
64 |
-
* }
|
65 |
-
*
|
66 |
-
* $oBOResultSet->close();
|
67 |
-
* </pre>
|
68 |
-
* <p>
|
69 |
-
* <strong>Mailing creation and editing</strong>
|
70 |
-
* <p>
|
71 |
-
* The following snippet shows how to create a mailing:
|
72 |
-
*
|
73 |
-
* <pre>
|
74 |
-
* $oMailingManager = $oSession->getMailingManager();
|
75 |
-
* $oMailing = $oMailingManager->createMailing($oListContext);
|
76 |
-
* $oMailing->updateSubject("Monthly Newsletter");
|
77 |
-
* $oMailing->commitUpdate();
|
78 |
-
* </pre>
|
79 |
-
* <p>
|
80 |
-
* <strong>Note:</strong> For existing mailings, always call <i>lock()</i> before updating it, and
|
81 |
-
* <i>unlock()</i> after committing changes!
|
82 |
-
* <p>
|
83 |
-
* The following snippet shows how to edit an existing mailing:
|
84 |
-
*
|
85 |
-
* <pre>
|
86 |
-
* $oMailingManager = $oSession->getMailingManager();
|
87 |
-
* $oMailing = $oMailingManager->get($iMailingId);
|
88 |
-
*
|
89 |
-
* try
|
90 |
-
* {
|
91 |
-
* $oMailing->lock();
|
92 |
-
* $oMailing->updateSubject("New Subject");
|
93 |
-
* $oMailing->commitUpdate();
|
94 |
-
* $oMailing->unlock();
|
95 |
-
* }
|
96 |
-
* catch(Inx_Api_LockException $x)
|
97 |
-
* {
|
98 |
-
* //somone else has locked this mailing
|
99 |
-
* }
|
100 |
-
* </pre>
|
101 |
-
* <p>
|
102 |
-
* It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
|
103 |
-
* <i>clone()</i> method.
|
104 |
-
* <p>
|
105 |
-
* The following snippet shows how to clone a mailing and put the clone in the specified list:
|
106 |
-
*
|
107 |
-
* <pre>
|
108 |
-
* $oMailingManager = $oSession->getMailingManager();
|
109 |
-
* $oMailingManager->cloneMailing($iMailingId, $oListContext);
|
110 |
-
* </pre>
|
111 |
-
* <p>
|
112 |
-
* <strong>Preview generation</strong>
|
113 |
-
* <p>
|
114 |
-
* To create a preview of a mailing, an <i>Inx_Api_Mail_MailingRenderer</i> is needed.
|
115 |
-
* A renderer can be obtained using the <i>createRenderer()</i> method.
|
116 |
-
* <p>
|
117 |
-
* The following snippet shows how to create a <code>MailingRenderer</code> and generate a preview of the mailing:
|
118 |
-
*
|
119 |
-
* <pre>
|
120 |
-
* $oMailingManager = $oSession->getMailingManager();
|
121 |
-
* $oMailingRenderer = $oMailingManager->createRenderer();
|
122 |
-
* $oMailingRenderer->parse($iMailingId, Inx_Api_Mail_MailingRenderer::BUILD_MODE_PREVIEW);
|
123 |
-
* $oMailContent = $oMailingRenderer->build($iRecipientId);
|
124 |
-
*
|
125 |
-
* echo $oMailContent->getPlainText()."<br>";
|
126 |
-
* </pre>
|
127 |
-
* <p>
|
128 |
-
* For more information on mailings, see the <i>Inx_Api_Mailing_Mailing</i> documentation.
|
129 |
-
* <p>
|
130 |
-
* Note: To use mailings, the following api user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
|
131 |
-
*
|
132 |
-
* @see Inx_Api_Mailing_Mailing
|
133 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
134 |
-
* @package Inxmail
|
135 |
-
* @subpackage Mailing
|
136 |
-
*/
|
137 |
-
interface Inx_Api_Mailing_MailingManager extends Inx_Api_BOManager
|
138 |
-
{
|
139 |
-
|
140 |
-
/** @deprecated replaced by Inx_Api_Order::ASC */
|
141 |
-
const ORDER_ASC = 0;
|
142 |
-
|
143 |
-
/** @deprecated replaced by Inx_Api_Order::DESC */
|
144 |
-
const ORDER_DESC = 1;
|
145 |
-
|
146 |
-
|
147 |
-
/**
|
148 |
-
* State filter constants to returning all mailings.
|
149 |
-
* It's the same like:
|
150 |
-
* <pre>
|
151 |
-
* $iStateFilter = Inx_Api_Mailing_Mailing::STATE_DRAFT | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE | Inx_Api_Mailing_Mailing::STATE_APPROVED
|
152 |
-
* | Inx_Api_Mailing_Mailing::STATE_SCHEDULED | Inx_Api_Mailing_Mailing::STATE_SENDING| Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
|
153 |
-
* | Inx_Api_Mailing_Mailing::STATE_SENT | Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED;
|
154 |
-
* </pre>
|
155 |
-
*/
|
156 |
-
const STATE_FILTER_ALL = 0xFFFF;
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Selects mailings in specified order, filtered by the supplied condition.<br>
|
160 |
-
* The <i>Inx_Api_BOResultSet</i> contains a set of <i>Inx_Api_Mailing_Mailing</i> objects.
|
161 |
-
*
|
162 |
-
* The stateFilter must be either a single value like:
|
163 |
-
* <ul>
|
164 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_DRAFT
|
165 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE
|
166 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_APPROVED
|
167 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED
|
168 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_SENDING
|
169 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
|
170 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_SENT
|
171 |
-
* <li>Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED
|
172 |
-
* </ul>
|
173 |
-
* or a bitwise combination, e.g. Inx_Api_Mailing_Mailing::STATE_SCHEDULED|Inx_Api_Mailing_Mailing::STATE_SENDING
|
174 |
-
* or Inx_Api_Mailing_Mailing::STATE_DRAFT|Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE|Inx_Api_Mailing_Mailing::STATE_APPROVED
|
175 |
-
*
|
176 |
-
*
|
177 |
-
* The filter is a boolean expression on one mailing attribute. Attributes are specified with the function <i>Attribute(id)</i>.
|
178 |
-
* Please note that date-values for the filter have to be specified in german 24-hour date-format. To accomplish this, the date()
|
179 |
-
* function with the following date-pattern can be used:
|
180 |
-
*
|
181 |
-
* <pre>
|
182 |
-
* $filterDate = date("d.m.Y H:i:s");
|
183 |
-
* </pre>
|
184 |
-
*
|
185 |
-
* The orderAttribute is the id of the order attribute.
|
186 |
-
*
|
187 |
-
* Allowed values for attribute ids are:
|
188 |
-
* <ul>
|
189 |
-
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SUBJECT
|
190 |
-
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME
|
191 |
-
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_START_DATETIME
|
192 |
-
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_END_DATETIME
|
193 |
-
* </ul>
|
194 |
-
*
|
195 |
-
* @param Inx_Api_List_ListContext $oListContext list from which to select
|
196 |
-
* @param int $iStateFilter s.above.
|
197 |
-
* @param string $sFilter filter expression
|
198 |
-
* @param int $iOrderAttribute order attribute id
|
199 |
-
* @param int $iOrderType one of Order.ASC and Order.DESC fort order direction
|
200 |
-
* @return Inx_Api_BOResultSet the result set of <i>Inx_Api_Mailing_Mailing</i> objects
|
201 |
-
* @throws Inx_Api_FilterStmtException
|
202 |
-
*/
|
203 |
-
public function select( Inx_Api_List_ListContext $oListContext = null, $iStateFilter, $sFilter = null,
|
204 |
-
$iOrderAttribute = null, $iOrderType = null );
|
205 |
-
|
206 |
-
/**
|
207 |
-
* Creates a new mailing in the specified list.
|
208 |
-
*
|
209 |
-
* @param $oListContext list owner of the mailing
|
210 |
-
* @return Inx_Api_Mailing_Mailing a new mailing
|
211 |
-
*/
|
212 |
-
public function createMailing( Inx_Api_List_ListContext $oListContext );
|
213 |
-
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Creates the new <i>Inx_Api_Mail_MailingRenderer</i> to rendering a <i>Inx_Api_Mailing_Mailing</i>.
|
217 |
-
*
|
218 |
-
* @return Inx_Api_Mail_MailingRenderer the new <i>Inx_Api_Mail_MailingRenderer</i>
|
219 |
-
*/
|
220 |
-
public function createRenderer();
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Creates the new <code>Inx_Api_Mail_MailingRenderer</code> to rendering a <code>Mailing</code> with test recipients.
|
224 |
-
*
|
225 |
-
* @return the new <code>Inx_Api_Mail_MailingRenderer</code>
|
226 |
-
* @since API 1.6.0
|
227 |
-
*/
|
228 |
-
public function createRendererForTestRecipient();
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Copies a <code>Inx_Api_Mail_Mailing</code> to the specified list.
|
232 |
-
*
|
233 |
-
* @return the new <code>Inx_Api_Mail_Mailing</code>
|
234 |
-
* @since API 1.6.0
|
235 |
-
*/
|
236 |
-
public function cloneMailing($iMailingId, Inx_Api_List_ListContext $oListContext );
|
237 |
-
|
238 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Mailing_MailingManager</i> manages all mailings.
|
9 |
+
* The <i>MailingManager</i> can be used to perform the following tasks:
|
10 |
+
* <ul>
|
11 |
+
* <li>Retrieve mailings
|
12 |
+
* <li>Create mailings
|
13 |
+
* <li>Clone mailings
|
14 |
+
* <li>Create a renderer to generate a preview of the mailing
|
15 |
+
* </ul>
|
16 |
+
* <p>
|
17 |
+
* <strong>Mailing retrieval</strong>
|
18 |
+
* <p>
|
19 |
+
* There are several ways to retrieve mailings.
|
20 |
+
* The simplest way is to call <i>selectAll()</i> which will retrieve all mailings.
|
21 |
+
* To retrieve a single mailing, use the <i>get($iMailingId)</i> method.
|
22 |
+
* To retrieve all mailings of a specific list use one of the <i>select(...)</i> methods.
|
23 |
+
* Using this type of method gives you the ability to define search filters, like the mailing state.
|
24 |
+
* It is also possible to order the result.
|
25 |
+
* <p>
|
26 |
+
* The following snippet shows how to retrieve all mailings of a specific list, which are either in the
|
27 |
+
* <code>DRAFT</code> or the <code>TO_BE_APPROVE</code> state and print out their names:
|
28 |
+
*
|
29 |
+
* <pre>
|
30 |
+
* $oMailingManager = $oSession->getMailingManager();
|
31 |
+
* $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
|
32 |
+
* | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE);
|
33 |
+
*
|
34 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
35 |
+
* {
|
36 |
+
* $oMailing = $oBOResultSet->get($i);
|
37 |
+
* echo $oMailing->getName()."<br>";
|
38 |
+
* }
|
39 |
+
*
|
40 |
+
* $oBOResultSet->close();
|
41 |
+
* </pre>
|
42 |
+
*
|
43 |
+
* To retrieve all mailings of a specific list, disregarding their state, use the state filter <i>STATE_FILTER_ALL</i>.
|
44 |
+
* This filter produces the same result as a bitwise combination of all mailing states.
|
45 |
+
* <p>
|
46 |
+
* If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
|
47 |
+
* using filter expressions. The following snippet extends the previous select statement with a filter that restricts
|
48 |
+
* the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
|
49 |
+
*
|
50 |
+
* <pre>
|
51 |
+
* $oMailingManager = $oSession->getMailingManager();
|
52 |
+
*
|
53 |
+
* $filterDate = date("d.m.Y H:i:s", strtotime("-1 hour"));
|
54 |
+
* $filter = "Attribute(".Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME.") > #".$filterDate."#";
|
55 |
+
*
|
56 |
+
* $oBOResultSet = $oMailingManager->select($oListContext, Inx_Api_Mailing_Mailing::STATE_DRAFT
|
57 |
+
* | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE, $filter, Inx_Api_Mailing_Mailing::ATTRIBUTE_NAME,
|
58 |
+
* Inx_Api_Order::ASC);
|
59 |
+
*
|
60 |
+
* for($i = 0; $i < $oBOResultSet->size(); $i++)
|
61 |
+
* {
|
62 |
+
* $oMailing = $oBOResultSet->get($i);
|
63 |
+
* echo $oMailing->getName()."<br>";
|
64 |
+
* }
|
65 |
+
*
|
66 |
+
* $oBOResultSet->close();
|
67 |
+
* </pre>
|
68 |
+
* <p>
|
69 |
+
* <strong>Mailing creation and editing</strong>
|
70 |
+
* <p>
|
71 |
+
* The following snippet shows how to create a mailing:
|
72 |
+
*
|
73 |
+
* <pre>
|
74 |
+
* $oMailingManager = $oSession->getMailingManager();
|
75 |
+
* $oMailing = $oMailingManager->createMailing($oListContext);
|
76 |
+
* $oMailing->updateSubject("Monthly Newsletter");
|
77 |
+
* $oMailing->commitUpdate();
|
78 |
+
* </pre>
|
79 |
+
* <p>
|
80 |
+
* <strong>Note:</strong> For existing mailings, always call <i>lock()</i> before updating it, and
|
81 |
+
* <i>unlock()</i> after committing changes!
|
82 |
+
* <p>
|
83 |
+
* The following snippet shows how to edit an existing mailing:
|
84 |
+
*
|
85 |
+
* <pre>
|
86 |
+
* $oMailingManager = $oSession->getMailingManager();
|
87 |
+
* $oMailing = $oMailingManager->get($iMailingId);
|
88 |
+
*
|
89 |
+
* try
|
90 |
+
* {
|
91 |
+
* $oMailing->lock();
|
92 |
+
* $oMailing->updateSubject("New Subject");
|
93 |
+
* $oMailing->commitUpdate();
|
94 |
+
* $oMailing->unlock();
|
95 |
+
* }
|
96 |
+
* catch(Inx_Api_LockException $x)
|
97 |
+
* {
|
98 |
+
* //somone else has locked this mailing
|
99 |
+
* }
|
100 |
+
* </pre>
|
101 |
+
* <p>
|
102 |
+
* It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
|
103 |
+
* <i>clone()</i> method.
|
104 |
+
* <p>
|
105 |
+
* The following snippet shows how to clone a mailing and put the clone in the specified list:
|
106 |
+
*
|
107 |
+
* <pre>
|
108 |
+
* $oMailingManager = $oSession->getMailingManager();
|
109 |
+
* $oMailingManager->cloneMailing($iMailingId, $oListContext);
|
110 |
+
* </pre>
|
111 |
+
* <p>
|
112 |
+
* <strong>Preview generation</strong>
|
113 |
+
* <p>
|
114 |
+
* To create a preview of a mailing, an <i>Inx_Api_Mail_MailingRenderer</i> is needed.
|
115 |
+
* A renderer can be obtained using the <i>createRenderer()</i> method.
|
116 |
+
* <p>
|
117 |
+
* The following snippet shows how to create a <code>MailingRenderer</code> and generate a preview of the mailing:
|
118 |
+
*
|
119 |
+
* <pre>
|
120 |
+
* $oMailingManager = $oSession->getMailingManager();
|
121 |
+
* $oMailingRenderer = $oMailingManager->createRenderer();
|
122 |
+
* $oMailingRenderer->parse($iMailingId, Inx_Api_Mail_MailingRenderer::BUILD_MODE_PREVIEW);
|
123 |
+
* $oMailContent = $oMailingRenderer->build($iRecipientId);
|
124 |
+
*
|
125 |
+
* echo $oMailContent->getPlainText()."<br>";
|
126 |
+
* </pre>
|
127 |
+
* <p>
|
128 |
+
* For more information on mailings, see the <i>Inx_Api_Mailing_Mailing</i> documentation.
|
129 |
+
* <p>
|
130 |
+
* Note: To use mailings, the following api user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
|
131 |
+
*
|
132 |
+
* @see Inx_Api_Mailing_Mailing
|
133 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
134 |
+
* @package Inxmail
|
135 |
+
* @subpackage Mailing
|
136 |
+
*/
|
137 |
+
interface Inx_Api_Mailing_MailingManager extends Inx_Api_BOManager
|
138 |
+
{
|
139 |
+
|
140 |
+
/** @deprecated replaced by Inx_Api_Order::ASC */
|
141 |
+
const ORDER_ASC = 0;
|
142 |
+
|
143 |
+
/** @deprecated replaced by Inx_Api_Order::DESC */
|
144 |
+
const ORDER_DESC = 1;
|
145 |
+
|
146 |
+
|
147 |
+
/**
|
148 |
+
* State filter constants to returning all mailings.
|
149 |
+
* It's the same like:
|
150 |
+
* <pre>
|
151 |
+
* $iStateFilter = Inx_Api_Mailing_Mailing::STATE_DRAFT | Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE | Inx_Api_Mailing_Mailing::STATE_APPROVED
|
152 |
+
* | Inx_Api_Mailing_Mailing::STATE_SCHEDULED | Inx_Api_Mailing_Mailing::STATE_SENDING| Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
|
153 |
+
* | Inx_Api_Mailing_Mailing::STATE_SENT | Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED;
|
154 |
+
* </pre>
|
155 |
+
*/
|
156 |
+
const STATE_FILTER_ALL = 0xFFFF;
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Selects mailings in specified order, filtered by the supplied condition.<br>
|
160 |
+
* The <i>Inx_Api_BOResultSet</i> contains a set of <i>Inx_Api_Mailing_Mailing</i> objects.
|
161 |
+
*
|
162 |
+
* The stateFilter must be either a single value like:
|
163 |
+
* <ul>
|
164 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_DRAFT
|
165 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE
|
166 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_APPROVED
|
167 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_SCHEDULED
|
168 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_SENDING
|
169 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_INTERRUPTED
|
170 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_SENT
|
171 |
+
* <li>Inx_Api_Mailing_Mailing::STATE_SENDING_FAILED
|
172 |
+
* </ul>
|
173 |
+
* or a bitwise combination, e.g. Inx_Api_Mailing_Mailing::STATE_SCHEDULED|Inx_Api_Mailing_Mailing::STATE_SENDING
|
174 |
+
* or Inx_Api_Mailing_Mailing::STATE_DRAFT|Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE|Inx_Api_Mailing_Mailing::STATE_APPROVED
|
175 |
+
*
|
176 |
+
*
|
177 |
+
* The filter is a boolean expression on one mailing attribute. Attributes are specified with the function <i>Attribute(id)</i>.
|
178 |
+
* Please note that date-values for the filter have to be specified in german 24-hour date-format. To accomplish this, the date()
|
179 |
+
* function with the following date-pattern can be used:
|
180 |
+
*
|
181 |
+
* <pre>
|
182 |
+
* $filterDate = date("d.m.Y H:i:s");
|
183 |
+
* </pre>
|
184 |
+
*
|
185 |
+
* The orderAttribute is the id of the order attribute.
|
186 |
+
*
|
187 |
+
* Allowed values for attribute ids are:
|
188 |
+
* <ul>
|
189 |
+
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SUBJECT
|
190 |
+
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_MODIFICATION_DATETIME
|
191 |
+
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_START_DATETIME
|
192 |
+
* <li>Inx_Api_Mailing_Mailing::ATTRIBUTE_SENT_END_DATETIME
|
193 |
+
* </ul>
|
194 |
+
*
|
195 |
+
* @param Inx_Api_List_ListContext $oListContext list from which to select
|
196 |
+
* @param int $iStateFilter s.above.
|
197 |
+
* @param string $sFilter filter expression
|
198 |
+
* @param int $iOrderAttribute order attribute id
|
199 |
+
* @param int $iOrderType one of Order.ASC and Order.DESC fort order direction
|
200 |
+
* @return Inx_Api_BOResultSet the result set of <i>Inx_Api_Mailing_Mailing</i> objects
|
201 |
+
* @throws Inx_Api_FilterStmtException
|
202 |
+
*/
|
203 |
+
public function select( Inx_Api_List_ListContext $oListContext = null, $iStateFilter, $sFilter = null,
|
204 |
+
$iOrderAttribute = null, $iOrderType = null );
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Creates a new mailing in the specified list.
|
208 |
+
*
|
209 |
+
* @param $oListContext list owner of the mailing
|
210 |
+
* @return Inx_Api_Mailing_Mailing a new mailing
|
211 |
+
*/
|
212 |
+
public function createMailing( Inx_Api_List_ListContext $oListContext );
|
213 |
+
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Creates the new <i>Inx_Api_Mail_MailingRenderer</i> to rendering a <i>Inx_Api_Mailing_Mailing</i>.
|
217 |
+
*
|
218 |
+
* @return Inx_Api_Mail_MailingRenderer the new <i>Inx_Api_Mail_MailingRenderer</i>
|
219 |
+
*/
|
220 |
+
public function createRenderer();
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Creates the new <code>Inx_Api_Mail_MailingRenderer</code> to rendering a <code>Mailing</code> with test recipients.
|
224 |
+
*
|
225 |
+
* @return the new <code>Inx_Api_Mail_MailingRenderer</code>
|
226 |
+
* @since API 1.6.0
|
227 |
+
*/
|
228 |
+
public function createRendererForTestRecipient();
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Copies a <code>Inx_Api_Mail_Mailing</code> to the specified list.
|
232 |
+
*
|
233 |
+
* @return the new <code>Inx_Api_Mail_Mailing</code>
|
234 |
+
* @since API 1.6.0
|
235 |
+
*/
|
236 |
+
public function cloneMailing($iMailingId, Inx_Api_List_ListContext $oListContext );
|
237 |
+
|
238 |
+
}
|
lib/Inx/Api/Mailing/MailingStateException.php
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Mailing_MailingStateException</i> is thrown when a mailing action is invoked which is not allowed
|
9 |
-
* to be performed in the current state.
|
10 |
-
* For example, invoking <i>Inx_Api_Mailing_Mailing::startSending()</i> is not allowed if the mailing is in the
|
11 |
-
* state <i>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE</i>, thus raising a <i>MailingStateException</i>.
|
12 |
-
*
|
13 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage Mailing
|
16 |
-
*/
|
17 |
-
class Inx_Api_Mailing_MailingStateException extends Exception
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
21 |
-
*
|
22 |
-
* @var boolean
|
23 |
-
*/
|
24 |
-
private $_blLocked;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Creates a <code>MailingStateException</code> with the given detail message, current state and locking state.
|
28 |
-
*
|
29 |
-
* @param string $sMsg the detail message.
|
30 |
-
* @param int $iCurrentState the current state of the affected mailing.
|
31 |
-
* @param bool $blLocked <code>true</code> if the mailing is locked, <code>false</code> otherwise.
|
32 |
-
*/
|
33 |
-
public function __construct( $sMsg = null, $iCurrentState = null, $blLocked = null )
|
34 |
-
{
|
35 |
-
parent::__construct( $sMsg, $iCurrentState );
|
36 |
-
|
37 |
-
$this->_blLocked = $blLocked;
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Returns the current state of the affected mailing.
|
43 |
-
* Alias for <i>Inx_Api_Mailing_MailingStateException::getCode()</i>
|
44 |
-
*
|
45 |
-
* @return int the current state.
|
46 |
-
*/
|
47 |
-
public function getCurrentState()
|
48 |
-
{
|
49 |
-
return $this->getCode();
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Checks if the mailing is locked.
|
54 |
-
*
|
55 |
-
* @return bool <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
56 |
-
*/
|
57 |
-
public function isLocked()
|
58 |
-
{
|
59 |
-
return $this->blLocked;
|
60 |
-
}
|
61 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Mailing_MailingStateException</i> is thrown when a mailing action is invoked which is not allowed
|
9 |
+
* to be performed in the current state.
|
10 |
+
* For example, invoking <i>Inx_Api_Mailing_Mailing::startSending()</i> is not allowed if the mailing is in the
|
11 |
+
* state <i>Inx_Api_Mailing_Mailing::STATE_TO_BE_APPROVE</i>, thus raising a <i>MailingStateException</i>.
|
12 |
+
*
|
13 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage Mailing
|
16 |
+
*/
|
17 |
+
class Inx_Api_Mailing_MailingStateException extends Exception
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
21 |
+
*
|
22 |
+
* @var boolean
|
23 |
+
*/
|
24 |
+
private $_blLocked;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Creates a <code>MailingStateException</code> with the given detail message, current state and locking state.
|
28 |
+
*
|
29 |
+
* @param string $sMsg the detail message.
|
30 |
+
* @param int $iCurrentState the current state of the affected mailing.
|
31 |
+
* @param bool $blLocked <code>true</code> if the mailing is locked, <code>false</code> otherwise.
|
32 |
+
*/
|
33 |
+
public function __construct( $sMsg = null, $iCurrentState = null, $blLocked = null )
|
34 |
+
{
|
35 |
+
parent::__construct( $sMsg, $iCurrentState );
|
36 |
+
|
37 |
+
$this->_blLocked = $blLocked;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Returns the current state of the affected mailing.
|
43 |
+
* Alias for <i>Inx_Api_Mailing_MailingStateException::getCode()</i>
|
44 |
+
*
|
45 |
+
* @return int the current state.
|
46 |
+
*/
|
47 |
+
public function getCurrentState()
|
48 |
+
{
|
49 |
+
return $this->getCode();
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Checks if the mailing is locked.
|
54 |
+
*
|
55 |
+
* @return bool <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
56 |
+
*/
|
57 |
+
public function isLocked()
|
58 |
+
{
|
59 |
+
return $this->blLocked;
|
60 |
+
}
|
61 |
+
}
|
lib/Inx/Api/Mailing/MultiPartContentHandler.php
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Mailing_MultiPartContentHandler</i> is a simple content handler used to store and update mailing content in
|
9 |
-
* both, plain and HTML text format. Both content parts can be used separately.
|
10 |
-
*
|
11 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
-
* @package Inxmail
|
13 |
-
* @subpackage Mailing
|
14 |
-
*/
|
15 |
-
interface Inx_Api_Mailing_MultiPartContentHandler extends Inx_Api_Mailing_ContentHandler
|
16 |
-
{
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Returns the plain text content stored by this content handler.
|
20 |
-
*
|
21 |
-
* @return string the plain text content.
|
22 |
-
*/
|
23 |
-
public function getPlainTextContent();
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Updates the plain text content stored by this content handler.
|
27 |
-
*
|
28 |
-
* @param string $sPlainTextContent the new plain text content.
|
29 |
-
*/
|
30 |
-
public function updatePlainTextContent( $sPlainTextContent );
|
31 |
-
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Returns the HTML text content stored by this content handler.
|
35 |
-
*
|
36 |
-
* @return string the HTML text content.
|
37 |
-
*/
|
38 |
-
public function getHtmlTextContent();
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Updates the HTML text content stored by this content handler.
|
42 |
-
*
|
43 |
-
* @param string $sHtmlTextContent the new HTML text content.
|
44 |
-
*/
|
45 |
-
public function updateHtmlTextContent( $sHtmlTextContent );
|
46 |
-
|
47 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Mailing_MultiPartContentHandler</i> is a simple content handler used to store and update mailing content in
|
9 |
+
* both, plain and HTML text format. Both content parts can be used separately.
|
10 |
+
*
|
11 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
+
* @package Inxmail
|
13 |
+
* @subpackage Mailing
|
14 |
+
*/
|
15 |
+
interface Inx_Api_Mailing_MultiPartContentHandler extends Inx_Api_Mailing_ContentHandler
|
16 |
+
{
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Returns the plain text content stored by this content handler.
|
20 |
+
*
|
21 |
+
* @return string the plain text content.
|
22 |
+
*/
|
23 |
+
public function getPlainTextContent();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Updates the plain text content stored by this content handler.
|
27 |
+
*
|
28 |
+
* @param string $sPlainTextContent the new plain text content.
|
29 |
+
*/
|
30 |
+
public function updatePlainTextContent( $sPlainTextContent );
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns the HTML text content stored by this content handler.
|
35 |
+
*
|
36 |
+
* @return string the HTML text content.
|
37 |
+
*/
|
38 |
+
public function getHtmlTextContent();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Updates the HTML text content stored by this content handler.
|
42 |
+
*
|
43 |
+
* @param string $sHtmlTextContent the new HTML text content.
|
44 |
+
*/
|
45 |
+
public function updateHtmlTextContent( $sHtmlTextContent );
|
46 |
+
|
47 |
}
|
lib/Inx/Api/Mailing/PlainTextContentHandler.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* Inx_Api_Mailing_PlainTextContentHandler
|
9 |
-
*
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
* @subpackage Mailing
|
13 |
-
*/
|
14 |
-
interface Inx_Api_Mailing_PlainTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
|
15 |
-
{
|
16 |
-
|
17 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* Inx_Api_Mailing_PlainTextContentHandler
|
9 |
+
*
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
* @subpackage Mailing
|
13 |
+
*/
|
14 |
+
interface Inx_Api_Mailing_PlainTextContentHandler extends Inx_Api_Mailing_SinglePartContentHandler
|
15 |
+
{
|
16 |
+
|
17 |
+
}
|
lib/Inx/Api/Mailing/SendException.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Mailing_SendException</i> is thrown when an error occurs while sending a mailing.
|
9 |
-
*
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
* @subpackage Mailing
|
13 |
-
*/
|
14 |
-
class Inx_Api_Mailing_SendException extends Exception
|
15 |
-
{
|
16 |
-
|
17 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Mailing_SendException</i> is thrown when an error occurs while sending a mailing.
|
9 |
+
*
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
* @subpackage Mailing
|
13 |
+
*/
|
14 |
+
class Inx_Api_Mailing_SendException extends Exception
|
15 |
+
{
|
16 |
+
|
17 |
+
}
|
lib/Inx/Api/Mailing/SendingInfo.php
CHANGED
@@ -1,56 +1,56 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mail
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Mailng_SendingInfo</i> object contains additional information regarding the sending of a mailing.
|
9 |
-
* For example, the average mail size or the number of delivered mails.
|
10 |
-
*
|
11 |
-
* @since API 1.4.3
|
12 |
-
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Mail
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Mailing_SendingInfo
|
17 |
-
{
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Returns the number of mailings which were successfully delivered by Inxmail.
|
21 |
-
*
|
22 |
-
* @return int the number of mailings which were successfully delivered by Inxmail.
|
23 |
-
*/
|
24 |
-
public function getDeliveredMailsCount();
|
25 |
-
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Returns the number of mailings which encountered an error while sending.
|
29 |
-
*
|
30 |
-
* @return int the number of mailings which encountered an error while sending.
|
31 |
-
*/
|
32 |
-
public function getSentErrorCount();
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Returns the number of mailings for which bounce messages were received.
|
36 |
-
*
|
37 |
-
* @return int the number of mailings for which bounce messages were received.
|
38 |
-
*/
|
39 |
-
public function getBounceCount();
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Returns the number of mailings which have not been sent by Inxmail, for example because of an existing no-mail tag.
|
43 |
-
*
|
44 |
-
* @return int the number of mailings which have not been sent by Inxmail.
|
45 |
-
*/
|
46 |
-
public function getNotSentMailsCount();
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Returns the average mailing size for the sent mailing.
|
51 |
-
*
|
52 |
-
* @return int the average mailing size for the sent mailing.
|
53 |
-
*/
|
54 |
-
public function getAverageMailSize();
|
55 |
-
}
|
56 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mail
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Mailng_SendingInfo</i> object contains additional information regarding the sending of a mailing.
|
9 |
+
* For example, the average mail size or the number of delivered mails.
|
10 |
+
*
|
11 |
+
* @since API 1.4.3
|
12 |
+
* @version $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Mail
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Mailing_SendingInfo
|
17 |
+
{
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Returns the number of mailings which were successfully delivered by Inxmail.
|
21 |
+
*
|
22 |
+
* @return int the number of mailings which were successfully delivered by Inxmail.
|
23 |
+
*/
|
24 |
+
public function getDeliveredMailsCount();
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the number of mailings which encountered an error while sending.
|
29 |
+
*
|
30 |
+
* @return int the number of mailings which encountered an error while sending.
|
31 |
+
*/
|
32 |
+
public function getSentErrorCount();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns the number of mailings for which bounce messages were received.
|
36 |
+
*
|
37 |
+
* @return int the number of mailings for which bounce messages were received.
|
38 |
+
*/
|
39 |
+
public function getBounceCount();
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Returns the number of mailings which have not been sent by Inxmail, for example because of an existing no-mail tag.
|
43 |
+
*
|
44 |
+
* @return int the number of mailings which have not been sent by Inxmail.
|
45 |
+
*/
|
46 |
+
public function getNotSentMailsCount();
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Returns the average mailing size for the sent mailing.
|
51 |
+
*
|
52 |
+
* @return int the average mailing size for the sent mailing.
|
53 |
+
*/
|
54 |
+
public function getAverageMailSize();
|
55 |
+
}
|
56 |
+
?>
|
lib/Inx/Api/Mailing/SinglePartContentHandler.php
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Mailing_SinglePartContentHandler</i> interface defines the basic requirements of a content
|
9 |
-
* handler that handles only one content type (for example text or HTML).
|
10 |
-
*
|
11 |
-
* @since API 1.2.0
|
12 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Mailing
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Mailing_SinglePartContentHandler extends Inx_Api_Mailing_ContentHandler
|
17 |
-
{
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Returns the content stored by this content handler.
|
21 |
-
*
|
22 |
-
* @return string the content.
|
23 |
-
*/
|
24 |
-
public function getContent();
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Updates the content stored by this content handler.
|
28 |
-
*
|
29 |
-
* @param string $sContent the new content.
|
30 |
-
*/
|
31 |
-
public function updateContent( $sContent );
|
32 |
-
|
33 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Mailing_SinglePartContentHandler</i> interface defines the basic requirements of a content
|
9 |
+
* handler that handles only one content type (for example text or HTML).
|
10 |
+
*
|
11 |
+
* @since API 1.2.0
|
12 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Mailing
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Mailing_SinglePartContentHandler extends Inx_Api_Mailing_ContentHandler
|
17 |
+
{
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Returns the content stored by this content handler.
|
21 |
+
*
|
22 |
+
* @return string the content.
|
23 |
+
*/
|
24 |
+
public function getContent();
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Updates the content stored by this content handler.
|
28 |
+
*
|
29 |
+
* @param string $sContent the new content.
|
30 |
+
*/
|
31 |
+
public function updateContent( $sContent );
|
32 |
+
|
33 |
+
}
|
lib/Inx/Api/Mailing/XsltContentHandler.php
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Mailing_XsltContentHandler</i> defines the basic requirements for a content handler that handles XML based
|
9 |
-
* content. This type of content handler is used by templates to structure (XML content) and format (Style) a mailing.
|
10 |
-
*
|
11 |
-
* @since API 1.2.0
|
12 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Mailing
|
15 |
-
*/
|
16 |
-
interface Inx_Api_Mailing_XsltContentHandler extends Inx_Api_Mailing_ContentHandler
|
17 |
-
{
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Returns the raw XML content stored by this content handler.
|
21 |
-
*
|
22 |
-
* @return string the raw XML content.
|
23 |
-
*/
|
24 |
-
public function getXmlContent();
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Updates the raw XML content stored by this content handler.
|
28 |
-
*
|
29 |
-
* @param string $sContent the new raw XML content.
|
30 |
-
*/
|
31 |
-
public function updateXmlContent( $sContent );
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Returns the style, the mailing has been created with.
|
36 |
-
* The style is used to format the mailing, very similar to a CSS file.
|
37 |
-
*
|
38 |
-
* @return Inx_Api_DesignTemplate_Style the style used to format the mailing.
|
39 |
-
*/
|
40 |
-
public function getStyle();
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Updates the style used for the mailing. The style is used to format the mailing, very similar to a CSS file.
|
44 |
-
*
|
45 |
-
* @param Inx_Api_DesignTemplate_Style style the new style (has to be from the same template as the old one).
|
46 |
-
*/
|
47 |
-
public function updateStyle( Inx_Api_DesignTemplate_Style $oStyle );
|
48 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Mailing_XsltContentHandler</i> defines the basic requirements for a content handler that handles XML based
|
9 |
+
* content. This type of content handler is used by templates to structure (XML content) and format (Style) a mailing.
|
10 |
+
*
|
11 |
+
* @since API 1.2.0
|
12 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Mailing
|
15 |
+
*/
|
16 |
+
interface Inx_Api_Mailing_XsltContentHandler extends Inx_Api_Mailing_ContentHandler
|
17 |
+
{
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Returns the raw XML content stored by this content handler.
|
21 |
+
*
|
22 |
+
* @return string the raw XML content.
|
23 |
+
*/
|
24 |
+
public function getXmlContent();
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Updates the raw XML content stored by this content handler.
|
28 |
+
*
|
29 |
+
* @param string $sContent the new raw XML content.
|
30 |
+
*/
|
31 |
+
public function updateXmlContent( $sContent );
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns the style, the mailing has been created with.
|
36 |
+
* The style is used to format the mailing, very similar to a CSS file.
|
37 |
+
*
|
38 |
+
* @return Inx_Api_DesignTemplate_Style the style used to format the mailing.
|
39 |
+
*/
|
40 |
+
public function getStyle();
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Updates the style used for the mailing. The style is used to format the mailing, very similar to a CSS file.
|
44 |
+
*
|
45 |
+
* @param Inx_Api_DesignTemplate_Style style the new style (has to be from the same template as the old one).
|
46 |
+
*/
|
47 |
+
public function updateStyle( Inx_Api_DesignTemplate_Style $oStyle );
|
48 |
+
}
|
lib/Inx/Api/Mailing/XsltHtmlTextContentHandler.php
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Mailing
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> is a content handler used by templates to structure (XML content) and
|
9 |
-
* format (Style) mailings with HTML text content.
|
10 |
-
* This content handler can only handle HTML content.
|
11 |
-
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
|
12 |
-
*
|
13 |
-
* @since API 1.0.1
|
14 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
15 |
-
* @package Inxmail
|
16 |
-
* @subpackage Mailing
|
17 |
-
*/
|
18 |
-
interface Inx_Api_Mailing_XsltHtmlTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
19 |
-
{
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Returns the HTML style XML content stored by this content handler.
|
23 |
-
*
|
24 |
-
* @return string the HTML style XML content.
|
25 |
-
*/
|
26 |
-
public function getHtmlTextXslt();
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Updates the HTML style XML content stored by this content handler.
|
30 |
-
*
|
31 |
-
* @param string $sHtmlTextXslt the HTML style XML content.
|
32 |
-
*/
|
33 |
-
public function updateHtmlTextXslt( $sHtmlTextXslt );
|
34 |
-
|
35 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Mailing
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Mailing_XsltHtmlTextContentHandler</i> is a content handler used by templates to structure (XML content) and
|
9 |
+
* format (Style) mailings with HTML text content.
|
10 |
+
* This content handler can only handle HTML content.
|
11 |
+
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
|
12 |
+
*
|
13 |
+
* @since API 1.0.1
|
14 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
15 |
+
* @package Inxmail
|
16 |
+
* @subpackage Mailing
|
17 |
+
*/
|
18 |
+
interface Inx_Api_Mailing_XsltHtmlTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
19 |
+
{
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Returns the HTML style XML content stored by this content handler.
|
23 |
+
*
|
24 |
+
* @return string the HTML style XML content.
|
25 |
+
*/
|
26 |
+
public function getHtmlTextXslt();
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Updates the HTML style XML content stored by this content handler.
|
30 |
+
*
|
31 |
+
* @param string $sHtmlTextXslt the HTML style XML content.
|
32 |
+
*/
|
33 |
+
public function updateHtmlTextXslt( $sHtmlTextXslt );
|
34 |
+
|
35 |
}
|
lib/Inx/Api/Mailing/XsltMultiPartContentHandler.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> is a content handler used by templates to structure (XML content) and
|
8 |
-
* format (Style) mailings with both, plain and HTML text content. Both content parts can be used separately.
|
9 |
-
*
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
* @subpackage Mailing
|
13 |
-
*/
|
14 |
-
interface Inx_Api_Mailing_XsltMultiPartContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Returns the plain text style XML content stored by this content handler.
|
18 |
-
*
|
19 |
-
* @return string the plain text style XML content.
|
20 |
-
*/
|
21 |
-
public function getPlainTextXslt();
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Updates the plain text style XML content stored by this content handler.
|
26 |
-
*
|
27 |
-
* @param String $sPlainTextXslt the new plain text style XML content.
|
28 |
-
*/
|
29 |
-
public function updatePlainTextXslt( $sPlainTextXslt );
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Returns the HTML style XML content stored by this content handler.
|
33 |
-
*
|
34 |
-
* @return string the HTML style XML content.
|
35 |
-
*/
|
36 |
-
public function getHtmlTextXslt();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Updates the HTML style XML content stored by this content handler.
|
40 |
-
*
|
41 |
-
* @param String $sHtmlTextXslt the new HTML style XML content.
|
42 |
-
*/
|
43 |
-
public function updateHtmlTextXslt( $sHtmlTextXslt );
|
44 |
-
|
45 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> is a content handler used by templates to structure (XML content) and
|
8 |
+
* format (Style) mailings with both, plain and HTML text content. Both content parts can be used separately.
|
9 |
+
*
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
* @subpackage Mailing
|
13 |
+
*/
|
14 |
+
interface Inx_Api_Mailing_XsltMultiPartContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Returns the plain text style XML content stored by this content handler.
|
18 |
+
*
|
19 |
+
* @return string the plain text style XML content.
|
20 |
+
*/
|
21 |
+
public function getPlainTextXslt();
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Updates the plain text style XML content stored by this content handler.
|
26 |
+
*
|
27 |
+
* @param String $sPlainTextXslt the new plain text style XML content.
|
28 |
+
*/
|
29 |
+
public function updatePlainTextXslt( $sPlainTextXslt );
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns the HTML style XML content stored by this content handler.
|
33 |
+
*
|
34 |
+
* @return string the HTML style XML content.
|
35 |
+
*/
|
36 |
+
public function getHtmlTextXslt();
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Updates the HTML style XML content stored by this content handler.
|
40 |
+
*
|
41 |
+
* @param String $sHtmlTextXslt the new HTML style XML content.
|
42 |
+
*/
|
43 |
+
public function updateHtmlTextXslt( $sHtmlTextXslt );
|
44 |
+
|
45 |
+
}
|
lib/Inx/Api/Mailing/XsltPlainTextContentHandler.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Mailing
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> is a content handler used by templates to structure (XML content) and
|
8 |
-
* format (Style) mailings with plain text content.
|
9 |
-
* This content handler can only handle plain text content.
|
10 |
-
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
|
11 |
-
*
|
12 |
-
* @since API 1.0.1
|
13 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage Mailing
|
16 |
-
*/
|
17 |
-
interface Inx_Api_Mailing_XsltPlainTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
18 |
-
{
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Returns the plain text style XML content stored by this content handler.
|
22 |
-
*
|
23 |
-
* @return string the plain text style XML content.
|
24 |
-
*/
|
25 |
-
public function getPlainTextXslt();
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Updates the plain text style XML content stored by this content handler.
|
29 |
-
*
|
30 |
-
* @param string $sPlainTextXslt the new plain text style XML content.
|
31 |
-
*/
|
32 |
-
public function updatePlainTextXslt( $sPlainTextXslt );
|
33 |
-
|
34 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Mailing
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Mailing_XsltPlainTextContentHandler</i> is a content handler used by templates to structure (XML content) and
|
8 |
+
* format (Style) mailings with plain text content.
|
9 |
+
* This content handler can only handle plain text content.
|
10 |
+
* If you wish to use both, plain and HTML text content, use the <i>Inx_Api_Mailing_XsltMultiPartContentHandler</i> instead.
|
11 |
+
*
|
12 |
+
* @since API 1.0.1
|
13 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage Mailing
|
16 |
+
*/
|
17 |
+
interface Inx_Api_Mailing_XsltPlainTextContentHandler extends Inx_Api_Mailing_XsltContentHandler
|
18 |
+
{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Returns the plain text style XML content stored by this content handler.
|
22 |
+
*
|
23 |
+
* @return string the plain text style XML content.
|
24 |
+
*/
|
25 |
+
public function getPlainTextXslt();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Updates the plain text style XML content stored by this content handler.
|
29 |
+
*
|
30 |
+
* @param string $sPlainTextXslt the new plain text style XML content.
|
31 |
+
*/
|
32 |
+
public function updatePlainTextXslt( $sPlainTextXslt );
|
33 |
+
|
34 |
}
|
lib/Inx/Api/MailingTemplate/MailingTemplate.php
CHANGED
@@ -1,130 +1,130 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage MailingTemplate
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_MailingTemplate_MailingTemplate</i> represents reusable mailing content that can be used as a basis
|
8 |
-
* for new mailings.
|
9 |
-
* These templates are far less powerful than the templates provided by design collections, but can still save time in
|
10 |
-
* the creation of complex mailings with a common structure.
|
11 |
-
* <p>
|
12 |
-
* For an example on how to retrieve and create <i>MailingTemplate</i>s, see the
|
13 |
-
* <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> documentation.
|
14 |
-
*
|
15 |
-
* @see Inx_Api_MailingTemplate_MailingTemplateManager
|
16 |
-
* @since API 1.4.0
|
17 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $*
|
18 |
-
* @package Inxmail
|
19 |
-
* @subpackage MailingTemplate
|
20 |
-
*/
|
21 |
-
interface Inx_Api_MailingTemplate_MailingTemplate extends Inx_Api_BusinessObject
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* MIME type constant for HTML text templates. This template has only a HTML text part.
|
25 |
-
*/
|
26 |
-
const MIME_TYPE_HTML_TEXT = 0;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* MIME type constant for plain text templates. This template has only a plain text part.
|
30 |
-
*/
|
31 |
-
const MIME_TYPE_PLAIN_TEXT = 1;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* MIME type constant for multipart templates. This template has a HTML and a plain text part.
|
35 |
-
*/
|
36 |
-
const MIME_TYPE_MULTIPART = 2;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Constant for the name attribute. Used for ordering by the <i>Inx_Api_MailingTemplate_MailingTemplateManager</i>.
|
40 |
-
*
|
41 |
-
* @see Inx_Api_MailingTemplate_MailingTemplateManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
42 |
-
*/
|
43 |
-
const ATTRIBUTE_NAME = 0;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Constant for the plain text attribute.
|
47 |
-
*/
|
48 |
-
const ATTRIBUTE_PLAIN_TEXT = 1;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Constant for the HTML text attribute.
|
52 |
-
*/
|
53 |
-
const ATTRIBUTE_HTML_TEXT = 2;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Constant for the list context id attribute.
|
57 |
-
*/
|
58 |
-
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Constant for the MIME type attribute.
|
62 |
-
*/
|
63 |
-
const ATTRIBUTE_MIME_TYPE = 4;
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Returns the name of the mailing template.
|
67 |
-
*
|
68 |
-
* @return string the name of the mailing template.
|
69 |
-
*/
|
70 |
-
public function getName();
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Updates the name of the mailing template.
|
74 |
-
* The mailing template will not be updated on the server until <i>commitUpdate()</i> has been called.
|
75 |
-
*
|
76 |
-
* @param string $sName the new template name.
|
77 |
-
*/
|
78 |
-
public function updateName( $sName );
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Returns the id of the list which this mailing template belongs to.
|
82 |
-
*
|
83 |
-
* @return int the id of the list which this mailing template belongs to.
|
84 |
-
*/
|
85 |
-
public function getListContextId();
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Returns the MIME type of this mailing template. May be one of:
|
89 |
-
* <ul>
|
90 |
-
* <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
|
91 |
-
* <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
|
92 |
-
* <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
|
93 |
-
* </ul>
|
94 |
-
*
|
95 |
-
* @return int the MIME type of this mailing template.
|
96 |
-
*/
|
97 |
-
public function getMimeType();
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Returns the HTML text part of this mailing template, or <i>null</i> if the MIME type is
|
101 |
-
* <i>MIME_TYPE_PLAIN_TEXT</i>.
|
102 |
-
*
|
103 |
-
* @return string the HTML text part of this mailing template, if any.
|
104 |
-
*/
|
105 |
-
public function getHtmlTextContent();
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Updates the HTML text part of this mailing template. The mailing template will not be updated on the server until
|
109 |
-
* <i>commitUpdate()</i> has been called.
|
110 |
-
*
|
111 |
-
* @param string $sHtmlTextContent the new HTML text part.
|
112 |
-
*/
|
113 |
-
public function updateHtmlTextContent( $sHtmlTextContent );
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Returns the plain text part of this mailing template, or <code>null</code> if the MIME type is
|
117 |
-
* <i>MIME_TYPE_HTML_TEXT</i>.
|
118 |
-
*
|
119 |
-
* @return string the plain text part of this mailing template, if any.
|
120 |
-
*/
|
121 |
-
public function getPlainTextContent();
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Updates the plain text part of the mailing template. The mailing template will not be updated on the server until
|
125 |
-
* <i>commitUpdate()</i> has been called.
|
126 |
-
*
|
127 |
-
* @param string $sPlainTextContent the new plain text part.
|
128 |
-
*/
|
129 |
-
public function updatePlainTextContent( $sPlainTextContent );
|
130 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage MailingTemplate
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_MailingTemplate_MailingTemplate</i> represents reusable mailing content that can be used as a basis
|
8 |
+
* for new mailings.
|
9 |
+
* These templates are far less powerful than the templates provided by design collections, but can still save time in
|
10 |
+
* the creation of complex mailings with a common structure.
|
11 |
+
* <p>
|
12 |
+
* For an example on how to retrieve and create <i>MailingTemplate</i>s, see the
|
13 |
+
* <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> documentation.
|
14 |
+
*
|
15 |
+
* @see Inx_Api_MailingTemplate_MailingTemplateManager
|
16 |
+
* @since API 1.4.0
|
17 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $*
|
18 |
+
* @package Inxmail
|
19 |
+
* @subpackage MailingTemplate
|
20 |
+
*/
|
21 |
+
interface Inx_Api_MailingTemplate_MailingTemplate extends Inx_Api_BusinessObject
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* MIME type constant for HTML text templates. This template has only a HTML text part.
|
25 |
+
*/
|
26 |
+
const MIME_TYPE_HTML_TEXT = 0;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* MIME type constant for plain text templates. This template has only a plain text part.
|
30 |
+
*/
|
31 |
+
const MIME_TYPE_PLAIN_TEXT = 1;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* MIME type constant for multipart templates. This template has a HTML and a plain text part.
|
35 |
+
*/
|
36 |
+
const MIME_TYPE_MULTIPART = 2;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constant for the name attribute. Used for ordering by the <i>Inx_Api_MailingTemplate_MailingTemplateManager</i>.
|
40 |
+
*
|
41 |
+
* @see Inx_Api_MailingTemplate_MailingTemplateManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
42 |
+
*/
|
43 |
+
const ATTRIBUTE_NAME = 0;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Constant for the plain text attribute.
|
47 |
+
*/
|
48 |
+
const ATTRIBUTE_PLAIN_TEXT = 1;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Constant for the HTML text attribute.
|
52 |
+
*/
|
53 |
+
const ATTRIBUTE_HTML_TEXT = 2;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Constant for the list context id attribute.
|
57 |
+
*/
|
58 |
+
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Constant for the MIME type attribute.
|
62 |
+
*/
|
63 |
+
const ATTRIBUTE_MIME_TYPE = 4;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns the name of the mailing template.
|
67 |
+
*
|
68 |
+
* @return string the name of the mailing template.
|
69 |
+
*/
|
70 |
+
public function getName();
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Updates the name of the mailing template.
|
74 |
+
* The mailing template will not be updated on the server until <i>commitUpdate()</i> has been called.
|
75 |
+
*
|
76 |
+
* @param string $sName the new template name.
|
77 |
+
*/
|
78 |
+
public function updateName( $sName );
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Returns the id of the list which this mailing template belongs to.
|
82 |
+
*
|
83 |
+
* @return int the id of the list which this mailing template belongs to.
|
84 |
+
*/
|
85 |
+
public function getListContextId();
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Returns the MIME type of this mailing template. May be one of:
|
89 |
+
* <ul>
|
90 |
+
* <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
|
91 |
+
* <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
|
92 |
+
* <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
|
93 |
+
* </ul>
|
94 |
+
*
|
95 |
+
* @return int the MIME type of this mailing template.
|
96 |
+
*/
|
97 |
+
public function getMimeType();
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns the HTML text part of this mailing template, or <i>null</i> if the MIME type is
|
101 |
+
* <i>MIME_TYPE_PLAIN_TEXT</i>.
|
102 |
+
*
|
103 |
+
* @return string the HTML text part of this mailing template, if any.
|
104 |
+
*/
|
105 |
+
public function getHtmlTextContent();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Updates the HTML text part of this mailing template. The mailing template will not be updated on the server until
|
109 |
+
* <i>commitUpdate()</i> has been called.
|
110 |
+
*
|
111 |
+
* @param string $sHtmlTextContent the new HTML text part.
|
112 |
+
*/
|
113 |
+
public function updateHtmlTextContent( $sHtmlTextContent );
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns the plain text part of this mailing template, or <code>null</code> if the MIME type is
|
117 |
+
* <i>MIME_TYPE_HTML_TEXT</i>.
|
118 |
+
*
|
119 |
+
* @return string the plain text part of this mailing template, if any.
|
120 |
+
*/
|
121 |
+
public function getPlainTextContent();
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Updates the plain text part of the mailing template. The mailing template will not be updated on the server until
|
125 |
+
* <i>commitUpdate()</i> has been called.
|
126 |
+
*
|
127 |
+
* @param string $sPlainTextContent the new plain text part.
|
128 |
+
*/
|
129 |
+
public function updatePlainTextContent( $sPlainTextContent );
|
130 |
+
}
|
lib/Inx/Api/MailingTemplate/MailingTemplateManager.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage MailingTemplate
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> can be used to manage mailing templates.
|
8 |
-
* This includes the retrieval and creation of <i>Inx_Api_MailingTemplate_MailingTemplate</i>s.
|
9 |
-
* <p>
|
10 |
-
* To retrieve or create a globally available mailing template, use the system list. The following snippet shows how to
|
11 |
-
* retrieve all global mailing templates ordered by name:
|
12 |
-
*
|
13 |
-
* <pre>
|
14 |
-
* $oMailingTemplateManager = $oSession->getMailingTemplateManager();
|
15 |
-
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
-
*
|
17 |
-
* $oBOResultSet = $oMailingTemplateManager->select( $oSystemListContext,
|
18 |
-
* Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
|
19 |
-
*
|
20 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
21 |
-
* {
|
22 |
-
* $oMailingTemplate = $oBOResultSet->get( $i );
|
23 |
-
* echo $oMailingTemplate->getName()."<br>";
|
24 |
-
* }
|
25 |
-
*
|
26 |
-
* $oBOResultSet->close();
|
27 |
-
* </pre>
|
28 |
-
*
|
29 |
-
* To retrieve all mailing templates, disregarding their list membership, use the inherited <i>selectAll()</i> method.
|
30 |
-
* <p>
|
31 |
-
* Be aware that mailing template names are not nullable and are unique in each list.
|
32 |
-
* However, it is possible to have two mailing templates with the same name in different lists.
|
33 |
-
* The following snippet shows how to create an <i>Inx_Api_MailingTemplate_MailingTemplate</i> and update its name:
|
34 |
-
*
|
35 |
-
* <pre>
|
36 |
-
* $oMailingTemplateManager = $oSession->getMailingTemplateManager();
|
37 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
38 |
-
* $oMailingTemplate = $oMailingTemplateManager->createTemplate( $oListContext,
|
39 |
-
* Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT );
|
40 |
-
*
|
41 |
-
* $oMailingTemplate->updateName( "Desired name" );
|
42 |
-
* $oMailingTemplate->commitUpdate();
|
43 |
-
* </pre>
|
44 |
-
* <p>
|
45 |
-
* The usage of mailing templates requires the api user right: <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
|
46 |
-
* <p>
|
47 |
-
* For more information on mailing templates, see the <i>Inx_Api_MailingTemplate_MailingTemplate</i> documentation.
|
48 |
-
*
|
49 |
-
* @see Inx_Api_MailingTemplate_MailingTemplate
|
50 |
-
* @since API 1.4.0
|
51 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
52 |
-
* @package Inxmail
|
53 |
-
* @subpackage MailingTemplate
|
54 |
-
*/
|
55 |
-
interface Inx_Api_MailingTemplate_MailingTemplateManager extends Inx_Api_BOManager
|
56 |
-
{
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Creates a mailing template in the specified list with the specified MIME type.
|
60 |
-
*
|
61 |
-
* @param Inx_Api_List_ListContext $oListContext the list this template belongs to.
|
62 |
-
* @param int $iMimeType the MIME type of this template. May be one of:
|
63 |
-
* <ul>
|
64 |
-
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT</i>,
|
65 |
-
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_PLAIN_TEXT</i> or
|
66 |
-
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_MULTIPART</i>
|
67 |
-
* </ul>
|
68 |
-
* @return Inx_Api_MailingTemplate_MailingTempalte a new mailing template.
|
69 |
-
*/
|
70 |
-
public function createTemplate( Inx_Api_List_ListContext $oListContext, $iMimeType );
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Returns an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list, ordered by the
|
74 |
-
* given attribute and order type.
|
75 |
-
* To retrieve the globally available mailing templates, use the system list.
|
76 |
-
* <p>
|
77 |
-
* The following snippet shows how to retrieve the system list context:
|
78 |
-
*
|
79 |
-
* <pre>
|
80 |
-
* $oSystemListContext = $oSession->getListContextManager()->findByName(
|
81 |
-
* Inx_Api_List_SystemListContext::NAME );
|
82 |
-
* </pre>
|
83 |
-
*
|
84 |
-
* @param Inx_Api_List_ListContext $oListContext all mailing templates assigned to this list will be fetched.
|
85 |
-
* This parameter may <strong>not</strong> be <i>null</i>.
|
86 |
-
* If you wish to retrieve all mailing templates, use <i>selectAll()</i> instead.
|
87 |
-
* @param int $iOrderAttribute the id of the attribute used to order the result (only
|
88 |
-
* <i>Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME</i>).
|
89 |
-
* Be aware that any other attribute as well as ommitting this parameter will default to the name attribute.
|
90 |
-
* @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
|
91 |
-
* May be ommitted if $iOrderAttribute is ommitted as well.
|
92 |
-
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list.
|
93 |
-
*/
|
94 |
-
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = -1, $iOrderType = -1 );
|
95 |
-
|
96 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage MailingTemplate
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_MailingTemplate_MailingTemplateManager</i> can be used to manage mailing templates.
|
8 |
+
* This includes the retrieval and creation of <i>Inx_Api_MailingTemplate_MailingTemplate</i>s.
|
9 |
+
* <p>
|
10 |
+
* To retrieve or create a globally available mailing template, use the system list. The following snippet shows how to
|
11 |
+
* retrieve all global mailing templates ordered by name:
|
12 |
+
*
|
13 |
+
* <pre>
|
14 |
+
* $oMailingTemplateManager = $oSession->getMailingTemplateManager();
|
15 |
+
* $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
16 |
+
*
|
17 |
+
* $oBOResultSet = $oMailingTemplateManager->select( $oSystemListContext,
|
18 |
+
* Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
|
19 |
+
*
|
20 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
21 |
+
* {
|
22 |
+
* $oMailingTemplate = $oBOResultSet->get( $i );
|
23 |
+
* echo $oMailingTemplate->getName()."<br>";
|
24 |
+
* }
|
25 |
+
*
|
26 |
+
* $oBOResultSet->close();
|
27 |
+
* </pre>
|
28 |
+
*
|
29 |
+
* To retrieve all mailing templates, disregarding their list membership, use the inherited <i>selectAll()</i> method.
|
30 |
+
* <p>
|
31 |
+
* Be aware that mailing template names are not nullable and are unique in each list.
|
32 |
+
* However, it is possible to have two mailing templates with the same name in different lists.
|
33 |
+
* The following snippet shows how to create an <i>Inx_Api_MailingTemplate_MailingTemplate</i> and update its name:
|
34 |
+
*
|
35 |
+
* <pre>
|
36 |
+
* $oMailingTemplateManager = $oSession->getMailingTemplateManager();
|
37 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
|
38 |
+
* $oMailingTemplate = $oMailingTemplateManager->createTemplate( $oListContext,
|
39 |
+
* Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT );
|
40 |
+
*
|
41 |
+
* $oMailingTemplate->updateName( "Desired name" );
|
42 |
+
* $oMailingTemplate->commitUpdate();
|
43 |
+
* </pre>
|
44 |
+
* <p>
|
45 |
+
* The usage of mailing templates requires the api user right: <i>Inx_Api_UserRights::TEMPLATE_FEATURE_USE</i>
|
46 |
+
* <p>
|
47 |
+
* For more information on mailing templates, see the <i>Inx_Api_MailingTemplate_MailingTemplate</i> documentation.
|
48 |
+
*
|
49 |
+
* @see Inx_Api_MailingTemplate_MailingTemplate
|
50 |
+
* @since API 1.4.0
|
51 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
52 |
+
* @package Inxmail
|
53 |
+
* @subpackage MailingTemplate
|
54 |
+
*/
|
55 |
+
interface Inx_Api_MailingTemplate_MailingTemplateManager extends Inx_Api_BOManager
|
56 |
+
{
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Creates a mailing template in the specified list with the specified MIME type.
|
60 |
+
*
|
61 |
+
* @param Inx_Api_List_ListContext $oListContext the list this template belongs to.
|
62 |
+
* @param int $iMimeType the MIME type of this template. May be one of:
|
63 |
+
* <ul>
|
64 |
+
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT</i>,
|
65 |
+
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_PLAIN_TEXT</i> or
|
66 |
+
* <li><i>Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_MULTIPART</i>
|
67 |
+
* </ul>
|
68 |
+
* @return Inx_Api_MailingTemplate_MailingTempalte a new mailing template.
|
69 |
+
*/
|
70 |
+
public function createTemplate( Inx_Api_List_ListContext $oListContext, $iMimeType );
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list, ordered by the
|
74 |
+
* given attribute and order type.
|
75 |
+
* To retrieve the globally available mailing templates, use the system list.
|
76 |
+
* <p>
|
77 |
+
* The following snippet shows how to retrieve the system list context:
|
78 |
+
*
|
79 |
+
* <pre>
|
80 |
+
* $oSystemListContext = $oSession->getListContextManager()->findByName(
|
81 |
+
* Inx_Api_List_SystemListContext::NAME );
|
82 |
+
* </pre>
|
83 |
+
*
|
84 |
+
* @param Inx_Api_List_ListContext $oListContext all mailing templates assigned to this list will be fetched.
|
85 |
+
* This parameter may <strong>not</strong> be <i>null</i>.
|
86 |
+
* If you wish to retrieve all mailing templates, use <i>selectAll()</i> instead.
|
87 |
+
* @param int $iOrderAttribute the id of the attribute used to order the result (only
|
88 |
+
* <i>Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME</i>).
|
89 |
+
* Be aware that any other attribute as well as ommitting this parameter will default to the name attribute.
|
90 |
+
* @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
|
91 |
+
* May be ommitted if $iOrderAttribute is ommitted as well.
|
92 |
+
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all mailing templates assigned to the given list.
|
93 |
+
*/
|
94 |
+
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute = -1, $iOrderType = -1 );
|
95 |
+
|
96 |
+
}
|
lib/Inx/Api/NameException.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* An <i>Inx_Api_NameException</i> is thrown when a specified name (e.g. attribute name) is invalid or already used.
|
7 |
-
*
|
8 |
-
* @see Inx_Api_Recipient_AttributeManager#create(string, int, int)
|
9 |
-
* @since API 1.0
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
*/
|
13 |
-
class Inx_Api_NameException extends Exception
|
14 |
-
{
|
15 |
-
/** Type indicating that the specified name is already used. */
|
16 |
-
const DUPLICATE_NAME = 100;
|
17 |
-
|
18 |
-
/** Type indicating that the specified name is invalid. */
|
19 |
-
const ILLEGAL_NAME = 101;
|
20 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* An <i>Inx_Api_NameException</i> is thrown when a specified name (e.g. attribute name) is invalid or already used.
|
7 |
+
*
|
8 |
+
* @see Inx_Api_Recipient_AttributeManager#create(string, int, int)
|
9 |
+
* @since API 1.0
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
*/
|
13 |
+
class Inx_Api_NameException extends Exception
|
14 |
+
{
|
15 |
+
/** Type indicating that the specified name is already used. */
|
16 |
+
const DUPLICATE_NAME = 100;
|
17 |
+
|
18 |
+
/** Type indicating that the specified name is invalid. */
|
19 |
+
const ILLEGAL_NAME = 101;
|
20 |
+
}
|
lib/Inx/Api/NullPointerException.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
|
6 |
-
/**
|
7 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
8 |
-
* @package Inxmail
|
9 |
-
*/
|
10 |
-
class Inx_Api_NullPointerException extends Exception
|
11 |
-
{
|
12 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
8 |
+
* @package Inxmail
|
9 |
+
*/
|
10 |
+
class Inx_Api_NullPointerException extends Exception
|
11 |
+
{
|
12 |
+
}
|
lib/Inx/Api/Order.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* Defines the order types, used by selections in result sets.
|
7 |
-
*
|
8 |
-
* @since API 1.0.1
|
9 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
10 |
-
* @package Inxmail
|
11 |
-
*/
|
12 |
-
interface Inx_Api_Order
|
13 |
-
{
|
14 |
-
/** Ascending order type. */
|
15 |
-
const ASC = 0;
|
16 |
-
|
17 |
-
/** Descending order type. */
|
18 |
-
const DESC = 1;
|
19 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* Defines the order types, used by selections in result sets.
|
7 |
+
*
|
8 |
+
* @since API 1.0.1
|
9 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
10 |
+
* @package Inxmail
|
11 |
+
*/
|
12 |
+
interface Inx_Api_Order
|
13 |
+
{
|
14 |
+
/** Ascending order type. */
|
15 |
+
const ASC = 0;
|
16 |
+
|
17 |
+
/** Descending order type. */
|
18 |
+
const DESC = 1;
|
19 |
+
}
|
lib/Inx/Api/Plugin/PluginStore.php
CHANGED
@@ -1,99 +1,99 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Plugin
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Plugin_PluginStore</i> is used by plug-ins for storing small amounts of data on the Inxmail
|
9 |
-
* Professional system.
|
10 |
-
* Each plug-in may only use its isolated storage, identified by the plug-in secret.
|
11 |
-
* The data is allocated using unique keys.
|
12 |
-
* <p>
|
13 |
-
* <strong>Note:</strong> It is <strong>strongly recommended</strong> to upload a maximum of 1 MB of data.
|
14 |
-
* Uploading too much data may significantly reduce the performance of the server.
|
15 |
-
* <p>
|
16 |
-
* The following snippet shows how to upload an image to the plug-in store of a plug-in with the secret id
|
17 |
-
* "plug-in secret":
|
18 |
-
*
|
19 |
-
* <pre>
|
20 |
-
* $oPluginStore = $oSession->getPluginStore();
|
21 |
-
* $handle = fopen("test.png","r");
|
22 |
-
* $oPluginStore->put("plug-in secret","test-image",$handle);
|
23 |
-
* </pre>
|
24 |
-
* <p>
|
25 |
-
* The following snippet shows how to download the previously uploaded image for saving and displaying:
|
26 |
-
*
|
27 |
-
* <pre>
|
28 |
-
* $oPluginStore = $oSession->getPluginStore();
|
29 |
-
* $oInputStream = $oPluginStore->get("plug-in secret", "test-image");
|
30 |
-
*
|
31 |
-
* $validate = fopen("validate.png",'w') or die("can't open file");
|
32 |
-
*
|
33 |
-
* while(($chunk = $oInputStream->read()) != -1)
|
34 |
-
* {
|
35 |
-
* fwrite($validate,$chunk);
|
36 |
-
* }
|
37 |
-
*
|
38 |
-
* fclose($validate);
|
39 |
-
*
|
40 |
-
* echo '<img src="validate.png">';
|
41 |
-
* </pre>
|
42 |
-
*
|
43 |
-
* @since API 1.7.0
|
44 |
-
* @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
|
45 |
-
* @package Inxmail
|
46 |
-
* @subpackage Plugin
|
47 |
-
*/
|
48 |
-
interface Inx_Api_Plugin_PluginStore
|
49 |
-
{
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Uploads data from a plug-in which needs to be stored in Inxmail Professional.
|
53 |
-
* The data should be no bigger than 1 MB.
|
54 |
-
* Uploading more data is <strong>strongly discouraged</strong> as it may significantly reduce the performance of the server.
|
55 |
-
*
|
56 |
-
* @param string $secretId the secret id of the plug-in.
|
57 |
-
* @param string $key the key for the uploaded data.
|
58 |
-
* @param Inx_Api_InputStream $is the input stream to read the data from.
|
59 |
-
* @return bool <i>true</i> if the upload was successful, <i>false</i> otherwise.
|
60 |
-
*/
|
61 |
-
public function put( $secretId, $key, $is );
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Returns an <i>Inx_Api_InputStream</i> to download the data for the given key.
|
66 |
-
*
|
67 |
-
* @param string $secretId the secret id of the plug-in.
|
68 |
-
* @param string $key the key of the data to download.
|
69 |
-
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the data.
|
70 |
-
* @throws Inx_Api_DataException if the there is no data for that key (i.e. the key does not exist).
|
71 |
-
*/
|
72 |
-
public function get( $secretId, $key );
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Returns all keys which are stored for the given plug-in secret id.
|
77 |
-
*
|
78 |
-
* @param string $secretId the secret id of the plug-in.
|
79 |
-
* @return array an array of string keys.
|
80 |
-
*/
|
81 |
-
public function getKeys( $secretId );
|
82 |
-
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Removes the given key and its value from the plug-in store. Removing an unknown key will have no effect.
|
86 |
-
*
|
87 |
-
* @param string $secretId the secret id of the plug-in.
|
88 |
-
* @param string $key the key of the data which should be deleted.
|
89 |
-
*/
|
90 |
-
public function remove( $secretId, $key );
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Removes all keys from the plug-in store for the given plug-in secret id.
|
95 |
-
*
|
96 |
-
* @param string $secretId the secret id of the plug-in.
|
97 |
-
*/
|
98 |
-
public function removeAll( $secretId );
|
99 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Plugin
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Plugin_PluginStore</i> is used by plug-ins for storing small amounts of data on the Inxmail
|
9 |
+
* Professional system.
|
10 |
+
* Each plug-in may only use its isolated storage, identified by the plug-in secret.
|
11 |
+
* The data is allocated using unique keys.
|
12 |
+
* <p>
|
13 |
+
* <strong>Note:</strong> It is <strong>strongly recommended</strong> to upload a maximum of 1 MB of data.
|
14 |
+
* Uploading too much data may significantly reduce the performance of the server.
|
15 |
+
* <p>
|
16 |
+
* The following snippet shows how to upload an image to the plug-in store of a plug-in with the secret id
|
17 |
+
* "plug-in secret":
|
18 |
+
*
|
19 |
+
* <pre>
|
20 |
+
* $oPluginStore = $oSession->getPluginStore();
|
21 |
+
* $handle = fopen("test.png","r");
|
22 |
+
* $oPluginStore->put("plug-in secret","test-image",$handle);
|
23 |
+
* </pre>
|
24 |
+
* <p>
|
25 |
+
* The following snippet shows how to download the previously uploaded image for saving and displaying:
|
26 |
+
*
|
27 |
+
* <pre>
|
28 |
+
* $oPluginStore = $oSession->getPluginStore();
|
29 |
+
* $oInputStream = $oPluginStore->get("plug-in secret", "test-image");
|
30 |
+
*
|
31 |
+
* $validate = fopen("validate.png",'w') or die("can't open file");
|
32 |
+
*
|
33 |
+
* while(($chunk = $oInputStream->read()) != -1)
|
34 |
+
* {
|
35 |
+
* fwrite($validate,$chunk);
|
36 |
+
* }
|
37 |
+
*
|
38 |
+
* fclose($validate);
|
39 |
+
*
|
40 |
+
* echo '<img src="validate.png">';
|
41 |
+
* </pre>
|
42 |
+
*
|
43 |
+
* @since API 1.7.0
|
44 |
+
* @version $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
|
45 |
+
* @package Inxmail
|
46 |
+
* @subpackage Plugin
|
47 |
+
*/
|
48 |
+
interface Inx_Api_Plugin_PluginStore
|
49 |
+
{
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Uploads data from a plug-in which needs to be stored in Inxmail Professional.
|
53 |
+
* The data should be no bigger than 1 MB.
|
54 |
+
* Uploading more data is <strong>strongly discouraged</strong> as it may significantly reduce the performance of the server.
|
55 |
+
*
|
56 |
+
* @param string $secretId the secret id of the plug-in.
|
57 |
+
* @param string $key the key for the uploaded data.
|
58 |
+
* @param Inx_Api_InputStream $is the input stream to read the data from.
|
59 |
+
* @return bool <i>true</i> if the upload was successful, <i>false</i> otherwise.
|
60 |
+
*/
|
61 |
+
public function put( $secretId, $key, $is );
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns an <i>Inx_Api_InputStream</i> to download the data for the given key.
|
66 |
+
*
|
67 |
+
* @param string $secretId the secret id of the plug-in.
|
68 |
+
* @param string $key the key of the data to download.
|
69 |
+
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the data.
|
70 |
+
* @throws Inx_Api_DataException if the there is no data for that key (i.e. the key does not exist).
|
71 |
+
*/
|
72 |
+
public function get( $secretId, $key );
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Returns all keys which are stored for the given plug-in secret id.
|
77 |
+
*
|
78 |
+
* @param string $secretId the secret id of the plug-in.
|
79 |
+
* @return array an array of string keys.
|
80 |
+
*/
|
81 |
+
public function getKeys( $secretId );
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Removes the given key and its value from the plug-in store. Removing an unknown key will have no effect.
|
86 |
+
*
|
87 |
+
* @param string $secretId the secret id of the plug-in.
|
88 |
+
* @param string $key the key of the data which should be deleted.
|
89 |
+
*/
|
90 |
+
public function remove( $secretId, $key );
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Removes all keys from the plug-in store for the given plug-in secret id.
|
95 |
+
*
|
96 |
+
* @param string $secretId the secret id of the plug-in.
|
97 |
+
*/
|
98 |
+
public function removeAll( $secretId );
|
99 |
+
}
|
lib/Inx/Api/PluginStatusService.php
CHANGED
@@ -1,110 +1,110 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
|
6 |
-
|
7 |
-
abstract class Inx_Api_PluginStatusService
|
8 |
-
{
|
9 |
-
protected $oService;
|
10 |
-
|
11 |
-
protected static $_aProperties = array();
|
12 |
-
protected $_sApplicationUrl = null;
|
13 |
-
|
14 |
-
public static function create( $applicationUrl )
|
15 |
-
{
|
16 |
-
try
|
17 |
-
{
|
18 |
-
return new Inx_Apiimpl_AxisPluginStatusService($applicationUrl);
|
19 |
-
}
|
20 |
-
catch( Exception $x )
|
21 |
-
{
|
22 |
-
throw new Inx_Api_APIException( "Unknown error in PluginStatusService", $x );
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
public function isPluginInstalled( $sPluginSecretId )
|
28 |
-
{
|
29 |
-
try
|
30 |
-
{
|
31 |
-
return $this->oService->isPluginInstalled( $sPluginSecretId );
|
32 |
-
}
|
33 |
-
catch( Inx_Api_RemoteException $x )
|
34 |
-
{
|
35 |
-
$this->rebuildException( $x );
|
36 |
-
return null;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
public function isPluginActive( $pluginSecretId, $listContextId )
|
42 |
-
{
|
43 |
-
try
|
44 |
-
{
|
45 |
-
return $this->oService->isPluginActive( $pluginSecretId, $listContextId );
|
46 |
-
}
|
47 |
-
catch( Inx_Api_RemoteException $x )
|
48 |
-
{
|
49 |
-
$this->rebuildException( $x );
|
50 |
-
return null;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
public function getListContextIdsWherePluginActive( $pluginSecretId )
|
56 |
-
{
|
57 |
-
|
58 |
-
try
|
59 |
-
{
|
60 |
-
return $this->oService->getListContextIdsWherePluginActive( $pluginSecretId );
|
61 |
-
}
|
62 |
-
catch( Inx_Api_RemoteException $x )
|
63 |
-
{
|
64 |
-
$this->rebuildException( $x );
|
65 |
-
return null;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
protected abstract function rebuildException( Inx_Api_RemoteException $e );
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Sets property value
|
76 |
-
*
|
77 |
-
* @param string $sKey Property name. Possible values are: <i>http.proxyHost</i>, <i>http.proxyPort</i>, <i>http.proxyUser</i>, <i>http.proxyPassword</i>, <i>soap.connectionTimeout</i>
|
78 |
-
* @param string|int $sValue
|
79 |
-
*/
|
80 |
-
public static function setProperty($sKey, $mxValue)
|
81 |
-
{
|
82 |
-
if (empty($sKey)) {
|
83 |
-
throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
|
84 |
-
}
|
85 |
-
|
86 |
-
if (! (is_string($mxValue) || is_int($mxValue))) {
|
87 |
-
throw new Inx_Api_IllegalArgumentException("Value must be string or int.");
|
88 |
-
}
|
89 |
-
|
90 |
-
self::$_aProperties[$sKey] = $mxValue;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Returns property value
|
95 |
-
*
|
96 |
-
* @param string $sKey
|
97 |
-
* @return string|int
|
98 |
-
*/
|
99 |
-
public static function getProperty($sKey)
|
100 |
-
{
|
101 |
-
if (empty($sKey)) {
|
102 |
-
throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
|
103 |
-
}
|
104 |
-
if (isset(self::$_aProperties[$sKey])) {
|
105 |
-
return self::$_aProperties[$sKey];
|
106 |
-
}
|
107 |
-
|
108 |
-
return null;
|
109 |
-
}
|
110 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
|
6 |
+
|
7 |
+
abstract class Inx_Api_PluginStatusService
|
8 |
+
{
|
9 |
+
protected $oService;
|
10 |
+
|
11 |
+
protected static $_aProperties = array();
|
12 |
+
protected $_sApplicationUrl = null;
|
13 |
+
|
14 |
+
public static function create( $applicationUrl )
|
15 |
+
{
|
16 |
+
try
|
17 |
+
{
|
18 |
+
return new Inx_Apiimpl_AxisPluginStatusService($applicationUrl);
|
19 |
+
}
|
20 |
+
catch( Exception $x )
|
21 |
+
{
|
22 |
+
throw new Inx_Api_APIException( "Unknown error in PluginStatusService", $x );
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
public function isPluginInstalled( $sPluginSecretId )
|
28 |
+
{
|
29 |
+
try
|
30 |
+
{
|
31 |
+
return $this->oService->isPluginInstalled( $sPluginSecretId );
|
32 |
+
}
|
33 |
+
catch( Inx_Api_RemoteException $x )
|
34 |
+
{
|
35 |
+
$this->rebuildException( $x );
|
36 |
+
return null;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
public function isPluginActive( $pluginSecretId, $listContextId )
|
42 |
+
{
|
43 |
+
try
|
44 |
+
{
|
45 |
+
return $this->oService->isPluginActive( $pluginSecretId, $listContextId );
|
46 |
+
}
|
47 |
+
catch( Inx_Api_RemoteException $x )
|
48 |
+
{
|
49 |
+
$this->rebuildException( $x );
|
50 |
+
return null;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
public function getListContextIdsWherePluginActive( $pluginSecretId )
|
56 |
+
{
|
57 |
+
|
58 |
+
try
|
59 |
+
{
|
60 |
+
return $this->oService->getListContextIdsWherePluginActive( $pluginSecretId );
|
61 |
+
}
|
62 |
+
catch( Inx_Api_RemoteException $x )
|
63 |
+
{
|
64 |
+
$this->rebuildException( $x );
|
65 |
+
return null;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
protected abstract function rebuildException( Inx_Api_RemoteException $e );
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Sets property value
|
76 |
+
*
|
77 |
+
* @param string $sKey Property name. Possible values are: <i>http.proxyHost</i>, <i>http.proxyPort</i>, <i>http.proxyUser</i>, <i>http.proxyPassword</i>, <i>soap.connectionTimeout</i>
|
78 |
+
* @param string|int $sValue
|
79 |
+
*/
|
80 |
+
public static function setProperty($sKey, $mxValue)
|
81 |
+
{
|
82 |
+
if (empty($sKey)) {
|
83 |
+
throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
|
84 |
+
}
|
85 |
+
|
86 |
+
if (! (is_string($mxValue) || is_int($mxValue))) {
|
87 |
+
throw new Inx_Api_IllegalArgumentException("Value must be string or int.");
|
88 |
+
}
|
89 |
+
|
90 |
+
self::$_aProperties[$sKey] = $mxValue;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Returns property value
|
95 |
+
*
|
96 |
+
* @param string $sKey
|
97 |
+
* @return string|int
|
98 |
+
*/
|
99 |
+
public static function getProperty($sKey)
|
100 |
+
{
|
101 |
+
if (empty($sKey)) {
|
102 |
+
throw new Inx_Api_IllegalArgumentException("Key can't be empty.");
|
103 |
+
}
|
104 |
+
if (isset(self::$_aProperties[$sKey])) {
|
105 |
+
return self::$_aProperties[$sKey];
|
106 |
+
}
|
107 |
+
|
108 |
+
return null;
|
109 |
+
}
|
110 |
+
}
|
lib/Inx/Api/Property/ApprovalPropertyValue.php
CHANGED
@@ -1,141 +1,141 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Property
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Property_ApprovalPropertyValue</i> is a wrapper class for the approval property values.
|
8 |
-
* This value determines if and how mailings shall be approved and by whom.
|
9 |
-
* An <i>Inx_Api_Property_ApprovalPropertyValue</i> therefore consists of three parts which define the approval strategy:
|
10 |
-
* <ul>
|
11 |
-
* <li><i>The approval type</i>: Defines if and how mailings shall be approved.
|
12 |
-
* <li><i>The primary approver</i>: Approver that will be involved in all approval types immediately.
|
13 |
-
* <li><i>The secondary approver</i>: Approver that will only get involved in certain conditions.
|
14 |
-
* </ul>
|
15 |
-
* If and how the approvers will get involved is determined from the approval type.
|
16 |
-
* The possible values for the approval type are:
|
17 |
-
* <p>
|
18 |
-
* <ul>
|
19 |
-
* <li><i>APPROVAL_TYPE_OFF</i>: Approval is completely turned off.
|
20 |
-
* No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
|
21 |
-
* <li><i>APPROVAL_TYPE_SYSTEM</i>: The approval type is inherited from the system list.
|
22 |
-
* <li><i>APPROVAL_TYPE_IDENTICAL</i>: Both approvers will get involved immediately.
|
23 |
-
* Only one of them has to approve the mailing.
|
24 |
-
* <li><i>APPROVAL_TYPE_ESCALATION</i>: At first, only the primary approver will be involved.
|
25 |
-
* If the escalation date expires without the primary approver having approved the mailing, the secondary
|
26 |
-
* approver will get involved.
|
27 |
-
* </ul>
|
28 |
-
* <p>
|
29 |
-
* To convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal representation needed for the
|
30 |
-
* approval property, use the
|
31 |
-
* <i>Inx_Api_Property_PropertyFormatter::createApprovalPropertyValue($oApprovalPropertyValue)</i> method.
|
32 |
-
* To convert the internal representation into an <i>Inx_Api_Property_ApprovalPropertyValue</i> object, use the
|
33 |
-
* <i>Inx_Api_Property_PropertyFormatter::parseApprovalPropertyValue($oProperty)</i> method.
|
34 |
-
*
|
35 |
-
* @see com.inxmail.xpro.api.property.PropertyFormatter
|
36 |
-
* @see com.inxmail.xpro.api.property.PropertyNames#APPROVAL_ACTIVE
|
37 |
-
*
|
38 |
-
* @since API 1.6.0
|
39 |
-
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
40 |
-
* @package Inxmail
|
41 |
-
* @subpackage Property
|
42 |
-
*/
|
43 |
-
class Inx_Api_Property_ApprovalPropertyValue
|
44 |
-
{
|
45 |
-
private $approvalType;
|
46 |
-
|
47 |
-
private $primaryApproverId;
|
48 |
-
|
49 |
-
private $secondaryApproverId;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Approval type used for deactivating the approval process.
|
53 |
-
* No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
|
54 |
-
*/
|
55 |
-
const APPROVAL_TYPE_OFF = 0;
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Approval type used to inherit the type from the system approval property.
|
59 |
-
* If this type is used in the system list, the system approval property will be set to <i>APPROVAL_TYPE_OFF</i>.
|
60 |
-
*/
|
61 |
-
const APPROVAL_TYPE_SYSTEM = 1;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Approval type used for the escalating approval process.
|
65 |
-
* At first, only the primary approver will be involved.
|
66 |
-
* If the escalation date expires without the primary approver having approved the mailing, the secondary approver
|
67 |
-
* will get involved.
|
68 |
-
*/
|
69 |
-
const APPROVAL_TYPE_ESCALATION = 2;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Approval type used for the identical approval process.
|
73 |
-
* Both approvers will get involved immediately.
|
74 |
-
* Only one of them has to approve the mailing.
|
75 |
-
*/
|
76 |
-
const APPROVAL_TYPE_IDENTICAL = 3;
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> instance with the given approval type, primary
|
81 |
-
* approver and secondary approver.
|
82 |
-
* If the approval type is <i>APPROVAL_TYPE_OFF</i> or <i>APPROVAL_TYPE_SYSTEM</i>, no approvers need to be defined.
|
83 |
-
* In that case use -1 as the id of both approvers.
|
84 |
-
*
|
85 |
-
* @param int $approvalType the approval type. May be one of:
|
86 |
-
* <ul>
|
87 |
-
* <li><i>APPROVAL_TYPE_OFF</i>
|
88 |
-
* <li><i>APPROVAL_TYPE_SYSTEM</i>
|
89 |
-
* <li><i>APPROVAL_TYPE_IDENTICAL</i>
|
90 |
-
* <li><i>APPROVAL_TYPE_ESCALATION</i>
|
91 |
-
* </ul>
|
92 |
-
* @param int $primaryApproverId the id of the primary approver, or -1 if none is needed.
|
93 |
-
* @param int $secondaryApproverId the id of the secondary approver, or -1 if none is needed.
|
94 |
-
*/
|
95 |
-
public function __construct( $approvalType, $primaryApproverId, $secondaryApproverId )
|
96 |
-
{
|
97 |
-
$this->approvalType = $approvalType;
|
98 |
-
$this->primaryApproverId = $primaryApproverId;
|
99 |
-
$this->secondaryApproverId = $secondaryApproverId;
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Returns the type of the approval process, also indicates if the process is deactivated.
|
105 |
-
*
|
106 |
-
* @return int the approval type. May be one of:
|
107 |
-
* <ul>
|
108 |
-
* <li><i>APPROVAL_TYPE_OFF</i>
|
109 |
-
* <li><i>APPROVAL_TYPE_SYSTEM</i>
|
110 |
-
* <li><i>APPROVAL_TYPE_IDENTICAL</i>
|
111 |
-
* <li><i>APPROVAL_TYPE_ESCALATION</i>
|
112 |
-
* </ul>
|
113 |
-
*/
|
114 |
-
public function getApprovalType()
|
115 |
-
{
|
116 |
-
return $this->approvalType;
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Returns the id of the primary approver.
|
122 |
-
*
|
123 |
-
* @return int the id of the primary approver.
|
124 |
-
*/
|
125 |
-
public function getPrimaryApproverId()
|
126 |
-
{
|
127 |
-
return $this->primaryApproverId;
|
128 |
-
}
|
129 |
-
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Returns the id of the secondary approver.
|
133 |
-
*
|
134 |
-
* @return int the id of the secondary approver.
|
135 |
-
*/
|
136 |
-
public function getSecondaryApproverId()
|
137 |
-
{
|
138 |
-
return $this->secondaryApproverId;
|
139 |
-
}
|
140 |
-
|
141 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Property
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Property_ApprovalPropertyValue</i> is a wrapper class for the approval property values.
|
8 |
+
* This value determines if and how mailings shall be approved and by whom.
|
9 |
+
* An <i>Inx_Api_Property_ApprovalPropertyValue</i> therefore consists of three parts which define the approval strategy:
|
10 |
+
* <ul>
|
11 |
+
* <li><i>The approval type</i>: Defines if and how mailings shall be approved.
|
12 |
+
* <li><i>The primary approver</i>: Approver that will be involved in all approval types immediately.
|
13 |
+
* <li><i>The secondary approver</i>: Approver that will only get involved in certain conditions.
|
14 |
+
* </ul>
|
15 |
+
* If and how the approvers will get involved is determined from the approval type.
|
16 |
+
* The possible values for the approval type are:
|
17 |
+
* <p>
|
18 |
+
* <ul>
|
19 |
+
* <li><i>APPROVAL_TYPE_OFF</i>: Approval is completely turned off.
|
20 |
+
* No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
|
21 |
+
* <li><i>APPROVAL_TYPE_SYSTEM</i>: The approval type is inherited from the system list.
|
22 |
+
* <li><i>APPROVAL_TYPE_IDENTICAL</i>: Both approvers will get involved immediately.
|
23 |
+
* Only one of them has to approve the mailing.
|
24 |
+
* <li><i>APPROVAL_TYPE_ESCALATION</i>: At first, only the primary approver will be involved.
|
25 |
+
* If the escalation date expires without the primary approver having approved the mailing, the secondary
|
26 |
+
* approver will get involved.
|
27 |
+
* </ul>
|
28 |
+
* <p>
|
29 |
+
* To convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal representation needed for the
|
30 |
+
* approval property, use the
|
31 |
+
* <i>Inx_Api_Property_PropertyFormatter::createApprovalPropertyValue($oApprovalPropertyValue)</i> method.
|
32 |
+
* To convert the internal representation into an <i>Inx_Api_Property_ApprovalPropertyValue</i> object, use the
|
33 |
+
* <i>Inx_Api_Property_PropertyFormatter::parseApprovalPropertyValue($oProperty)</i> method.
|
34 |
+
*
|
35 |
+
* @see com.inxmail.xpro.api.property.PropertyFormatter
|
36 |
+
* @see com.inxmail.xpro.api.property.PropertyNames#APPROVAL_ACTIVE
|
37 |
+
*
|
38 |
+
* @since API 1.6.0
|
39 |
+
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
40 |
+
* @package Inxmail
|
41 |
+
* @subpackage Property
|
42 |
+
*/
|
43 |
+
class Inx_Api_Property_ApprovalPropertyValue
|
44 |
+
{
|
45 |
+
private $approvalType;
|
46 |
+
|
47 |
+
private $primaryApproverId;
|
48 |
+
|
49 |
+
private $secondaryApproverId;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Approval type used for deactivating the approval process.
|
53 |
+
* No approver will get involved, the editor is the only one responsible for the correctness of the mailing content.
|
54 |
+
*/
|
55 |
+
const APPROVAL_TYPE_OFF = 0;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Approval type used to inherit the type from the system approval property.
|
59 |
+
* If this type is used in the system list, the system approval property will be set to <i>APPROVAL_TYPE_OFF</i>.
|
60 |
+
*/
|
61 |
+
const APPROVAL_TYPE_SYSTEM = 1;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Approval type used for the escalating approval process.
|
65 |
+
* At first, only the primary approver will be involved.
|
66 |
+
* If the escalation date expires without the primary approver having approved the mailing, the secondary approver
|
67 |
+
* will get involved.
|
68 |
+
*/
|
69 |
+
const APPROVAL_TYPE_ESCALATION = 2;
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Approval type used for the identical approval process.
|
73 |
+
* Both approvers will get involved immediately.
|
74 |
+
* Only one of them has to approve the mailing.
|
75 |
+
*/
|
76 |
+
const APPROVAL_TYPE_IDENTICAL = 3;
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> instance with the given approval type, primary
|
81 |
+
* approver and secondary approver.
|
82 |
+
* If the approval type is <i>APPROVAL_TYPE_OFF</i> or <i>APPROVAL_TYPE_SYSTEM</i>, no approvers need to be defined.
|
83 |
+
* In that case use -1 as the id of both approvers.
|
84 |
+
*
|
85 |
+
* @param int $approvalType the approval type. May be one of:
|
86 |
+
* <ul>
|
87 |
+
* <li><i>APPROVAL_TYPE_OFF</i>
|
88 |
+
* <li><i>APPROVAL_TYPE_SYSTEM</i>
|
89 |
+
* <li><i>APPROVAL_TYPE_IDENTICAL</i>
|
90 |
+
* <li><i>APPROVAL_TYPE_ESCALATION</i>
|
91 |
+
* </ul>
|
92 |
+
* @param int $primaryApproverId the id of the primary approver, or -1 if none is needed.
|
93 |
+
* @param int $secondaryApproverId the id of the secondary approver, or -1 if none is needed.
|
94 |
+
*/
|
95 |
+
public function __construct( $approvalType, $primaryApproverId, $secondaryApproverId )
|
96 |
+
{
|
97 |
+
$this->approvalType = $approvalType;
|
98 |
+
$this->primaryApproverId = $primaryApproverId;
|
99 |
+
$this->secondaryApproverId = $secondaryApproverId;
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Returns the type of the approval process, also indicates if the process is deactivated.
|
105 |
+
*
|
106 |
+
* @return int the approval type. May be one of:
|
107 |
+
* <ul>
|
108 |
+
* <li><i>APPROVAL_TYPE_OFF</i>
|
109 |
+
* <li><i>APPROVAL_TYPE_SYSTEM</i>
|
110 |
+
* <li><i>APPROVAL_TYPE_IDENTICAL</i>
|
111 |
+
* <li><i>APPROVAL_TYPE_ESCALATION</i>
|
112 |
+
* </ul>
|
113 |
+
*/
|
114 |
+
public function getApprovalType()
|
115 |
+
{
|
116 |
+
return $this->approvalType;
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Returns the id of the primary approver.
|
122 |
+
*
|
123 |
+
* @return int the id of the primary approver.
|
124 |
+
*/
|
125 |
+
public function getPrimaryApproverId()
|
126 |
+
{
|
127 |
+
return $this->primaryApproverId;
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Returns the id of the secondary approver.
|
133 |
+
*
|
134 |
+
* @return int the id of the secondary approver.
|
135 |
+
*/
|
136 |
+
public function getSecondaryApproverId()
|
137 |
+
{
|
138 |
+
return $this->secondaryApproverId;
|
139 |
+
}
|
140 |
+
|
141 |
+
}
|
lib/Inx/Api/Property/FormatChoicePropertyFormatter.php
CHANGED
@@ -1,467 +1,467 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Property
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> is used for converting the mail format property
|
8 |
-
* to and from the internal string representation.
|
9 |
-
* For this property, there is no dedicated value holder like the <i>Inx_Api_Property_ApprovalPropertyValue</i>.
|
10 |
-
* Instead, the formatter itself contains all relevant data:
|
11 |
-
* <p>
|
12 |
-
* <ul>
|
13 |
-
* <li><i>The formatting (choice) strategy</i>: Defines how mailings shall be formatted.
|
14 |
-
* <li><i>The default format</i>: Defines which format shall be used by default.
|
15 |
-
* <li><i>The attribute id</i>: Defines the recipient attribute which shall be used to determine which format to use.
|
16 |
-
* <li><i>The patterns</i>: Define which attribute value will trigger the use of a specific format.
|
17 |
-
* </ul>
|
18 |
-
* The formatting (choice) strategy may be one of the following constants:
|
19 |
-
* <p>
|
20 |
-
* <ul>
|
21 |
-
* <li><i>MAILING_FORMAT_STRATEGY</i>: The editor may freely choose the mail format for each individual mailing.
|
22 |
-
* Used by <i>formatMailingChoice()</i>.
|
23 |
-
* <li><i>FIXED_STRATEGY</i>: Only one specific mail format may be used.
|
24 |
-
* Used by <i>formatFixedChoice($sFormat)</i>.
|
25 |
-
* <li><i>ATTRIBUTE_STRATEGY</i>: A recipient attribute is used to determine the mail format.
|
26 |
-
* Used by <i>formatAttributeChoice($iAttributeId, $sDefaultFormat, $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern)</i>.
|
27 |
-
* </ul>
|
28 |
-
* The default format is used by the <i>FIXED_STRATEGY</i> and the <i>ATTRIBUTE_STRATEGY</i>.
|
29 |
-
* The possible formats are:
|
30 |
-
* <p>
|
31 |
-
* <ul>
|
32 |
-
* <li><i>PLAIN_TEXT_FORMAT</i>: Mailings will contain plain text only.
|
33 |
-
* <li><i>HTML_TEXT_FORMAT</i>: Mailings will contain HTML text only.
|
34 |
-
* <li><i>MULTIPART_FORMAT</i>: Mailings will contain both, plain and HTML text parts.
|
35 |
-
* </ul>
|
36 |
-
* <p>
|
37 |
-
* <strong>Note:</strong> When using the <i>ATTRIBUTE_STRATEGY</i> it is recommended to create multipart mailings only.
|
38 |
-
* However, it is still possible to create plain or HTML text mailings.
|
39 |
-
* Be aware that in such a case, all recipients will receive the mailing in the same format (which is plain or HTML text).
|
40 |
-
* <p>
|
41 |
-
* The attribute strategy requires an attribute id, a default mail format and attribute value patterns that determine
|
42 |
-
* which mail format to use.
|
43 |
-
* If the value of an attribute matches the pattern, the format associated to this pattern will be chosen.
|
44 |
-
* If the value matches none of the specified patterns, the default format will be used.
|
45 |
-
* The pattern of the default format is automatically set to <i>null</i>.
|
46 |
-
* <p>
|
47 |
-
* The patterns are <strong>not</strong> patterns in the ordinary sense.
|
48 |
-
* No operators or wildcards are allowed and the value is case sensitive and without quotes.
|
49 |
-
* Let's say we use the following patterns:
|
50 |
-
* <p>
|
51 |
-
* <ul>
|
52 |
-
* <li><i>Plain text pattern</i>: plain%
|
53 |
-
* <li><i>HTML text pattern</i>: html
|
54 |
-
* <li><i>Multipart pattern (default)</i>: multipart
|
55 |
-
* </ul>
|
56 |
-
* If the attribute value is equal to plain, the recipient will get a multipart mailing as the % wildcard is considered
|
57 |
-
* an ordinary character.
|
58 |
-
* If it is equal to html, the recipient gets the HTML flavour.
|
59 |
-
* However, if the attribute value is equal to HTML, the recipient will also get a multipart mailing, as the patterns
|
60 |
-
* are case sensitive.
|
61 |
-
* The multipart pattern may also be set to <i>null</i> as multipart is the default format and therefore the pattern
|
62 |
-
* is set to <i>null</i> anyway.
|
63 |
-
* <p>
|
64 |
-
* The following snippet shows how to retrieve and parse the mail format property of the specified list:
|
65 |
-
*
|
66 |
-
* <pre>
|
67 |
-
* $oListContext = $oSession->getListContextManager()->findByName("Desired list");
|
68 |
-
* $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE);
|
69 |
-
*
|
70 |
-
* $oFormatChoicePropertyFormatter = Inx_Api_Property_FormatChoicePropertyFormatter::parse($oProperty);
|
71 |
-
* echo "Format strategy: ".$oFormatChoicePropertyFormatter->getChoiceStategy()."<br>";
|
72 |
-
* echo "Default format: ".$oFormatChoicePropertyFormatter->getDefaultFormat()."<br>";
|
73 |
-
* echo "Attribute id: ".$oFormatChoicePropertyFormatter->getAttributeId()."<br>";
|
74 |
-
* echo "HTML pattern: ".$oFormatChoicePropertyFormatter->getPattern(
|
75 |
-
* Inx_Api_Property_FormatChoicePropertyFormatter::HTML_TEXT_FORMAT)."<br>";
|
76 |
-
* </pre>
|
77 |
-
* <p>
|
78 |
-
* To give the editor free choice to use any mail format she or he considers appropriate, use the
|
79 |
-
* <i>formatMailingChoice()</i> method.
|
80 |
-
* The following snippet shows how this can be achieved:
|
81 |
-
*
|
82 |
-
* <pre>
|
83 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
84 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
85 |
-
*
|
86 |
-
* $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatMailingChoice() );
|
87 |
-
* $oProperty->commitUpdate();
|
88 |
-
* </pre>
|
89 |
-
* <p>
|
90 |
-
* The opposite strategy is to restrict all mailings of a list to a certain mail format.
|
91 |
-
* The following snippet shows how to restrict the mailing format of the specified list to the multipart format:
|
92 |
-
*
|
93 |
-
* <pre>
|
94 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
95 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
96 |
-
*
|
97 |
-
* $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatFixedChoice(
|
98 |
-
* Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT ) );
|
99 |
-
* $oProperty->commitUpdate();
|
100 |
-
* </pre>
|
101 |
-
* <p>
|
102 |
-
* The final strategy is to choose the mailing format based on the value of a recipient attribute.
|
103 |
-
* The following snippet shows how to send HTML mailings to recipients with the attribute value html, plain text
|
104 |
-
* mailings to recipients with the attribute value plain and multipart mailings to all other recipients:
|
105 |
-
*
|
106 |
-
* <pre>
|
107 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
108 |
-
* $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
|
109 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
110 |
-
*
|
111 |
-
* $iAttributeId = $oRecipientMetaData->getUserAttribute( "format" )->getId();
|
112 |
-
* $sPlainTextPattern = "plain";
|
113 |
-
* $sHtmlTextPattern = "html";
|
114 |
-
*
|
115 |
-
* $sStrategy = Inx_Api_Property_FormatChoicePropertyFormatter::formatAttributeChoice( $iAttributeId,
|
116 |
-
* Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT, $sPlainTextPattern, $sHtmlTextPattern, null );
|
117 |
-
* $oProperty->updateInternalValue( $sStrategy );
|
118 |
-
* $oProperty->commitUpdate();
|
119 |
-
* </pre>
|
120 |
-
* <p>
|
121 |
-
* For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
|
122 |
-
*
|
123 |
-
* @see Inx_Api_Property_Property
|
124 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
125 |
-
* @package Inxmail
|
126 |
-
* @subpackage Property
|
127 |
-
*/
|
128 |
-
class Inx_Api_Property_FormatChoicePropertyFormatter
|
129 |
-
{
|
130 |
-
const PREFIX = "EmailFormat[";
|
131 |
-
|
132 |
-
const SUFFIX = "]";
|
133 |
-
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Strategy constant which lets the editor freely choose the appropriate mail format.
|
137 |
-
*
|
138 |
-
* @var int
|
139 |
-
*/
|
140 |
-
const MAILING_FORMAT_STRATEGY = 0;
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Strategy constant which restricts the mail format to exactly one specified format.
|
144 |
-
*
|
145 |
-
* @var int
|
146 |
-
*/
|
147 |
-
const FIXED_STRATEGY = 1;
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Strategy constant which is used to determine the mail format based on the value of a recipient attribute.
|
151 |
-
*
|
152 |
-
* @var int
|
153 |
-
*/
|
154 |
-
const ATTRIBUTE_STRATEGY = 2;
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Constant for the plain text pattern.
|
159 |
-
*
|
160 |
-
* @var string
|
161 |
-
*/
|
162 |
-
const PLAIN_TEXT_FORMAT = "text/plain";
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Constant for the HTML text pattern.
|
166 |
-
*
|
167 |
-
* @var string
|
168 |
-
*/
|
169 |
-
const HTML_TEXT_FORMAT = "text/html";
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Constant for the multipart pattern.
|
173 |
-
*
|
174 |
-
* @var string
|
175 |
-
*/
|
176 |
-
const MULTIPART_FORMAT = "multipart";
|
177 |
-
|
178 |
-
|
179 |
-
/**
|
180 |
-
* The strategy used to choose the mailing format.
|
181 |
-
*
|
182 |
-
* @var int
|
183 |
-
*/
|
184 |
-
protected $iChoiceStategy;
|
185 |
-
|
186 |
-
/**
|
187 |
-
* The attribute that controls which format to choose.
|
188 |
-
*
|
189 |
-
* @var int
|
190 |
-
*/
|
191 |
-
protected $iAttributeId;
|
192 |
-
|
193 |
-
/**
|
194 |
-
* The plain text pattern.
|
195 |
-
*
|
196 |
-
* @var string
|
197 |
-
*/
|
198 |
-
protected $sPlainTextPattern;
|
199 |
-
|
200 |
-
/**
|
201 |
-
* The HTML text pattern.
|
202 |
-
*
|
203 |
-
* @var string
|
204 |
-
*/
|
205 |
-
protected $sHtmlTextPattern;
|
206 |
-
|
207 |
-
/**
|
208 |
-
* The multipart pattern.
|
209 |
-
*
|
210 |
-
* @var string
|
211 |
-
*/
|
212 |
-
protected $sMultipartPattern;
|
213 |
-
|
214 |
-
/**
|
215 |
-
* The default mailing format.
|
216 |
-
*
|
217 |
-
* @var string
|
218 |
-
*/
|
219 |
-
protected $sFormat;
|
220 |
-
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Default constructor which may only be used by derived classes.
|
224 |
-
*/
|
225 |
-
protected function __construct()
|
226 |
-
{}
|
227 |
-
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Parses the given property and extracts the format choice policy into a new
|
231 |
-
* <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for easy retrieval.
|
232 |
-
* Only the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property is allowed.
|
233 |
-
* Using any other property will trigger an <i>Inx_Api_IllegalArgumentException</i>.
|
234 |
-
*
|
235 |
-
* @param property the property to parse.
|
236 |
-
* @return Inx_Api_Property_FormatChoicePropertyFormatter an <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>
|
237 |
-
* which can be used for easy retrieval of the property values.
|
238 |
-
* @throws Inx_Api_IllegalArgumentException if the given property is not an
|
239 |
-
* <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property.
|
240 |
-
*/
|
241 |
-
public static function parse( Inx_Api_Property_Property $oProperty )
|
242 |
-
{
|
243 |
-
$sValue = $oProperty->getInternalValue();
|
244 |
-
$oFormat = new Inx_Api_Property_FormatChoicePropertyFormatter();
|
245 |
-
|
246 |
-
if( $sValue === null || strlen($sValue) == 0 )
|
247 |
-
{
|
248 |
-
$oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
|
249 |
-
return $oFormat;
|
250 |
-
}
|
251 |
-
|
252 |
-
if( strpos($sValue, self::PREFIX) === 0 && true ===(strrpos($sValue, self::SUFFIX) == strlen($sValue) - strlen(self::SUFFIX)) )
|
253 |
-
{
|
254 |
-
$s = substr($sValue, strlen(self::PREFIX), -1);
|
255 |
-
|
256 |
-
|
257 |
-
if( strcmp('0', $s) === 0 ) // EmailFormat[0]
|
258 |
-
{
|
259 |
-
$oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
|
260 |
-
return $oFormat;
|
261 |
-
}
|
262 |
-
if( strcmp('1|text/plain', $s ) === 0 ) // EmailFormat[1|text/plain]
|
263 |
-
{
|
264 |
-
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
265 |
-
$oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
|
266 |
-
return $oFormat;
|
267 |
-
}
|
268 |
-
if( strcmp('1|text/html', $s ) === 0) // EmailFormat[1|text/html]
|
269 |
-
{
|
270 |
-
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
271 |
-
$oFormat->sFormat = self::HTML_TEXT_FORMAT;
|
272 |
-
return $oFormat;
|
273 |
-
}
|
274 |
-
if( strcmp('1|multipart', $s ) === 0 ) // EmailFormat[1|multipart]
|
275 |
-
{
|
276 |
-
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
277 |
-
$oFormat->sFormat = self::MULTIPART_FORMAT;
|
278 |
-
return $oFormat;
|
279 |
-
}
|
280 |
-
|
281 |
-
// EmailFormat[2|<attrId>|<htmltext-pattern>|<plaintext-pattern>|<multipart-pattern>|<defaultForamt>]
|
282 |
-
$aTokens = explode('|', $s);
|
283 |
-
if ((count($aTokens) === 6) && strcmp('2', $aTokens[0]) === 0 && ctype_digit($aTokens[1]))
|
284 |
-
{
|
285 |
-
$oFormat->iChoiceStategy = self::ATTRIBUTE_STRATEGY;
|
286 |
-
$oFormat->iAttributeId = (int) $aTokens[1];
|
287 |
-
$oFormat->sHtmlTextPattern = $aTokens[2];
|
288 |
-
$oFormat->sPlainTextPattern = $aTokens[3];
|
289 |
-
$oFormat->sMultipartPattern = $aTokens[4];
|
290 |
-
$df = $aTokens[5];
|
291 |
-
if(strcmp($df, self::PLAIN_TEXT_FORMAT) === 0) {
|
292 |
-
$oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
|
293 |
-
return $oFormat;
|
294 |
-
}
|
295 |
-
|
296 |
-
if(strcmp($df, self::HTML_TEXT_FORMAT) === 0) {
|
297 |
-
$oFormat->sFormat = self::HTML_TEXT_FORMAT;
|
298 |
-
return $oFormat;
|
299 |
-
}
|
300 |
-
|
301 |
-
if(strcmp($df, self::MULTIPART_FORMAT) === 0) {
|
302 |
-
$oFormat->sFormat = self::MULTIPART_FORMAT;
|
303 |
-
return $oFormat;
|
304 |
-
}
|
305 |
-
}
|
306 |
-
}
|
307 |
-
throw new Inx_Api_IllegalArgumentException( "illegal mail choise format: " . value );
|
308 |
-
}
|
309 |
-
|
310 |
-
/**
|
311 |
-
* Returns the formatting (choice) strategy. May be one of:
|
312 |
-
* <ul>
|
313 |
-
* <li><i>MAILING_FORMAT_STRATEGY</i>
|
314 |
-
* <li><i>FIXED_STRATEGY</i>
|
315 |
-
* <li><i>ATTRIBUTE_STRATEGY</i>
|
316 |
-
* </ul>
|
317 |
-
*
|
318 |
-
* @return int the formatting (choice) strategy.
|
319 |
-
*/
|
320 |
-
public function getChoiceStategy()
|
321 |
-
{
|
322 |
-
return $this->iChoiceStategy;
|
323 |
-
}
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Returns the id of the recipient attribute used to determine the mailing format.
|
327 |
-
* If the choice strategy is not <i>ATTRIBUTE_STRATEGY</i>, 0 will be returned.
|
328 |
-
*
|
329 |
-
* @return int the id of the recipient attribute used to determine the mailing format, or 0 if none is needed.
|
330 |
-
*/
|
331 |
-
public function getAttributeId()
|
332 |
-
{
|
333 |
-
return $this->iAttributeId;
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* Returns the pattern for the given mailing format.
|
338 |
-
* Patterns are only used by the choice strategy <i>ATTRIBUTE_STRATEGY</i>.
|
339 |
-
*
|
340 |
-
* @param string $sFormat the mailing format for which the pattern shall be returned. May be one of:
|
341 |
-
* <ul>
|
342 |
-
* <li><i>PLAIN_TEXT_FORMAT</i>
|
343 |
-
* <li><i>HTML_TEXT_FORMAT</i>
|
344 |
-
* <li><i>MULTIPART_FORMAT</i>
|
345 |
-
* </ul>
|
346 |
-
* @return string the pattern for the given format, if any, <i>null</i> otherwise.
|
347 |
-
*/
|
348 |
-
public function getPattern( $sFormat )
|
349 |
-
{
|
350 |
-
if( strcmp($sFormat, self::PLAIN_TEXT_FORMAT) === 0 )
|
351 |
-
return $this->sPlainTextPattern;
|
352 |
-
if( strcmp($sFormat, self::HTML_TEXT_FORMAT) === 0 )
|
353 |
-
return $this->sHtmlTextPattern;
|
354 |
-
if( strcmp($sFormat, self::MULTIPART_FORMAT) === 0 )
|
355 |
-
return $this->sMultipartPattern;
|
356 |
-
|
357 |
-
throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
|
358 |
-
}
|
359 |
-
|
360 |
-
/**
|
361 |
-
* Returns the default mailing format.
|
362 |
-
* The default format is only used by the choice strategies <i>FIXED_STRATEGY</i> and <i>ATTRIBUTE_STRATEGY</i>.
|
363 |
-
*
|
364 |
-
* @return string the default mailing format, if any, <i>null</i> otherwise.
|
365 |
-
*/
|
366 |
-
public function getDefaultFormat()
|
367 |
-
{
|
368 |
-
return $this->sFormat;
|
369 |
-
}
|
370 |
-
|
371 |
-
/**
|
372 |
-
* Creates the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
|
373 |
-
*
|
374 |
-
* @return string the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
|
375 |
-
*/
|
376 |
-
public static function formatMailingChoice()
|
377 |
-
{
|
378 |
-
return self::PREFIX . "0" . self::SUFFIX;
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Creates the internal string value for the <i>FIXED_STRATEGY</i> using the given default mailing format.
|
383 |
-
* The default format may be one of:
|
384 |
-
* <ul>
|
385 |
-
* <li><i>PLAIN_TEXT_FORMAT</i>
|
386 |
-
* <li><i>HTML_TEXT_FORMAT</i>
|
387 |
-
* <li><i>MULTIPART_FORMAT</i>
|
388 |
-
* </ul>
|
389 |
-
*
|
390 |
-
* @param string $sFormat the default mailing format.
|
391 |
-
* @return string the internal string value for the <i>FIXED_STRATEGY</i>.
|
392 |
-
*/
|
393 |
-
public static function formatFixedChoice( $sFormat )
|
394 |
-
{
|
395 |
-
self::checkFormat( $sFormat );
|
396 |
-
return self::PREFIX . "1|" . $sFormat . self::SUFFIX;
|
397 |
-
}
|
398 |
-
|
399 |
-
/**
|
400 |
-
* Creates the internal string value for the <i>ATTRIBUTE_STRATEGY</i> using the given recipient attribute id,
|
401 |
-
* default mailing format and patterns.
|
402 |
-
* For a description of the pattern syntax, see the documentation of this class.
|
403 |
-
* The default mailing attribute may be one of:
|
404 |
-
* <ul>
|
405 |
-
* <li><i>PLAIN_TEXT_FORMAT</i>
|
406 |
-
* <li><i>HTML_TEXT_FORMAT</i>
|
407 |
-
* <li><i>MULTIPART_FORMAT</i>
|
408 |
-
* </ul>
|
409 |
-
*
|
410 |
-
* @param int $iAttributeId the id of the recipient attribute used to determine the mailing format.
|
411 |
-
* @param string $sDefaultFormat the default mailing format.
|
412 |
-
* @param string $sPlainTextPattern the plain text pattern. May be <i>null</i> if this is the default format.
|
413 |
-
* @param string $sHtmlTextPattern the HTML text pattern. May be <i>null</i> if this is the default format.
|
414 |
-
* @param string $sMultipartPattern the multipart text pattern. May be <i>null</i> if this is the default format.
|
415 |
-
* @return string the internal string value for the <i>ATTRIBUTE_STRATEGY</i>.
|
416 |
-
*/
|
417 |
-
public static function formatAttributeChoice( $iAttributeId, $sDefaultFormat,
|
418 |
-
$sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern )
|
419 |
-
{
|
420 |
-
if( strcmp($sDefaultFormat, self::PLAIN_TEXT_FORMAT) === 0)
|
421 |
-
{
|
422 |
-
//fixes XAPI35 (comment): use "null" instead of null
|
423 |
-
$sPlainTextPattern = "null";
|
424 |
-
if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
|
425 |
-
throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
|
426 |
-
if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
|
427 |
-
throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
|
428 |
-
}
|
429 |
-
else if( strcmp($sDefaultFormat, self::HTML_TEXT_FORMAT) === 0)
|
430 |
-
{
|
431 |
-
//fixes XAPI35 (comment): use "null" instead of null
|
432 |
-
$sHtmlTextPattern = "null";
|
433 |
-
if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
|
434 |
-
throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
|
435 |
-
if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
|
436 |
-
throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
|
437 |
-
}
|
438 |
-
else if( strcmp($sDefaultFormat, self::MULTIPART_FORMAT) === 0 )
|
439 |
-
{
|
440 |
-
//fixes XAPI35 (comment): use "null" instead of null
|
441 |
-
$sMultipartPattern = "null";
|
442 |
-
//fixes XAPI-35: strlen() instead of length()
|
443 |
-
if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
|
444 |
-
throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
|
445 |
-
if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
|
446 |
-
throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
|
447 |
-
}
|
448 |
-
else
|
449 |
-
throw new Inx_Api_IllegalArgumentException( "unknown defaultFormat: " . $sDefaultFormat );
|
450 |
-
|
451 |
-
return self::PREFIX . "2|" . $iAttributeId . "|" . $sHtmlTextPattern . "|" . $sPlainTextPattern
|
452 |
-
. "|" . $sMultipartPattern . "|" . $sDefaultFormat . self::SUFFIX;
|
453 |
-
}
|
454 |
-
|
455 |
-
|
456 |
-
private static function checkFormat( $sFormat )
|
457 |
-
{
|
458 |
-
if( strcmp(self::PLAIN_TEXT_FORMAT, $sFormat ) === 0)
|
459 |
-
return;
|
460 |
-
if( strcmp(self::HTML_TEXT_FORMAT, $sFormat ) === 0)
|
461 |
-
return;
|
462 |
-
if( strcmp(self::MULTIPART_FORMAT, $sFormat ) === 0)
|
463 |
-
return;
|
464 |
-
|
465 |
-
throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
|
466 |
-
}
|
467 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Property
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> is used for converting the mail format property
|
8 |
+
* to and from the internal string representation.
|
9 |
+
* For this property, there is no dedicated value holder like the <i>Inx_Api_Property_ApprovalPropertyValue</i>.
|
10 |
+
* Instead, the formatter itself contains all relevant data:
|
11 |
+
* <p>
|
12 |
+
* <ul>
|
13 |
+
* <li><i>The formatting (choice) strategy</i>: Defines how mailings shall be formatted.
|
14 |
+
* <li><i>The default format</i>: Defines which format shall be used by default.
|
15 |
+
* <li><i>The attribute id</i>: Defines the recipient attribute which shall be used to determine which format to use.
|
16 |
+
* <li><i>The patterns</i>: Define which attribute value will trigger the use of a specific format.
|
17 |
+
* </ul>
|
18 |
+
* The formatting (choice) strategy may be one of the following constants:
|
19 |
+
* <p>
|
20 |
+
* <ul>
|
21 |
+
* <li><i>MAILING_FORMAT_STRATEGY</i>: The editor may freely choose the mail format for each individual mailing.
|
22 |
+
* Used by <i>formatMailingChoice()</i>.
|
23 |
+
* <li><i>FIXED_STRATEGY</i>: Only one specific mail format may be used.
|
24 |
+
* Used by <i>formatFixedChoice($sFormat)</i>.
|
25 |
+
* <li><i>ATTRIBUTE_STRATEGY</i>: A recipient attribute is used to determine the mail format.
|
26 |
+
* Used by <i>formatAttributeChoice($iAttributeId, $sDefaultFormat, $sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern)</i>.
|
27 |
+
* </ul>
|
28 |
+
* The default format is used by the <i>FIXED_STRATEGY</i> and the <i>ATTRIBUTE_STRATEGY</i>.
|
29 |
+
* The possible formats are:
|
30 |
+
* <p>
|
31 |
+
* <ul>
|
32 |
+
* <li><i>PLAIN_TEXT_FORMAT</i>: Mailings will contain plain text only.
|
33 |
+
* <li><i>HTML_TEXT_FORMAT</i>: Mailings will contain HTML text only.
|
34 |
+
* <li><i>MULTIPART_FORMAT</i>: Mailings will contain both, plain and HTML text parts.
|
35 |
+
* </ul>
|
36 |
+
* <p>
|
37 |
+
* <strong>Note:</strong> When using the <i>ATTRIBUTE_STRATEGY</i> it is recommended to create multipart mailings only.
|
38 |
+
* However, it is still possible to create plain or HTML text mailings.
|
39 |
+
* Be aware that in such a case, all recipients will receive the mailing in the same format (which is plain or HTML text).
|
40 |
+
* <p>
|
41 |
+
* The attribute strategy requires an attribute id, a default mail format and attribute value patterns that determine
|
42 |
+
* which mail format to use.
|
43 |
+
* If the value of an attribute matches the pattern, the format associated to this pattern will be chosen.
|
44 |
+
* If the value matches none of the specified patterns, the default format will be used.
|
45 |
+
* The pattern of the default format is automatically set to <i>null</i>.
|
46 |
+
* <p>
|
47 |
+
* The patterns are <strong>not</strong> patterns in the ordinary sense.
|
48 |
+
* No operators or wildcards are allowed and the value is case sensitive and without quotes.
|
49 |
+
* Let's say we use the following patterns:
|
50 |
+
* <p>
|
51 |
+
* <ul>
|
52 |
+
* <li><i>Plain text pattern</i>: plain%
|
53 |
+
* <li><i>HTML text pattern</i>: html
|
54 |
+
* <li><i>Multipart pattern (default)</i>: multipart
|
55 |
+
* </ul>
|
56 |
+
* If the attribute value is equal to plain, the recipient will get a multipart mailing as the % wildcard is considered
|
57 |
+
* an ordinary character.
|
58 |
+
* If it is equal to html, the recipient gets the HTML flavour.
|
59 |
+
* However, if the attribute value is equal to HTML, the recipient will also get a multipart mailing, as the patterns
|
60 |
+
* are case sensitive.
|
61 |
+
* The multipart pattern may also be set to <i>null</i> as multipart is the default format and therefore the pattern
|
62 |
+
* is set to <i>null</i> anyway.
|
63 |
+
* <p>
|
64 |
+
* The following snippet shows how to retrieve and parse the mail format property of the specified list:
|
65 |
+
*
|
66 |
+
* <pre>
|
67 |
+
* $oListContext = $oSession->getListContextManager()->findByName("Desired list");
|
68 |
+
* $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE);
|
69 |
+
*
|
70 |
+
* $oFormatChoicePropertyFormatter = Inx_Api_Property_FormatChoicePropertyFormatter::parse($oProperty);
|
71 |
+
* echo "Format strategy: ".$oFormatChoicePropertyFormatter->getChoiceStategy()."<br>";
|
72 |
+
* echo "Default format: ".$oFormatChoicePropertyFormatter->getDefaultFormat()."<br>";
|
73 |
+
* echo "Attribute id: ".$oFormatChoicePropertyFormatter->getAttributeId()."<br>";
|
74 |
+
* echo "HTML pattern: ".$oFormatChoicePropertyFormatter->getPattern(
|
75 |
+
* Inx_Api_Property_FormatChoicePropertyFormatter::HTML_TEXT_FORMAT)."<br>";
|
76 |
+
* </pre>
|
77 |
+
* <p>
|
78 |
+
* To give the editor free choice to use any mail format she or he considers appropriate, use the
|
79 |
+
* <i>formatMailingChoice()</i> method.
|
80 |
+
* The following snippet shows how this can be achieved:
|
81 |
+
*
|
82 |
+
* <pre>
|
83 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
84 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
85 |
+
*
|
86 |
+
* $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatMailingChoice() );
|
87 |
+
* $oProperty->commitUpdate();
|
88 |
+
* </pre>
|
89 |
+
* <p>
|
90 |
+
* The opposite strategy is to restrict all mailings of a list to a certain mail format.
|
91 |
+
* The following snippet shows how to restrict the mailing format of the specified list to the multipart format:
|
92 |
+
*
|
93 |
+
* <pre>
|
94 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
95 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
96 |
+
*
|
97 |
+
* $oProperty->updateInternalValue( Inx_Api_Property_FormatChoicePropertyFormatter::formatFixedChoice(
|
98 |
+
* Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT ) );
|
99 |
+
* $oProperty->commitUpdate();
|
100 |
+
* </pre>
|
101 |
+
* <p>
|
102 |
+
* The final strategy is to choose the mailing format based on the value of a recipient attribute.
|
103 |
+
* The following snippet shows how to send HTML mailings to recipients with the attribute value html, plain text
|
104 |
+
* mailings to recipients with the attribute value plain and multipart mailings to all other recipients:
|
105 |
+
*
|
106 |
+
* <pre>
|
107 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
108 |
+
* $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
|
109 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE );
|
110 |
+
*
|
111 |
+
* $iAttributeId = $oRecipientMetaData->getUserAttribute( "format" )->getId();
|
112 |
+
* $sPlainTextPattern = "plain";
|
113 |
+
* $sHtmlTextPattern = "html";
|
114 |
+
*
|
115 |
+
* $sStrategy = Inx_Api_Property_FormatChoicePropertyFormatter::formatAttributeChoice( $iAttributeId,
|
116 |
+
* Inx_Api_Property_FormatChoicePropertyFormatter::MULTIPART_FORMAT, $sPlainTextPattern, $sHtmlTextPattern, null );
|
117 |
+
* $oProperty->updateInternalValue( $sStrategy );
|
118 |
+
* $oProperty->commitUpdate();
|
119 |
+
* </pre>
|
120 |
+
* <p>
|
121 |
+
* For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
|
122 |
+
*
|
123 |
+
* @see Inx_Api_Property_Property
|
124 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
125 |
+
* @package Inxmail
|
126 |
+
* @subpackage Property
|
127 |
+
*/
|
128 |
+
class Inx_Api_Property_FormatChoicePropertyFormatter
|
129 |
+
{
|
130 |
+
const PREFIX = "EmailFormat[";
|
131 |
+
|
132 |
+
const SUFFIX = "]";
|
133 |
+
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Strategy constant which lets the editor freely choose the appropriate mail format.
|
137 |
+
*
|
138 |
+
* @var int
|
139 |
+
*/
|
140 |
+
const MAILING_FORMAT_STRATEGY = 0;
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Strategy constant which restricts the mail format to exactly one specified format.
|
144 |
+
*
|
145 |
+
* @var int
|
146 |
+
*/
|
147 |
+
const FIXED_STRATEGY = 1;
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Strategy constant which is used to determine the mail format based on the value of a recipient attribute.
|
151 |
+
*
|
152 |
+
* @var int
|
153 |
+
*/
|
154 |
+
const ATTRIBUTE_STRATEGY = 2;
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Constant for the plain text pattern.
|
159 |
+
*
|
160 |
+
* @var string
|
161 |
+
*/
|
162 |
+
const PLAIN_TEXT_FORMAT = "text/plain";
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Constant for the HTML text pattern.
|
166 |
+
*
|
167 |
+
* @var string
|
168 |
+
*/
|
169 |
+
const HTML_TEXT_FORMAT = "text/html";
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Constant for the multipart pattern.
|
173 |
+
*
|
174 |
+
* @var string
|
175 |
+
*/
|
176 |
+
const MULTIPART_FORMAT = "multipart";
|
177 |
+
|
178 |
+
|
179 |
+
/**
|
180 |
+
* The strategy used to choose the mailing format.
|
181 |
+
*
|
182 |
+
* @var int
|
183 |
+
*/
|
184 |
+
protected $iChoiceStategy;
|
185 |
+
|
186 |
+
/**
|
187 |
+
* The attribute that controls which format to choose.
|
188 |
+
*
|
189 |
+
* @var int
|
190 |
+
*/
|
191 |
+
protected $iAttributeId;
|
192 |
+
|
193 |
+
/**
|
194 |
+
* The plain text pattern.
|
195 |
+
*
|
196 |
+
* @var string
|
197 |
+
*/
|
198 |
+
protected $sPlainTextPattern;
|
199 |
+
|
200 |
+
/**
|
201 |
+
* The HTML text pattern.
|
202 |
+
*
|
203 |
+
* @var string
|
204 |
+
*/
|
205 |
+
protected $sHtmlTextPattern;
|
206 |
+
|
207 |
+
/**
|
208 |
+
* The multipart pattern.
|
209 |
+
*
|
210 |
+
* @var string
|
211 |
+
*/
|
212 |
+
protected $sMultipartPattern;
|
213 |
+
|
214 |
+
/**
|
215 |
+
* The default mailing format.
|
216 |
+
*
|
217 |
+
* @var string
|
218 |
+
*/
|
219 |
+
protected $sFormat;
|
220 |
+
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Default constructor which may only be used by derived classes.
|
224 |
+
*/
|
225 |
+
protected function __construct()
|
226 |
+
{}
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Parses the given property and extracts the format choice policy into a new
|
231 |
+
* <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for easy retrieval.
|
232 |
+
* Only the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property is allowed.
|
233 |
+
* Using any other property will trigger an <i>Inx_Api_IllegalArgumentException</i>.
|
234 |
+
*
|
235 |
+
* @param property the property to parse.
|
236 |
+
* @return Inx_Api_Property_FormatChoicePropertyFormatter an <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>
|
237 |
+
* which can be used for easy retrieval of the property values.
|
238 |
+
* @throws Inx_Api_IllegalArgumentException if the given property is not an
|
239 |
+
* <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i> property.
|
240 |
+
*/
|
241 |
+
public static function parse( Inx_Api_Property_Property $oProperty )
|
242 |
+
{
|
243 |
+
$sValue = $oProperty->getInternalValue();
|
244 |
+
$oFormat = new Inx_Api_Property_FormatChoicePropertyFormatter();
|
245 |
+
|
246 |
+
if( $sValue === null || strlen($sValue) == 0 )
|
247 |
+
{
|
248 |
+
$oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
|
249 |
+
return $oFormat;
|
250 |
+
}
|
251 |
+
|
252 |
+
if( strpos($sValue, self::PREFIX) === 0 && true ===(strrpos($sValue, self::SUFFIX) == strlen($sValue) - strlen(self::SUFFIX)) )
|
253 |
+
{
|
254 |
+
$s = substr($sValue, strlen(self::PREFIX), -1);
|
255 |
+
|
256 |
+
|
257 |
+
if( strcmp('0', $s) === 0 ) // EmailFormat[0]
|
258 |
+
{
|
259 |
+
$oFormat->iChoiceStategy = self::MAILING_FORMAT_STRATEGY;
|
260 |
+
return $oFormat;
|
261 |
+
}
|
262 |
+
if( strcmp('1|text/plain', $s ) === 0 ) // EmailFormat[1|text/plain]
|
263 |
+
{
|
264 |
+
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
265 |
+
$oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
|
266 |
+
return $oFormat;
|
267 |
+
}
|
268 |
+
if( strcmp('1|text/html', $s ) === 0) // EmailFormat[1|text/html]
|
269 |
+
{
|
270 |
+
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
271 |
+
$oFormat->sFormat = self::HTML_TEXT_FORMAT;
|
272 |
+
return $oFormat;
|
273 |
+
}
|
274 |
+
if( strcmp('1|multipart', $s ) === 0 ) // EmailFormat[1|multipart]
|
275 |
+
{
|
276 |
+
$oFormat->iChoiceStategy = self::FIXED_STRATEGY;
|
277 |
+
$oFormat->sFormat = self::MULTIPART_FORMAT;
|
278 |
+
return $oFormat;
|
279 |
+
}
|
280 |
+
|
281 |
+
// EmailFormat[2|<attrId>|<htmltext-pattern>|<plaintext-pattern>|<multipart-pattern>|<defaultForamt>]
|
282 |
+
$aTokens = explode('|', $s);
|
283 |
+
if ((count($aTokens) === 6) && strcmp('2', $aTokens[0]) === 0 && ctype_digit($aTokens[1]))
|
284 |
+
{
|
285 |
+
$oFormat->iChoiceStategy = self::ATTRIBUTE_STRATEGY;
|
286 |
+
$oFormat->iAttributeId = (int) $aTokens[1];
|
287 |
+
$oFormat->sHtmlTextPattern = $aTokens[2];
|
288 |
+
$oFormat->sPlainTextPattern = $aTokens[3];
|
289 |
+
$oFormat->sMultipartPattern = $aTokens[4];
|
290 |
+
$df = $aTokens[5];
|
291 |
+
if(strcmp($df, self::PLAIN_TEXT_FORMAT) === 0) {
|
292 |
+
$oFormat->sFormat = self::PLAIN_TEXT_FORMAT;
|
293 |
+
return $oFormat;
|
294 |
+
}
|
295 |
+
|
296 |
+
if(strcmp($df, self::HTML_TEXT_FORMAT) === 0) {
|
297 |
+
$oFormat->sFormat = self::HTML_TEXT_FORMAT;
|
298 |
+
return $oFormat;
|
299 |
+
}
|
300 |
+
|
301 |
+
if(strcmp($df, self::MULTIPART_FORMAT) === 0) {
|
302 |
+
$oFormat->sFormat = self::MULTIPART_FORMAT;
|
303 |
+
return $oFormat;
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
throw new Inx_Api_IllegalArgumentException( "illegal mail choise format: " . value );
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Returns the formatting (choice) strategy. May be one of:
|
312 |
+
* <ul>
|
313 |
+
* <li><i>MAILING_FORMAT_STRATEGY</i>
|
314 |
+
* <li><i>FIXED_STRATEGY</i>
|
315 |
+
* <li><i>ATTRIBUTE_STRATEGY</i>
|
316 |
+
* </ul>
|
317 |
+
*
|
318 |
+
* @return int the formatting (choice) strategy.
|
319 |
+
*/
|
320 |
+
public function getChoiceStategy()
|
321 |
+
{
|
322 |
+
return $this->iChoiceStategy;
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Returns the id of the recipient attribute used to determine the mailing format.
|
327 |
+
* If the choice strategy is not <i>ATTRIBUTE_STRATEGY</i>, 0 will be returned.
|
328 |
+
*
|
329 |
+
* @return int the id of the recipient attribute used to determine the mailing format, or 0 if none is needed.
|
330 |
+
*/
|
331 |
+
public function getAttributeId()
|
332 |
+
{
|
333 |
+
return $this->iAttributeId;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Returns the pattern for the given mailing format.
|
338 |
+
* Patterns are only used by the choice strategy <i>ATTRIBUTE_STRATEGY</i>.
|
339 |
+
*
|
340 |
+
* @param string $sFormat the mailing format for which the pattern shall be returned. May be one of:
|
341 |
+
* <ul>
|
342 |
+
* <li><i>PLAIN_TEXT_FORMAT</i>
|
343 |
+
* <li><i>HTML_TEXT_FORMAT</i>
|
344 |
+
* <li><i>MULTIPART_FORMAT</i>
|
345 |
+
* </ul>
|
346 |
+
* @return string the pattern for the given format, if any, <i>null</i> otherwise.
|
347 |
+
*/
|
348 |
+
public function getPattern( $sFormat )
|
349 |
+
{
|
350 |
+
if( strcmp($sFormat, self::PLAIN_TEXT_FORMAT) === 0 )
|
351 |
+
return $this->sPlainTextPattern;
|
352 |
+
if( strcmp($sFormat, self::HTML_TEXT_FORMAT) === 0 )
|
353 |
+
return $this->sHtmlTextPattern;
|
354 |
+
if( strcmp($sFormat, self::MULTIPART_FORMAT) === 0 )
|
355 |
+
return $this->sMultipartPattern;
|
356 |
+
|
357 |
+
throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Returns the default mailing format.
|
362 |
+
* The default format is only used by the choice strategies <i>FIXED_STRATEGY</i> and <i>ATTRIBUTE_STRATEGY</i>.
|
363 |
+
*
|
364 |
+
* @return string the default mailing format, if any, <i>null</i> otherwise.
|
365 |
+
*/
|
366 |
+
public function getDefaultFormat()
|
367 |
+
{
|
368 |
+
return $this->sFormat;
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Creates the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
|
373 |
+
*
|
374 |
+
* @return string the internal string value for the <i>MAILING_FORMAT_STRATEGY</i>.
|
375 |
+
*/
|
376 |
+
public static function formatMailingChoice()
|
377 |
+
{
|
378 |
+
return self::PREFIX . "0" . self::SUFFIX;
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Creates the internal string value for the <i>FIXED_STRATEGY</i> using the given default mailing format.
|
383 |
+
* The default format may be one of:
|
384 |
+
* <ul>
|
385 |
+
* <li><i>PLAIN_TEXT_FORMAT</i>
|
386 |
+
* <li><i>HTML_TEXT_FORMAT</i>
|
387 |
+
* <li><i>MULTIPART_FORMAT</i>
|
388 |
+
* </ul>
|
389 |
+
*
|
390 |
+
* @param string $sFormat the default mailing format.
|
391 |
+
* @return string the internal string value for the <i>FIXED_STRATEGY</i>.
|
392 |
+
*/
|
393 |
+
public static function formatFixedChoice( $sFormat )
|
394 |
+
{
|
395 |
+
self::checkFormat( $sFormat );
|
396 |
+
return self::PREFIX . "1|" . $sFormat . self::SUFFIX;
|
397 |
+
}
|
398 |
+
|
399 |
+
/**
|
400 |
+
* Creates the internal string value for the <i>ATTRIBUTE_STRATEGY</i> using the given recipient attribute id,
|
401 |
+
* default mailing format and patterns.
|
402 |
+
* For a description of the pattern syntax, see the documentation of this class.
|
403 |
+
* The default mailing attribute may be one of:
|
404 |
+
* <ul>
|
405 |
+
* <li><i>PLAIN_TEXT_FORMAT</i>
|
406 |
+
* <li><i>HTML_TEXT_FORMAT</i>
|
407 |
+
* <li><i>MULTIPART_FORMAT</i>
|
408 |
+
* </ul>
|
409 |
+
*
|
410 |
+
* @param int $iAttributeId the id of the recipient attribute used to determine the mailing format.
|
411 |
+
* @param string $sDefaultFormat the default mailing format.
|
412 |
+
* @param string $sPlainTextPattern the plain text pattern. May be <i>null</i> if this is the default format.
|
413 |
+
* @param string $sHtmlTextPattern the HTML text pattern. May be <i>null</i> if this is the default format.
|
414 |
+
* @param string $sMultipartPattern the multipart text pattern. May be <i>null</i> if this is the default format.
|
415 |
+
* @return string the internal string value for the <i>ATTRIBUTE_STRATEGY</i>.
|
416 |
+
*/
|
417 |
+
public static function formatAttributeChoice( $iAttributeId, $sDefaultFormat,
|
418 |
+
$sPlainTextPattern, $sHtmlTextPattern, $sMultipartPattern )
|
419 |
+
{
|
420 |
+
if( strcmp($sDefaultFormat, self::PLAIN_TEXT_FORMAT) === 0)
|
421 |
+
{
|
422 |
+
//fixes XAPI35 (comment): use "null" instead of null
|
423 |
+
$sPlainTextPattern = "null";
|
424 |
+
if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
|
425 |
+
throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
|
426 |
+
if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
|
427 |
+
throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
|
428 |
+
}
|
429 |
+
else if( strcmp($sDefaultFormat, self::HTML_TEXT_FORMAT) === 0)
|
430 |
+
{
|
431 |
+
//fixes XAPI35 (comment): use "null" instead of null
|
432 |
+
$sHtmlTextPattern = "null";
|
433 |
+
if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
|
434 |
+
throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
|
435 |
+
if( $sMultipartPattern === null || strlen($sMultipartPattern) == 0 )
|
436 |
+
throw new Inx_Api_IllegalArgumentException( "multipartPattern - illegal value: " . $sMultipartPattern );
|
437 |
+
}
|
438 |
+
else if( strcmp($sDefaultFormat, self::MULTIPART_FORMAT) === 0 )
|
439 |
+
{
|
440 |
+
//fixes XAPI35 (comment): use "null" instead of null
|
441 |
+
$sMultipartPattern = "null";
|
442 |
+
//fixes XAPI-35: strlen() instead of length()
|
443 |
+
if( $sPlainTextPattern === null || strlen($sPlainTextPattern) == 0 )
|
444 |
+
throw new Inx_Api_IllegalArgumentException( "plainTextPattern - illegal value: " . $sPlainTextPattern );
|
445 |
+
if( $sHtmlTextPattern === null || strlen($sHtmlTextPattern) == 0 )
|
446 |
+
throw new Inx_Api_IllegalArgumentException( "htmlTextPattern - illegal value: " . $sHtmlTextPattern );
|
447 |
+
}
|
448 |
+
else
|
449 |
+
throw new Inx_Api_IllegalArgumentException( "unknown defaultFormat: " . $sDefaultFormat );
|
450 |
+
|
451 |
+
return self::PREFIX . "2|" . $iAttributeId . "|" . $sHtmlTextPattern . "|" . $sPlainTextPattern
|
452 |
+
. "|" . $sMultipartPattern . "|" . $sDefaultFormat . self::SUFFIX;
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
private static function checkFormat( $sFormat )
|
457 |
+
{
|
458 |
+
if( strcmp(self::PLAIN_TEXT_FORMAT, $sFormat ) === 0)
|
459 |
+
return;
|
460 |
+
if( strcmp(self::HTML_TEXT_FORMAT, $sFormat ) === 0)
|
461 |
+
return;
|
462 |
+
if( strcmp(self::MULTIPART_FORMAT, $sFormat ) === 0)
|
463 |
+
return;
|
464 |
+
|
465 |
+
throw new Inx_Api_IllegalArgumentException( "unknown format: " . $sFormat );
|
466 |
+
}
|
467 |
+
}
|
lib/Inx/Api/Property/Property.php
CHANGED
@@ -1,126 +1,126 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Property
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Mailing lists have properties, which control the list behaviour.
|
8 |
-
* An <i>Inx_Api_Property_Property</i> may control, for example, the default mail encoding, the maximal sending
|
9 |
-
* performance, or settings used by features, such as the hard bounce threshold.
|
10 |
-
* The properties can be accessed through the <i>Inx_Api_List_ListContext::findProperty($sPropertyName)</i> and
|
11 |
-
* <i>Inx_Api_List_ListContext::selectProperties()</i> methods.
|
12 |
-
* <p>
|
13 |
-
* The following snippet shows how to retrieve a specific property, namely the mail encoding property:
|
14 |
-
*
|
15 |
-
* <pre>
|
16 |
-
* $oListContext = ...
|
17 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_ENCODING );
|
18 |
-
* echo $oProperty->getInternalValue();
|
19 |
-
* </pre>
|
20 |
-
*
|
21 |
-
* Note: Not all properties are available for all lists.
|
22 |
-
* The <i>Inx_Api_Property_PropertyNames</i> interface documentation states, which properties are available for which lists.
|
23 |
-
* <p>
|
24 |
-
* The following snippet shows how to retrieve all properties of a list:
|
25 |
-
*
|
26 |
-
* <pre>
|
27 |
-
* $oBOResultSet = $oListContext->selectProperties();
|
28 |
-
*
|
29 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
30 |
-
* {
|
31 |
-
* $oProperty = $oBOResultSet->get( $i );
|
32 |
-
* echo $oProperty->getName()."<br>";
|
33 |
-
* }
|
34 |
-
*
|
35 |
-
* $oBOResultSet->close();
|
36 |
-
* </pre>
|
37 |
-
* <p>
|
38 |
-
* The following snippet shows how to change the locale of a specific list to English:
|
39 |
-
*
|
40 |
-
* <pre>
|
41 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
42 |
-
*
|
43 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::FORMAT_LOCALE );
|
44 |
-
* $oProperty->updateInternalValue( "en" );
|
45 |
-
* $oProperty->commitUpdate();
|
46 |
-
* </pre>
|
47 |
-
* <p>
|
48 |
-
* Most of the properties can be set easily as the values are simple numbers or strings (see above).
|
49 |
-
* However, there are two special properties which require a bit more effort to be set correctly:
|
50 |
-
* <ol>
|
51 |
-
* <li><i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i>: Defines the approval method and the approvers.
|
52 |
-
* <li><i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i>: Defines the default mailing format.
|
53 |
-
* </ol>
|
54 |
-
* These two properties have a special internal value syntax.
|
55 |
-
* To ease the setting of these two properties, there are two formatters used to parse and create the internal values:
|
56 |
-
* <ol>
|
57 |
-
* <li><i>Inx_Api_Property_PropertyFormatter</i> for the approval property.
|
58 |
-
* <li><i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for the mail format property.
|
59 |
-
* </ol>
|
60 |
-
* An <i>Inx_Api_Property_PropertyFormatter</i> instance can be obtained using the <i>getFormatter()</i> method.
|
61 |
-
* The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> offers static methods for conversion instead.
|
62 |
-
* For examples on how to use the formatters, see their respective documentation.
|
63 |
-
* <p>
|
64 |
-
* Note: Several api user rights are required to use properties, depending on which properties shall be
|
65 |
-
* retrieved/manipulated.
|
66 |
-
* See the PROPERTY_* constants in the <i>Inx_Api_UserRights</i> documentation.
|
67 |
-
*
|
68 |
-
* @see Inx_Api_List_ListContext::findProperty($sPropertyName)
|
69 |
-
* @see Inx_Api_List_ListContext::selectProperties()
|
70 |
-
* @see Inx_Api_Property_PropertyNames
|
71 |
-
* @see Inx_Api_Property_PropertyFormatter
|
72 |
-
* @see Inx_Api_Property_FormatChoicePropertyFormatter
|
73 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
74 |
-
* @package Inxmail
|
75 |
-
* @subpackage Property
|
76 |
-
*/
|
77 |
-
interface Inx_Api_Property_Property extends Inx_Api_BusinessObject
|
78 |
-
{
|
79 |
-
/**
|
80 |
-
* Constant for the property value attribute. Used by the <i>UpdateException</i> to indicate the error source.
|
81 |
-
*
|
82 |
-
* @see Inx_Api_UpdateException#getErrorSource()
|
83 |
-
*/
|
84 |
-
const ATTRIBUTE_VALUE = 1;
|
85 |
-
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Returns the name of the property.
|
89 |
-
*
|
90 |
-
* @see Inx_Api_Property_PropertyNames
|
91 |
-
* @return string the name of the property.
|
92 |
-
*/
|
93 |
-
public function getName();
|
94 |
-
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Returns the value of the property.
|
98 |
-
*
|
99 |
-
* @return string the value of the property.
|
100 |
-
*/
|
101 |
-
public function getInternalValue();
|
102 |
-
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Updates the value of the property.
|
106 |
-
* <p>
|
107 |
-
* For the <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property use the
|
108 |
-
* <i>Inx_Api_Property_PropertyFormatter</i> provided by <i>getFormatter()<i>.
|
109 |
-
* For the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE<i> property use the
|
110 |
-
* <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
|
111 |
-
*
|
112 |
-
* @param string $sValue the value of the property.
|
113 |
-
*/
|
114 |
-
public function updateInternalValue( $sValue );
|
115 |
-
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Returns the <i>Inx_Api_Property_PropertyFormatter</i> instance used to format the
|
119 |
-
* <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property.
|
120 |
-
*
|
121 |
-
* @return Inx_Api_Property_PropertyFormatter the <i>PropertyFormatter</i> used to format the approval property.
|
122 |
-
* @since API 1.6.0
|
123 |
-
*/
|
124 |
-
public function getFormatter();
|
125 |
-
|
126 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Property
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Mailing lists have properties, which control the list behaviour.
|
8 |
+
* An <i>Inx_Api_Property_Property</i> may control, for example, the default mail encoding, the maximal sending
|
9 |
+
* performance, or settings used by features, such as the hard bounce threshold.
|
10 |
+
* The properties can be accessed through the <i>Inx_Api_List_ListContext::findProperty($sPropertyName)</i> and
|
11 |
+
* <i>Inx_Api_List_ListContext::selectProperties()</i> methods.
|
12 |
+
* <p>
|
13 |
+
* The following snippet shows how to retrieve a specific property, namely the mail encoding property:
|
14 |
+
*
|
15 |
+
* <pre>
|
16 |
+
* $oListContext = ...
|
17 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::MAIL_ENCODING );
|
18 |
+
* echo $oProperty->getInternalValue();
|
19 |
+
* </pre>
|
20 |
+
*
|
21 |
+
* Note: Not all properties are available for all lists.
|
22 |
+
* The <i>Inx_Api_Property_PropertyNames</i> interface documentation states, which properties are available for which lists.
|
23 |
+
* <p>
|
24 |
+
* The following snippet shows how to retrieve all properties of a list:
|
25 |
+
*
|
26 |
+
* <pre>
|
27 |
+
* $oBOResultSet = $oListContext->selectProperties();
|
28 |
+
*
|
29 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
30 |
+
* {
|
31 |
+
* $oProperty = $oBOResultSet->get( $i );
|
32 |
+
* echo $oProperty->getName()."<br>";
|
33 |
+
* }
|
34 |
+
*
|
35 |
+
* $oBOResultSet->close();
|
36 |
+
* </pre>
|
37 |
+
* <p>
|
38 |
+
* The following snippet shows how to change the locale of a specific list to English:
|
39 |
+
*
|
40 |
+
* <pre>
|
41 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
42 |
+
*
|
43 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::FORMAT_LOCALE );
|
44 |
+
* $oProperty->updateInternalValue( "en" );
|
45 |
+
* $oProperty->commitUpdate();
|
46 |
+
* </pre>
|
47 |
+
* <p>
|
48 |
+
* Most of the properties can be set easily as the values are simple numbers or strings (see above).
|
49 |
+
* However, there are two special properties which require a bit more effort to be set correctly:
|
50 |
+
* <ol>
|
51 |
+
* <li><i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i>: Defines the approval method and the approvers.
|
52 |
+
* <li><i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE</i>: Defines the default mailing format.
|
53 |
+
* </ol>
|
54 |
+
* These two properties have a special internal value syntax.
|
55 |
+
* To ease the setting of these two properties, there are two formatters used to parse and create the internal values:
|
56 |
+
* <ol>
|
57 |
+
* <li><i>Inx_Api_Property_PropertyFormatter</i> for the approval property.
|
58 |
+
* <li><i>Inx_Api_Property_FormatChoicePropertyFormatter</i> for the mail format property.
|
59 |
+
* </ol>
|
60 |
+
* An <i>Inx_Api_Property_PropertyFormatter</i> instance can be obtained using the <i>getFormatter()</i> method.
|
61 |
+
* The <i>Inx_Api_Property_FormatChoicePropertyFormatter</i> offers static methods for conversion instead.
|
62 |
+
* For examples on how to use the formatters, see their respective documentation.
|
63 |
+
* <p>
|
64 |
+
* Note: Several api user rights are required to use properties, depending on which properties shall be
|
65 |
+
* retrieved/manipulated.
|
66 |
+
* See the PROPERTY_* constants in the <i>Inx_Api_UserRights</i> documentation.
|
67 |
+
*
|
68 |
+
* @see Inx_Api_List_ListContext::findProperty($sPropertyName)
|
69 |
+
* @see Inx_Api_List_ListContext::selectProperties()
|
70 |
+
* @see Inx_Api_Property_PropertyNames
|
71 |
+
* @see Inx_Api_Property_PropertyFormatter
|
72 |
+
* @see Inx_Api_Property_FormatChoicePropertyFormatter
|
73 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
74 |
+
* @package Inxmail
|
75 |
+
* @subpackage Property
|
76 |
+
*/
|
77 |
+
interface Inx_Api_Property_Property extends Inx_Api_BusinessObject
|
78 |
+
{
|
79 |
+
/**
|
80 |
+
* Constant for the property value attribute. Used by the <i>UpdateException</i> to indicate the error source.
|
81 |
+
*
|
82 |
+
* @see Inx_Api_UpdateException#getErrorSource()
|
83 |
+
*/
|
84 |
+
const ATTRIBUTE_VALUE = 1;
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Returns the name of the property.
|
89 |
+
*
|
90 |
+
* @see Inx_Api_Property_PropertyNames
|
91 |
+
* @return string the name of the property.
|
92 |
+
*/
|
93 |
+
public function getName();
|
94 |
+
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Returns the value of the property.
|
98 |
+
*
|
99 |
+
* @return string the value of the property.
|
100 |
+
*/
|
101 |
+
public function getInternalValue();
|
102 |
+
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Updates the value of the property.
|
106 |
+
* <p>
|
107 |
+
* For the <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property use the
|
108 |
+
* <i>Inx_Api_Property_PropertyFormatter</i> provided by <i>getFormatter()<i>.
|
109 |
+
* For the <i>Inx_Api_Property_PropertyNames::MAIL_FORMAT_CHOICE<i> property use the
|
110 |
+
* <i>Inx_Api_Property_FormatChoicePropertyFormatter</i>.
|
111 |
+
*
|
112 |
+
* @param string $sValue the value of the property.
|
113 |
+
*/
|
114 |
+
public function updateInternalValue( $sValue );
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Returns the <i>Inx_Api_Property_PropertyFormatter</i> instance used to format the
|
119 |
+
* <i>Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE</i> property.
|
120 |
+
*
|
121 |
+
* @return Inx_Api_Property_PropertyFormatter the <i>PropertyFormatter</i> used to format the approval property.
|
122 |
+
* @since API 1.6.0
|
123 |
+
*/
|
124 |
+
public function getFormatter();
|
125 |
+
|
126 |
+
}
|
lib/Inx/Api/Property/PropertyFormatter.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Property
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Property_PropertyFormatter</i> is used for converting property values.
|
8 |
-
* At the moment it is only used for converting the approval property to and from the internal string representation.
|
9 |
-
* An <i>Inx_Api_Property_PropertyFormatter</i> can be obtained by calling <i>Inx_Api_Property_Property::getFormatter()</i>.
|
10 |
-
* <p>
|
11 |
-
* The following snippet shows how to retrieve and parse the approval property of the specified list:
|
12 |
-
*
|
13 |
-
* <pre>
|
14 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
15 |
-
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE );
|
16 |
-
*
|
17 |
-
* $oPropertyFormatter = $oProperty->getFormatter();
|
18 |
-
* $oApprovalPropertyValue = $oPropertyFormatter->parseApprovalPropertyValue( $oProperty );
|
19 |
-
* echo "Approval type: ".$oApprovalPropertyValue->getApprovalType()."<br>";
|
20 |
-
* echo "Primary approver: ".$oApprovalPropertyValue->getPrimaryApproverId()."<br>";
|
21 |
-
* echo "Secondary approver: ".$oApprovalPropertyValue->getSecondaryApproverId()."<br>";
|
22 |
-
* </pre>
|
23 |
-
*
|
24 |
-
* It is also possible to convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal string representation.
|
25 |
-
* The following snippet shows how to update the approval process policy of the specified list:
|
26 |
-
*
|
27 |
-
* <pre>
|
28 |
-
* $iPrimaryApproverId = ...
|
29 |
-
* $iSecondaryApproverId = ...
|
30 |
-
*
|
31 |
-
* $oListContext = $oSession->getListContextManager()->findByName("Desired list");
|
32 |
-
* $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE);
|
33 |
-
*
|
34 |
-
* $oPropertyFormatter = $oProperty->getFormatter();
|
35 |
-
* $oApprovalPropertyValue = new Inx_Api_Property_ApprovalPropertyValue(
|
36 |
-
* Inx_Api_Property_ApprovalPropertyValue::APPROVAL_TYPE_ESCALATION, $iPrimaryApproverId, $iSecondaryApproverId);
|
37 |
-
* $oProperty->updateInternalValue($oPropertyFormatter->createApprovalPropertyValue($oApprovalPropertyValue));
|
38 |
-
* $oProperty->commitUpdate();
|
39 |
-
* </pre>
|
40 |
-
* <p>
|
41 |
-
* For more information on the approval property and the possible approval types, see the
|
42 |
-
* <i>Inx_Api_Propterty_ApprovalPropertyValue</i> documentation.
|
43 |
-
* <p>
|
44 |
-
* For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
|
45 |
-
*
|
46 |
-
* @see Inx_Api_Property_ApprovalPropertyValue
|
47 |
-
* @see Inx_Api_Property_Property
|
48 |
-
* @since API 1.6.0
|
49 |
-
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
50 |
-
* @package Inxmail
|
51 |
-
* @subpackage Property
|
52 |
-
*/
|
53 |
-
interface Inx_Api_Property_PropertyFormatter
|
54 |
-
{
|
55 |
-
/**
|
56 |
-
* Creates the internal value string for the given <i>Inx_Api_Property_ApprovalPropertyValue</i> which is
|
57 |
-
* used for <i>Inx_Api_Property_Property::updateInternalValue($sValue)</i>.
|
58 |
-
*
|
59 |
-
* @param string $value the <i>Inx_Api_Property_ApprovalPropertyValue</i> which contains the new approval
|
60 |
-
* process policy.
|
61 |
-
* @return string the internal value string.
|
62 |
-
*/
|
63 |
-
public function createApprovalPropertyValue( $value );
|
64 |
-
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Parses a property and creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> object containing the
|
68 |
-
* approval process policy.
|
69 |
-
* This object can be used to easily retrieve the specifics of the approval process policy.
|
70 |
-
*
|
71 |
-
* @param Inx_Api_Property_Property $property the property containing the approval value.
|
72 |
-
* @return Inx_Api_Property_ApprovalPropertyValue an <i>Inx_Api_Property_ApprovalPropertyValue</i> containing
|
73 |
-
* the approval process policy.
|
74 |
-
*/
|
75 |
-
public function parseApprovalPropertyValue( $property );
|
76 |
-
|
77 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Property
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Property_PropertyFormatter</i> is used for converting property values.
|
8 |
+
* At the moment it is only used for converting the approval property to and from the internal string representation.
|
9 |
+
* An <i>Inx_Api_Property_PropertyFormatter</i> can be obtained by calling <i>Inx_Api_Property_Property::getFormatter()</i>.
|
10 |
+
* <p>
|
11 |
+
* The following snippet shows how to retrieve and parse the approval property of the specified list:
|
12 |
+
*
|
13 |
+
* <pre>
|
14 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
15 |
+
* $oProperty = $oListContext->findProperty( Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE );
|
16 |
+
*
|
17 |
+
* $oPropertyFormatter = $oProperty->getFormatter();
|
18 |
+
* $oApprovalPropertyValue = $oPropertyFormatter->parseApprovalPropertyValue( $oProperty );
|
19 |
+
* echo "Approval type: ".$oApprovalPropertyValue->getApprovalType()."<br>";
|
20 |
+
* echo "Primary approver: ".$oApprovalPropertyValue->getPrimaryApproverId()."<br>";
|
21 |
+
* echo "Secondary approver: ".$oApprovalPropertyValue->getSecondaryApproverId()."<br>";
|
22 |
+
* </pre>
|
23 |
+
*
|
24 |
+
* It is also possible to convert an <i>Inx_Api_Property_ApprovalPropertyValue</i> into the internal string representation.
|
25 |
+
* The following snippet shows how to update the approval process policy of the specified list:
|
26 |
+
*
|
27 |
+
* <pre>
|
28 |
+
* $iPrimaryApproverId = ...
|
29 |
+
* $iSecondaryApproverId = ...
|
30 |
+
*
|
31 |
+
* $oListContext = $oSession->getListContextManager()->findByName("Desired list");
|
32 |
+
* $oProperty = $oListContext->findProperty(Inx_Api_Property_PropertyNames::APPROVAL_ACTIVE);
|
33 |
+
*
|
34 |
+
* $oPropertyFormatter = $oProperty->getFormatter();
|
35 |
+
* $oApprovalPropertyValue = new Inx_Api_Property_ApprovalPropertyValue(
|
36 |
+
* Inx_Api_Property_ApprovalPropertyValue::APPROVAL_TYPE_ESCALATION, $iPrimaryApproverId, $iSecondaryApproverId);
|
37 |
+
* $oProperty->updateInternalValue($oPropertyFormatter->createApprovalPropertyValue($oApprovalPropertyValue));
|
38 |
+
* $oProperty->commitUpdate();
|
39 |
+
* </pre>
|
40 |
+
* <p>
|
41 |
+
* For more information on the approval property and the possible approval types, see the
|
42 |
+
* <i>Inx_Api_Propterty_ApprovalPropertyValue</i> documentation.
|
43 |
+
* <p>
|
44 |
+
* For more information on properties in general, see the <i>Inx_Api_Property_Property</i> documentation.
|
45 |
+
*
|
46 |
+
* @see Inx_Api_Property_ApprovalPropertyValue
|
47 |
+
* @see Inx_Api_Property_Property
|
48 |
+
* @since API 1.6.0
|
49 |
+
* @version $Revision: 10520 $ $Date: 2008-09-12 14:40:48 +0200 (Fr, 12 Sep 2008) $ $Author: sbn $
|
50 |
+
* @package Inxmail
|
51 |
+
* @subpackage Property
|
52 |
+
*/
|
53 |
+
interface Inx_Api_Property_PropertyFormatter
|
54 |
+
{
|
55 |
+
/**
|
56 |
+
* Creates the internal value string for the given <i>Inx_Api_Property_ApprovalPropertyValue</i> which is
|
57 |
+
* used for <i>Inx_Api_Property_Property::updateInternalValue($sValue)</i>.
|
58 |
+
*
|
59 |
+
* @param string $value the <i>Inx_Api_Property_ApprovalPropertyValue</i> which contains the new approval
|
60 |
+
* process policy.
|
61 |
+
* @return string the internal value string.
|
62 |
+
*/
|
63 |
+
public function createApprovalPropertyValue( $value );
|
64 |
+
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Parses a property and creates an <i>Inx_Api_Property_ApprovalPropertyValue</i> object containing the
|
68 |
+
* approval process policy.
|
69 |
+
* This object can be used to easily retrieve the specifics of the approval process policy.
|
70 |
+
*
|
71 |
+
* @param Inx_Api_Property_Property $property the property containing the approval value.
|
72 |
+
* @return Inx_Api_Property_ApprovalPropertyValue an <i>Inx_Api_Property_ApprovalPropertyValue</i> containing
|
73 |
+
* the approval process policy.
|
74 |
+
*/
|
75 |
+
public function parseApprovalPropertyValue( $property );
|
76 |
+
|
77 |
+
}
|
lib/Inx/Api/Recipient/Attribute.php
CHANGED
@@ -1,266 +1,266 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Recipient
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_Recipient_Attribute</i> contains meta data of recipients.
|
8 |
-
* It is the API equivalent of a column in the Inxmail recipient list view.
|
9 |
-
* There are mainly two categories of attributes:
|
10 |
-
* <ol>
|
11 |
-
* <li>Predefined attributes are created by Inxmail and may not be removed or renamed.
|
12 |
-
* The most important attributes of this type are:
|
13 |
-
* <ul>
|
14 |
-
* <li><i>The id attribute</i>: Contains the id of the recipient</li>
|
15 |
-
* <li><i>The email attribute</i>: Contains the email address of the recipient</li>
|
16 |
-
* <li><i>The key attribute</i>: In general the same as the email attribute</li>
|
17 |
-
* <li><i>The subscription attribute</i>: Contains the subscription date of the recipient - Individual for every list</li>
|
18 |
-
* <li><i>The last modification attribute</i>: Contains the date of the last modification of the recipient</li>
|
19 |
-
* <li><i>The hard bounce attribute</i>: Contains the number of hard bounces received for the recipient</li>
|
20 |
-
* </ul>
|
21 |
-
* </li>
|
22 |
-
* <li>User attributes are created by Inxmail users and may be freely removed or renamed.
|
23 |
-
* User attributes give you the ability to treat a recipient according to certain properties.
|
24 |
-
* For example you could create an user attribute called 'format' which contains the users preferred mail format.
|
25 |
-
* You could then set the mailing format according to this attribute.
|
26 |
-
* You could also define an user attribute to store certain interests of the recipient and generate filters
|
27 |
-
* (target groups) to send a mailing only to recipients who are interested in the topic covered by the mailing.</li>
|
28 |
-
* </ol>
|
29 |
-
* All attributes share a common set of properties, which define them. These properties are:
|
30 |
-
* <p/>
|
31 |
-
* <ul>
|
32 |
-
* <li><i>The id</i>: Each attribute has a unique id.</li>
|
33 |
-
* <li><i>The name</i>: Each attribute has an unique name. This name is only retrievable for user attributes, though.</li>
|
34 |
-
* <li><i>The type</i>: The different attribute types are:
|
35 |
-
* <ul>
|
36 |
-
* <li><i>EMAIL_ATTRIBUTE_TYPE</i>: The email attribute</li>
|
37 |
-
* <li><i>ID_ATTRIBUTE_TYPE</i>: The id attribute</li>
|
38 |
-
* <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>: An attribute that indicates the subscription state for a specific list</li>
|
39 |
-
* <li><i>LAST_MODIFICATION_ATTRIBUTE_TYPE</i>: The last modification date attribute</li>
|
40 |
-
* <li><i>HARDBOUNCE_ATTRIBUTE_TYPE</i>: Contains the number of hard bounces received for a recipient</li>
|
41 |
-
* <li><i>FEATURE_ATTRIBUTE_TYPE</i>: An attribute associated with a feature (agent)</li>
|
42 |
-
* <li><i>USER_ATTRIBUTE_TYPE</i>: An user defined attribute</li>
|
43 |
-
* </ul>
|
44 |
-
* </li>
|
45 |
-
* <li><i>The data type</i>: The different data types are:
|
46 |
-
* <ul>
|
47 |
-
* <li><i>DATA_TYPE_STRING</i></li>
|
48 |
-
* <li><i>DATA_TYPE_DATETIME</i></li>
|
49 |
-
* <li><i>DATA_TYPE_DATE</i></li>
|
50 |
-
* <li><i>DATA_TYPE_TIME</i></li>
|
51 |
-
* <li><i>DATA_TYPE_BOOLEAN</i></li>
|
52 |
-
* <li><i>DATA_TYPE_INTEGER</i></li>
|
53 |
-
* <li><i>DATA_TYPE_DOUBLE</i></li>
|
54 |
-
* </ul>
|
55 |
-
* </li>
|
56 |
-
* <li><i>The maximum String length</i>: If the data type is <i>DATA_TYPE_STRING</i>, the attribute can not be longer
|
57 |
-
* than the maximum length defined in this property.</li>
|
58 |
-
* <li><i>The list context id</i>: Mainly used by attributes of type <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> to indicate
|
59 |
-
* the list they are responsible for.</li>
|
60 |
-
* <li><i>The feature (agent) id</i>: Some attributes are used by specific features.</li>
|
61 |
-
* <li><i>The accessibility</i>: Only relevant for plug-ins.</li>
|
62 |
-
* </ul>
|
63 |
-
* <p/>
|
64 |
-
* Predefined attributes can easily be retrieved using the various get methods of the <i>Inx_Api_Recipient_RecipientMetaData</i> class.
|
65 |
-
* User attributes are retrieved using the <i>Inx_Api_Recipient_RecipientMetaData::getUserAttribute($sName)</i> method
|
66 |
-
* and are identified by their unique name.
|
67 |
-
* See the <i>Inx_Api_Recipient_RecipientMetaData</i> documentation for more information.
|
68 |
-
* <p/>
|
69 |
-
* User attributes may be created, removed and renamed using the <i>Inx_Api_Recipient_AttributeManager</i>.
|
70 |
-
* For more information on this topic, see the <i>AttributeManager</i> documentation.
|
71 |
-
*
|
72 |
-
* @see Inx_Api_Recipient_AttributeManager
|
73 |
-
* @see Inx_Api_Recipient_RecipientMetaData
|
74 |
-
* @since API 1.0
|
75 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
76 |
-
* @package Inxmail
|
77 |
-
* @subpackage Recipient
|
78 |
-
*/
|
79 |
-
interface Inx_Api_Recipient_Attribute
|
80 |
-
{
|
81 |
-
/**
|
82 |
-
* Constant for the data type String.
|
83 |
-
*
|
84 |
-
* @var int
|
85 |
-
*/
|
86 |
-
const DATA_TYPE_STRING = 1;
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Constant for the data type Integer.
|
90 |
-
*
|
91 |
-
* @var int
|
92 |
-
*/
|
93 |
-
const DATA_TYPE_INTEGER = 2;
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Constant for the data type Double.
|
97 |
-
*
|
98 |
-
* @var int
|
99 |
-
*/
|
100 |
-
const DATA_TYPE_DOUBLE = 3;
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Constant for the data type Boolean.
|
104 |
-
*
|
105 |
-
* @var int
|
106 |
-
*/
|
107 |
-
const DATA_TYPE_BOOLEAN = 4;
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Constant for the data type Datetime (Date + Time).
|
111 |
-
*
|
112 |
-
* @var int
|
113 |
-
*/
|
114 |
-
const DATA_TYPE_DATETIME = 10;
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Constant for the data type Date (without Time).
|
118 |
-
*
|
119 |
-
* @var int
|
120 |
-
*/
|
121 |
-
const DATA_TYPE_DATE = 11;
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Constant for the data type Time (without Date).
|
125 |
-
*
|
126 |
-
* @var int
|
127 |
-
*/
|
128 |
-
const DATA_TYPE_TIME = 12;
|
129 |
-
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Constant for attributes used by features.
|
133 |
-
*
|
134 |
-
* @var int
|
135 |
-
*/
|
136 |
-
const FEATURE_ATTRIBUTE_TYPE = 1;
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Constant for attributes containing list subscription information.
|
140 |
-
*
|
141 |
-
* @var int
|
142 |
-
*/
|
143 |
-
const SUBSCRIPTION_ATTRIBUTE_TYPE = 2;
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Constant for the email attribute.
|
147 |
-
*
|
148 |
-
* @var int
|
149 |
-
*/
|
150 |
-
const EMAIL_ATTRIBUTE_TYPE = 3;
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Constant for the id attribute.
|
154 |
-
*
|
155 |
-
* @var int
|
156 |
-
*/
|
157 |
-
const ID_ATTRIBUTE_TYPE = 4;
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Constant for user defined attributes.
|
161 |
-
*
|
162 |
-
* @var int
|
163 |
-
*/
|
164 |
-
const USER_ATTRIBUTE_TYPE = 5;
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Constant for the last modification attribute.
|
168 |
-
*
|
169 |
-
* @var int
|
170 |
-
*/
|
171 |
-
const LAST_MODIFICATION_ATTRIBUTE_TYPE = 7;
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Constant for the hard bounce attribute (counter).
|
175 |
-
*
|
176 |
-
* @var int
|
177 |
-
* @since API 1.6.0
|
178 |
-
*/
|
179 |
-
const HARDBOUNCE_ATTRIBUTE_TYPE = 8;
|
180 |
-
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Returns the unique id of this attribute.
|
184 |
-
*
|
185 |
-
* @return int the unique id of this attribute.
|
186 |
-
*/
|
187 |
-
public function getId();
|
188 |
-
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Returns the unique name of this attribute.
|
192 |
-
*
|
193 |
-
* @return string the unique name of this attribute.
|
194 |
-
*/
|
195 |
-
public function getName();
|
196 |
-
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Returns the attribute type of this attribute.
|
200 |
-
* May be one of:
|
201 |
-
* <ul>
|
202 |
-
* <li><i>ID_ATTRIBUTE_TYPE</i>
|
203 |
-
* <li><i>EMAIL_ATTRIBUTE_TYPE</i>
|
204 |
-
* <li><i>USER_ATTRIBUTE_TYPE</i>
|
205 |
-
* <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>
|
206 |
-
* <li><i>LAST_MODIFIED_ATTRIBUTE_TYPE</i>
|
207 |
-
* <li><i>FEATURE_ATTRIBUTE_TYPE</i>
|
208 |
-
* </ul>
|
209 |
-
*
|
210 |
-
* @return int the attribute type of this attribute.
|
211 |
-
*/
|
212 |
-
public function getType();
|
213 |
-
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Returns the data type of this attribute.
|
217 |
-
* May be one of:
|
218 |
-
* <ul>
|
219 |
-
* <li><i>DATA_TYPE_STRING</i>
|
220 |
-
* <li><i>DATA_TYPE_INTEGER</i>
|
221 |
-
* <li><i>DATA_TYPE_DOUBLE</i>
|
222 |
-
* <li><i>DATA_TYPE_BOOLEAN</i>
|
223 |
-
* <li><i>DATA_TYPE_DATETIME</i>
|
224 |
-
* <li><i>DATA_TYPE_DATE</i>
|
225 |
-
* <li><i>DATA_TYPE_TIME</i>
|
226 |
-
* </ul>
|
227 |
-
*
|
228 |
-
* @return int the data type of this attribute.
|
229 |
-
*/
|
230 |
-
public function getDataType();
|
231 |
-
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Returns the maximum length of the string value of this attribute.
|
235 |
-
* Only relevant if the data type is <i>DATA_TYPE_STRING</i>.
|
236 |
-
*
|
237 |
-
* @return int the maximum length of the string value of this attribute.
|
238 |
-
*/
|
239 |
-
public function getMaxStringLength();
|
240 |
-
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Returns the list context id of this attribute.
|
244 |
-
* Only relevant if the attribute type is <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> or <i>FEATURE_ATTRIBUTE_TYPE</i>.
|
245 |
-
*
|
246 |
-
* @return int the list context id of this attribute.
|
247 |
-
*/
|
248 |
-
public function getListContextId();
|
249 |
-
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Returns the feature id of this attribute.
|
253 |
-
* Only relevant if the attribute type is <i>FEATURE_ATTRIBUTE_TYPE</i>.
|
254 |
-
*
|
255 |
-
* @return int the feature id of this attribute.
|
256 |
-
*/
|
257 |
-
public function getFeatureId();
|
258 |
-
|
259 |
-
/**
|
260 |
-
* Only relevant in a plug-in api session.
|
261 |
-
*
|
262 |
-
* @return bool the accessibility of this attribute.
|
263 |
-
*/
|
264 |
-
public function isAccessible();
|
265 |
-
|
266 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Recipient
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_Recipient_Attribute</i> contains meta data of recipients.
|
8 |
+
* It is the API equivalent of a column in the Inxmail recipient list view.
|
9 |
+
* There are mainly two categories of attributes:
|
10 |
+
* <ol>
|
11 |
+
* <li>Predefined attributes are created by Inxmail and may not be removed or renamed.
|
12 |
+
* The most important attributes of this type are:
|
13 |
+
* <ul>
|
14 |
+
* <li><i>The id attribute</i>: Contains the id of the recipient</li>
|
15 |
+
* <li><i>The email attribute</i>: Contains the email address of the recipient</li>
|
16 |
+
* <li><i>The key attribute</i>: In general the same as the email attribute</li>
|
17 |
+
* <li><i>The subscription attribute</i>: Contains the subscription date of the recipient - Individual for every list</li>
|
18 |
+
* <li><i>The last modification attribute</i>: Contains the date of the last modification of the recipient</li>
|
19 |
+
* <li><i>The hard bounce attribute</i>: Contains the number of hard bounces received for the recipient</li>
|
20 |
+
* </ul>
|
21 |
+
* </li>
|
22 |
+
* <li>User attributes are created by Inxmail users and may be freely removed or renamed.
|
23 |
+
* User attributes give you the ability to treat a recipient according to certain properties.
|
24 |
+
* For example you could create an user attribute called 'format' which contains the users preferred mail format.
|
25 |
+
* You could then set the mailing format according to this attribute.
|
26 |
+
* You could also define an user attribute to store certain interests of the recipient and generate filters
|
27 |
+
* (target groups) to send a mailing only to recipients who are interested in the topic covered by the mailing.</li>
|
28 |
+
* </ol>
|
29 |
+
* All attributes share a common set of properties, which define them. These properties are:
|
30 |
+
* <p/>
|
31 |
+
* <ul>
|
32 |
+
* <li><i>The id</i>: Each attribute has a unique id.</li>
|
33 |
+
* <li><i>The name</i>: Each attribute has an unique name. This name is only retrievable for user attributes, though.</li>
|
34 |
+
* <li><i>The type</i>: The different attribute types are:
|
35 |
+
* <ul>
|
36 |
+
* <li><i>EMAIL_ATTRIBUTE_TYPE</i>: The email attribute</li>
|
37 |
+
* <li><i>ID_ATTRIBUTE_TYPE</i>: The id attribute</li>
|
38 |
+
* <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>: An attribute that indicates the subscription state for a specific list</li>
|
39 |
+
* <li><i>LAST_MODIFICATION_ATTRIBUTE_TYPE</i>: The last modification date attribute</li>
|
40 |
+
* <li><i>HARDBOUNCE_ATTRIBUTE_TYPE</i>: Contains the number of hard bounces received for a recipient</li>
|
41 |
+
* <li><i>FEATURE_ATTRIBUTE_TYPE</i>: An attribute associated with a feature (agent)</li>
|
42 |
+
* <li><i>USER_ATTRIBUTE_TYPE</i>: An user defined attribute</li>
|
43 |
+
* </ul>
|
44 |
+
* </li>
|
45 |
+
* <li><i>The data type</i>: The different data types are:
|
46 |
+
* <ul>
|
47 |
+
* <li><i>DATA_TYPE_STRING</i></li>
|
48 |
+
* <li><i>DATA_TYPE_DATETIME</i></li>
|
49 |
+
* <li><i>DATA_TYPE_DATE</i></li>
|
50 |
+
* <li><i>DATA_TYPE_TIME</i></li>
|
51 |
+
* <li><i>DATA_TYPE_BOOLEAN</i></li>
|
52 |
+
* <li><i>DATA_TYPE_INTEGER</i></li>
|
53 |
+
* <li><i>DATA_TYPE_DOUBLE</i></li>
|
54 |
+
* </ul>
|
55 |
+
* </li>
|
56 |
+
* <li><i>The maximum String length</i>: If the data type is <i>DATA_TYPE_STRING</i>, the attribute can not be longer
|
57 |
+
* than the maximum length defined in this property.</li>
|
58 |
+
* <li><i>The list context id</i>: Mainly used by attributes of type <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> to indicate
|
59 |
+
* the list they are responsible for.</li>
|
60 |
+
* <li><i>The feature (agent) id</i>: Some attributes are used by specific features.</li>
|
61 |
+
* <li><i>The accessibility</i>: Only relevant for plug-ins.</li>
|
62 |
+
* </ul>
|
63 |
+
* <p/>
|
64 |
+
* Predefined attributes can easily be retrieved using the various get methods of the <i>Inx_Api_Recipient_RecipientMetaData</i> class.
|
65 |
+
* User attributes are retrieved using the <i>Inx_Api_Recipient_RecipientMetaData::getUserAttribute($sName)</i> method
|
66 |
+
* and are identified by their unique name.
|
67 |
+
* See the <i>Inx_Api_Recipient_RecipientMetaData</i> documentation for more information.
|
68 |
+
* <p/>
|
69 |
+
* User attributes may be created, removed and renamed using the <i>Inx_Api_Recipient_AttributeManager</i>.
|
70 |
+
* For more information on this topic, see the <i>AttributeManager</i> documentation.
|
71 |
+
*
|
72 |
+
* @see Inx_Api_Recipient_AttributeManager
|
73 |
+
* @see Inx_Api_Recipient_RecipientMetaData
|
74 |
+
* @since API 1.0
|
75 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
76 |
+
* @package Inxmail
|
77 |
+
* @subpackage Recipient
|
78 |
+
*/
|
79 |
+
interface Inx_Api_Recipient_Attribute
|
80 |
+
{
|
81 |
+
/**
|
82 |
+
* Constant for the data type String.
|
83 |
+
*
|
84 |
+
* @var int
|
85 |
+
*/
|
86 |
+
const DATA_TYPE_STRING = 1;
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Constant for the data type Integer.
|
90 |
+
*
|
91 |
+
* @var int
|
92 |
+
*/
|
93 |
+
const DATA_TYPE_INTEGER = 2;
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Constant for the data type Double.
|
97 |
+
*
|
98 |
+
* @var int
|
99 |
+
*/
|
100 |
+
const DATA_TYPE_DOUBLE = 3;
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Constant for the data type Boolean.
|
104 |
+
*
|
105 |
+
* @var int
|
106 |
+
*/
|
107 |
+
const DATA_TYPE_BOOLEAN = 4;
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Constant for the data type Datetime (Date + Time).
|
111 |
+
*
|
112 |
+
* @var int
|
113 |
+
*/
|
114 |
+
const DATA_TYPE_DATETIME = 10;
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Constant for the data type Date (without Time).
|
118 |
+
*
|
119 |
+
* @var int
|
120 |
+
*/
|
121 |
+
const DATA_TYPE_DATE = 11;
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Constant for the data type Time (without Date).
|
125 |
+
*
|
126 |
+
* @var int
|
127 |
+
*/
|
128 |
+
const DATA_TYPE_TIME = 12;
|
129 |
+
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Constant for attributes used by features.
|
133 |
+
*
|
134 |
+
* @var int
|
135 |
+
*/
|
136 |
+
const FEATURE_ATTRIBUTE_TYPE = 1;
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Constant for attributes containing list subscription information.
|
140 |
+
*
|
141 |
+
* @var int
|
142 |
+
*/
|
143 |
+
const SUBSCRIPTION_ATTRIBUTE_TYPE = 2;
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Constant for the email attribute.
|
147 |
+
*
|
148 |
+
* @var int
|
149 |
+
*/
|
150 |
+
const EMAIL_ATTRIBUTE_TYPE = 3;
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Constant for the id attribute.
|
154 |
+
*
|
155 |
+
* @var int
|
156 |
+
*/
|
157 |
+
const ID_ATTRIBUTE_TYPE = 4;
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Constant for user defined attributes.
|
161 |
+
*
|
162 |
+
* @var int
|
163 |
+
*/
|
164 |
+
const USER_ATTRIBUTE_TYPE = 5;
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Constant for the last modification attribute.
|
168 |
+
*
|
169 |
+
* @var int
|
170 |
+
*/
|
171 |
+
const LAST_MODIFICATION_ATTRIBUTE_TYPE = 7;
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Constant for the hard bounce attribute (counter).
|
175 |
+
*
|
176 |
+
* @var int
|
177 |
+
* @since API 1.6.0
|
178 |
+
*/
|
179 |
+
const HARDBOUNCE_ATTRIBUTE_TYPE = 8;
|
180 |
+
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Returns the unique id of this attribute.
|
184 |
+
*
|
185 |
+
* @return int the unique id of this attribute.
|
186 |
+
*/
|
187 |
+
public function getId();
|
188 |
+
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Returns the unique name of this attribute.
|
192 |
+
*
|
193 |
+
* @return string the unique name of this attribute.
|
194 |
+
*/
|
195 |
+
public function getName();
|
196 |
+
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Returns the attribute type of this attribute.
|
200 |
+
* May be one of:
|
201 |
+
* <ul>
|
202 |
+
* <li><i>ID_ATTRIBUTE_TYPE</i>
|
203 |
+
* <li><i>EMAIL_ATTRIBUTE_TYPE</i>
|
204 |
+
* <li><i>USER_ATTRIBUTE_TYPE</i>
|
205 |
+
* <li><i>SUBSCRIPTION_ATTRIBUTE_TYPE</i>
|
206 |
+
* <li><i>LAST_MODIFIED_ATTRIBUTE_TYPE</i>
|
207 |
+
* <li><i>FEATURE_ATTRIBUTE_TYPE</i>
|
208 |
+
* </ul>
|
209 |
+
*
|
210 |
+
* @return int the attribute type of this attribute.
|
211 |
+
*/
|
212 |
+
public function getType();
|
213 |
+
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Returns the data type of this attribute.
|
217 |
+
* May be one of:
|
218 |
+
* <ul>
|
219 |
+
* <li><i>DATA_TYPE_STRING</i>
|
220 |
+
* <li><i>DATA_TYPE_INTEGER</i>
|
221 |
+
* <li><i>DATA_TYPE_DOUBLE</i>
|
222 |
+
* <li><i>DATA_TYPE_BOOLEAN</i>
|
223 |
+
* <li><i>DATA_TYPE_DATETIME</i>
|
224 |
+
* <li><i>DATA_TYPE_DATE</i>
|
225 |
+
* <li><i>DATA_TYPE_TIME</i>
|
226 |
+
* </ul>
|
227 |
+
*
|
228 |
+
* @return int the data type of this attribute.
|
229 |
+
*/
|
230 |
+
public function getDataType();
|
231 |
+
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Returns the maximum length of the string value of this attribute.
|
235 |
+
* Only relevant if the data type is <i>DATA_TYPE_STRING</i>.
|
236 |
+
*
|
237 |
+
* @return int the maximum length of the string value of this attribute.
|
238 |
+
*/
|
239 |
+
public function getMaxStringLength();
|
240 |
+
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Returns the list context id of this attribute.
|
244 |
+
* Only relevant if the attribute type is <i>SUBSCRIPTION_ATTRIBUTE_TYPE</i> or <i>FEATURE_ATTRIBUTE_TYPE</i>.
|
245 |
+
*
|
246 |
+
* @return int the list context id of this attribute.
|
247 |
+
*/
|
248 |
+
public function getListContextId();
|
249 |
+
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Returns the feature id of this attribute.
|
253 |
+
* Only relevant if the attribute type is <i>FEATURE_ATTRIBUTE_TYPE</i>.
|
254 |
+
*
|
255 |
+
* @return int the feature id of this attribute.
|
256 |
+
*/
|
257 |
+
public function getFeatureId();
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Only relevant in a plug-in api session.
|
261 |
+
*
|
262 |
+
* @return bool the accessibility of this attribute.
|
263 |
+
*/
|
264 |
+
public function isAccessible();
|
265 |
+
|
266 |
+
}
|
lib/Inx/Api/Recipient/AttributeManager.php
CHANGED
@@ -1,159 +1,159 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Recipient
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Using the <i>Inx_Api_Recipient_AttributeManager</i>, attributes (columns) can be manipulated.
|
8 |
-
* The following operations can be performed using the <i>AttributeManager</i>:
|
9 |
-
* <p>
|
10 |
-
* <ul>
|
11 |
-
* <li>Creating attributes: <i>create(String, int, int)</i>
|
12 |
-
* <li>Removing user attributes: <i>remove(Attribute)</i>
|
13 |
-
* <li>Renaming user attributes: <i>rename(Attribute, String)</i>
|
14 |
-
* <li>Checking list visibility: <i>isAttributeVisibleInList(Attribute, int)</i> and
|
15 |
-
* <i>areAttributesVisibleInList(List, int)</i>
|
16 |
-
* <li>Setting list visibility: <i>setAttributeListVisibility(Attribute, int, boolean)</i> and
|
17 |
-
* <i>setAttributeListVisibilities(List, int, boolean)</i>
|
18 |
-
* <li>Setting global visibility: <i>setGlobalAttributeVisibility(Attribute, boolean)</i> and
|
19 |
-
* <i>setGlobalAttributeVisibilities(List, boolean)</i>
|
20 |
-
* </ul>
|
21 |
-
* Note: Changing the data type of an attribute is not supported by the <i>AttributeManager</i>.
|
22 |
-
* This is a possibly dangerous operation that should - if at all - be performed using the client which can
|
23 |
-
* provide guidance and assistance in converting attributes from on type into another.
|
24 |
-
* <p>
|
25 |
-
* The <i>AttributeManager</i> can not be used to change attribute values for recipients.
|
26 |
-
* This is performed using the <i>Inx_Api_Recipient_RecipientContext</i>.
|
27 |
-
* See the <i>RecipientContext</i> documentation for more information on this topic.
|
28 |
-
* <p>
|
29 |
-
* Following example illustrates how to create a new text attribute with a length of 50 characters:
|
30 |
-
*
|
31 |
-
* <pre>
|
32 |
-
* $oSession->getAttributeManager()->create( "Firstname", Inx_Api_Recipient_Attribute::DATA_TYPE_STRING, 50 );
|
33 |
-
* </pre>
|
34 |
-
* <p>
|
35 |
-
* For more information on <i>Attribute</i>s in general, see the <i>Inx_Api_Recipient_Attribute</i> documentation.
|
36 |
-
*
|
37 |
-
* @see Inx_Api_Recipient_Attribute
|
38 |
-
* @see Inx_Api_Recipient_RecipientContext
|
39 |
-
* @since API 1.0
|
40 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
41 |
-
* @package Inxmail
|
42 |
-
* @subpackage Recipient
|
43 |
-
*/
|
44 |
-
interface Inx_Api_Recipient_AttributeManager
|
45 |
-
{
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Create a new user attribute.
|
49 |
-
*
|
50 |
-
* @param attributeName the unique name of the attribute
|
51 |
-
* @param dataType the data type of the attribute
|
52 |
-
* @param maxStringLenth the length of the string attribute (length from 1 to 255),
|
53 |
-
* only for <i>Inx_Api_Recipient_Attribute::DATA_TYPE_STRING</i>
|
54 |
-
* @return the attribute id of the new attribute
|
55 |
-
* @throws Inx_Api_NameException if the attribute name is illegal or already exist
|
56 |
-
* @see Inx_Api_Recipient_Attribute
|
57 |
-
*/
|
58 |
-
public function create( $sAttributeName, $iDataType, $iMaxStringLenth );
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Rename a user attribute.
|
63 |
-
*
|
64 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to rename
|
65 |
-
* @param string $sAttributeName the new attribute name
|
66 |
-
* @return boolean true, if the attribute is renamed, otherwise false
|
67 |
-
* @throws Inx_Api_NameException if the attribute name is illegal or already exist
|
68 |
-
*/
|
69 |
-
public function rename( Inx_Api_Recipient_Attribute $oAttribute, $sAttributeName );
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Remove a user attribute.
|
74 |
-
*
|
75 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to remove
|
76 |
-
* @return boolean true, if the attribute is removed, otherwise false
|
77 |
-
*/
|
78 |
-
public function remove( Inx_Api_Recipient_Attribute $oAttribute = null );
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Checks whether the given attribute is visible in the specified list.
|
83 |
-
*
|
84 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to check.
|
85 |
-
* @param int $iListId the id of the list to check.
|
86 |
-
* @return bool <i>true</i> if the attribute is visible in the list, <i>false</i> otherwise.
|
87 |
-
* @since API 1.10.0
|
88 |
-
*/
|
89 |
-
public function isAttributeVisibleInList( Inx_Api_Recipient_Attribute $oAttribute, $iListId );
|
90 |
-
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Checks whether the given attributes are visible in the specified list.
|
94 |
-
* The result is an associative array where the attribute id is the key and the value is a <i>bool</i> indicating
|
95 |
-
* the visibility of the attribute.
|
96 |
-
*
|
97 |
-
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to check.
|
98 |
-
* @param int $iListId the id of the list to check.
|
99 |
-
* @return array an associative array containing int/bool pairs.
|
100 |
-
* @since API 1.10.0
|
101 |
-
*/
|
102 |
-
public function areAttributesVisibleInList( $aAttributes, $iListId );
|
103 |
-
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Sets the visibility of an attribute (column) in a specific list.
|
107 |
-
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
108 |
-
* <i>Inx_Api_APIException</i>.
|
109 |
-
*
|
110 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
|
111 |
-
* @param int $iListId the id of the list in which the attribute shall be shown or hidden.
|
112 |
-
* @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
|
113 |
-
* @throws Inx_Api_APIException if the attribute can not be shown / hidden.
|
114 |
-
* @since API 1.9.0
|
115 |
-
*/
|
116 |
-
public function setAttributeListVisibility( Inx_Api_Recipient_Attribute $oAttribute, $iListId, $blVisible );
|
117 |
-
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Sets the visibility of a list of attributes (columns) in a specific list.
|
121 |
-
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
122 |
-
* <i>Inx_Api_APIException</i>.
|
123 |
-
* If the list contains such an attribute, none of the attributes will be modified.
|
124 |
-
*
|
125 |
-
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
|
126 |
-
* @param int $iListId the id of the list in which the attributes shall be shown or hidden.
|
127 |
-
* @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</codei> if they shall be hidden.
|
128 |
-
* @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
|
129 |
-
* @since API 1.9.0
|
130 |
-
*/
|
131 |
-
public function setAttributeListVisibilities( $aAttributes, $iListId, $blVisible );
|
132 |
-
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Sets the visibility of an attribute (column) in all lists.
|
136 |
-
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
137 |
-
* <i>Inx_Api_APIException</i>.
|
138 |
-
*
|
139 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
|
140 |
-
* @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
|
141 |
-
* @throws Inx_Api_APIException if the attribute can not be shown / hidden.
|
142 |
-
* @since API 1.9.0
|
143 |
-
*/
|
144 |
-
public function setGlobalAttributeVisibility( Inx_Api_Recipient_Attribute $oAttribute, $blVisible );
|
145 |
-
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Sets the visibility of a list of attributes (columns) in all lists.
|
149 |
-
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
150 |
-
* <i>Inx_Api_APIException</i>.
|
151 |
-
* If the list contains such an attribute, none of the attributes will be modified.
|
152 |
-
*
|
153 |
-
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
|
154 |
-
* @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</i> if they shall be hidden.
|
155 |
-
* @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
|
156 |
-
* @since API 1.9.0
|
157 |
-
*/
|
158 |
-
public function setGlobalAttributeVisibilities( $aAttributes, $blVisible );
|
159 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Recipient
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Using the <i>Inx_Api_Recipient_AttributeManager</i>, attributes (columns) can be manipulated.
|
8 |
+
* The following operations can be performed using the <i>AttributeManager</i>:
|
9 |
+
* <p>
|
10 |
+
* <ul>
|
11 |
+
* <li>Creating attributes: <i>create(String, int, int)</i>
|
12 |
+
* <li>Removing user attributes: <i>remove(Attribute)</i>
|
13 |
+
* <li>Renaming user attributes: <i>rename(Attribute, String)</i>
|
14 |
+
* <li>Checking list visibility: <i>isAttributeVisibleInList(Attribute, int)</i> and
|
15 |
+
* <i>areAttributesVisibleInList(List, int)</i>
|
16 |
+
* <li>Setting list visibility: <i>setAttributeListVisibility(Attribute, int, boolean)</i> and
|
17 |
+
* <i>setAttributeListVisibilities(List, int, boolean)</i>
|
18 |
+
* <li>Setting global visibility: <i>setGlobalAttributeVisibility(Attribute, boolean)</i> and
|
19 |
+
* <i>setGlobalAttributeVisibilities(List, boolean)</i>
|
20 |
+
* </ul>
|
21 |
+
* Note: Changing the data type of an attribute is not supported by the <i>AttributeManager</i>.
|
22 |
+
* This is a possibly dangerous operation that should - if at all - be performed using the client which can
|
23 |
+
* provide guidance and assistance in converting attributes from on type into another.
|
24 |
+
* <p>
|
25 |
+
* The <i>AttributeManager</i> can not be used to change attribute values for recipients.
|
26 |
+
* This is performed using the <i>Inx_Api_Recipient_RecipientContext</i>.
|
27 |
+
* See the <i>RecipientContext</i> documentation for more information on this topic.
|
28 |
+
* <p>
|
29 |
+
* Following example illustrates how to create a new text attribute with a length of 50 characters:
|
30 |
+
*
|
31 |
+
* <pre>
|
32 |
+
* $oSession->getAttributeManager()->create( "Firstname", Inx_Api_Recipient_Attribute::DATA_TYPE_STRING, 50 );
|
33 |
+
* </pre>
|
34 |
+
* <p>
|
35 |
+
* For more information on <i>Attribute</i>s in general, see the <i>Inx_Api_Recipient_Attribute</i> documentation.
|
36 |
+
*
|
37 |
+
* @see Inx_Api_Recipient_Attribute
|
38 |
+
* @see Inx_Api_Recipient_RecipientContext
|
39 |
+
* @since API 1.0
|
40 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
41 |
+
* @package Inxmail
|
42 |
+
* @subpackage Recipient
|
43 |
+
*/
|
44 |
+
interface Inx_Api_Recipient_AttributeManager
|
45 |
+
{
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Create a new user attribute.
|
49 |
+
*
|
50 |
+
* @param attributeName the unique name of the attribute
|
51 |
+
* @param dataType the data type of the attribute
|
52 |
+
* @param maxStringLenth the length of the string attribute (length from 1 to 255),
|
53 |
+
* only for <i>Inx_Api_Recipient_Attribute::DATA_TYPE_STRING</i>
|
54 |
+
* @return the attribute id of the new attribute
|
55 |
+
* @throws Inx_Api_NameException if the attribute name is illegal or already exist
|
56 |
+
* @see Inx_Api_Recipient_Attribute
|
57 |
+
*/
|
58 |
+
public function create( $sAttributeName, $iDataType, $iMaxStringLenth );
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Rename a user attribute.
|
63 |
+
*
|
64 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to rename
|
65 |
+
* @param string $sAttributeName the new attribute name
|
66 |
+
* @return boolean true, if the attribute is renamed, otherwise false
|
67 |
+
* @throws Inx_Api_NameException if the attribute name is illegal or already exist
|
68 |
+
*/
|
69 |
+
public function rename( Inx_Api_Recipient_Attribute $oAttribute, $sAttributeName );
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Remove a user attribute.
|
74 |
+
*
|
75 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to remove
|
76 |
+
* @return boolean true, if the attribute is removed, otherwise false
|
77 |
+
*/
|
78 |
+
public function remove( Inx_Api_Recipient_Attribute $oAttribute = null );
|
79 |
+
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Checks whether the given attribute is visible in the specified list.
|
83 |
+
*
|
84 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to check.
|
85 |
+
* @param int $iListId the id of the list to check.
|
86 |
+
* @return bool <i>true</i> if the attribute is visible in the list, <i>false</i> otherwise.
|
87 |
+
* @since API 1.10.0
|
88 |
+
*/
|
89 |
+
public function isAttributeVisibleInList( Inx_Api_Recipient_Attribute $oAttribute, $iListId );
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Checks whether the given attributes are visible in the specified list.
|
94 |
+
* The result is an associative array where the attribute id is the key and the value is a <i>bool</i> indicating
|
95 |
+
* the visibility of the attribute.
|
96 |
+
*
|
97 |
+
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to check.
|
98 |
+
* @param int $iListId the id of the list to check.
|
99 |
+
* @return array an associative array containing int/bool pairs.
|
100 |
+
* @since API 1.10.0
|
101 |
+
*/
|
102 |
+
public function areAttributesVisibleInList( $aAttributes, $iListId );
|
103 |
+
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Sets the visibility of an attribute (column) in a specific list.
|
107 |
+
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
108 |
+
* <i>Inx_Api_APIException</i>.
|
109 |
+
*
|
110 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
|
111 |
+
* @param int $iListId the id of the list in which the attribute shall be shown or hidden.
|
112 |
+
* @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
|
113 |
+
* @throws Inx_Api_APIException if the attribute can not be shown / hidden.
|
114 |
+
* @since API 1.9.0
|
115 |
+
*/
|
116 |
+
public function setAttributeListVisibility( Inx_Api_Recipient_Attribute $oAttribute, $iListId, $blVisible );
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Sets the visibility of a list of attributes (columns) in a specific list.
|
121 |
+
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
122 |
+
* <i>Inx_Api_APIException</i>.
|
123 |
+
* If the list contains such an attribute, none of the attributes will be modified.
|
124 |
+
*
|
125 |
+
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
|
126 |
+
* @param int $iListId the id of the list in which the attributes shall be shown or hidden.
|
127 |
+
* @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</codei> if they shall be hidden.
|
128 |
+
* @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
|
129 |
+
* @since API 1.9.0
|
130 |
+
*/
|
131 |
+
public function setAttributeListVisibilities( $aAttributes, $iListId, $blVisible );
|
132 |
+
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Sets the visibility of an attribute (column) in all lists.
|
136 |
+
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
137 |
+
* <i>Inx_Api_APIException</i>.
|
138 |
+
*
|
139 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to show or hide.
|
140 |
+
* @param bool $blVisible <i>true</i> if the attribute shall be shown, <i>false</i> if it shall be hidden.
|
141 |
+
* @throws Inx_Api_APIException if the attribute can not be shown / hidden.
|
142 |
+
* @since API 1.9.0
|
143 |
+
*/
|
144 |
+
public function setGlobalAttributeVisibility( Inx_Api_Recipient_Attribute $oAttribute, $blVisible );
|
145 |
+
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Sets the visibility of a list of attributes (columns) in all lists.
|
149 |
+
* Some attributes, like the email attribute, may not be shown or hidden and will therefore trigger an
|
150 |
+
* <i>Inx_Api_APIException</i>.
|
151 |
+
* If the list contains such an attribute, none of the attributes will be modified.
|
152 |
+
*
|
153 |
+
* @param array $aAttributes a list of <i>Inx_Api_Recipient_Attribute</i>s to show or hide.
|
154 |
+
* @param bool $blVisible <i>true</i> if the attributes shall be shown, <i>false</i> if they shall be hidden.
|
155 |
+
* @throws Inx_Api_APIException if at least one attribute can not be shown / hidden.
|
156 |
+
* @since API 1.9.0
|
157 |
+
*/
|
158 |
+
public function setGlobalAttributeVisibilities( $aAttributes, $blVisible );
|
159 |
+
}
|
lib/Inx/Api/Recipient/AttributeNotFoundException.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Recipient
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An exception thrown by the <i>Inx_Api_Recipient_RecipientMetaData</i> when an attribute does not exist.
|
8 |
-
*
|
9 |
-
* @since API 1.0
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
* @subpackage Recipient
|
13 |
-
*/
|
14 |
-
class Inx_Api_Recipient_AttributeNotFoundException extends Exception
|
15 |
-
{
|
16 |
-
|
17 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Recipient
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An exception thrown by the <i>Inx_Api_Recipient_RecipientMetaData</i> when an attribute does not exist.
|
8 |
+
*
|
9 |
+
* @since API 1.0
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
* @subpackage Recipient
|
13 |
+
*/
|
14 |
+
class Inx_Api_Recipient_AttributeNotFoundException extends Exception
|
15 |
+
{
|
16 |
+
|
17 |
+
}
|
lib/Inx/Api/Recipient/BatchChannel.php
CHANGED
@@ -1,267 +1,267 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Recipient
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Recipient_BatchChannel</i> can (and should) be used for manipulation of large amounts of data.
|
9 |
-
* The <i>createRecipient()</i> and <i>selectRecipient()</i> methods are used to create and/or select a recipient.
|
10 |
-
* After creating or selecting a recipient, the following batch commands operate on this until another recipient is selected.
|
11 |
-
* <p>
|
12 |
-
* An <i>Inx_Api_Recipient_BatchChannel</i> may be used to perform the following operations:
|
13 |
-
* <p>
|
14 |
-
* <ul>
|
15 |
-
* <li>Select recipients: <i>selectRecipient($sKeyValue)</i>
|
16 |
-
* <li>Create recipients: <i>createRecipient($sKeyValue, $blSelectIfExistant)</i>
|
17 |
-
* <li>Remove recipients: <i>removeRecipient($sKeyValue)</i>
|
18 |
-
* <li>Manipulate recipient attributes <i>write($oAttribute, $oValue)</i> and <i>writeIfNull($oAttribute, $sValue)</i>
|
19 |
-
* <li>Subscribe recipients: <i>subscribeIfNotUnsubscribed($oListContext, $sSubscriptionDate)</i>
|
20 |
-
* <li>Unsubscribe recipients: <i>unsubscribe($oListContext)</i>
|
21 |
-
* </ul>
|
22 |
-
* The selection, creation and removal of recipients requires a value corresponding to the recipient key.
|
23 |
-
* Usually, this key is the email address.
|
24 |
-
* It is possible to use a different attribute as recipient key for the <i>BatchChannel</i>.
|
25 |
-
* To do this, use the <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i> method to create
|
26 |
-
* the <i>Inx_Api_Recipient_BatchChannel</i> object and pass the attribute used as key.
|
27 |
-
* However, be aware that the attribute used as key should be unique, although this is no hard technical requirement.
|
28 |
-
* Using a non unique attribute as key will return any of the matching recipients (undetermined).
|
29 |
-
* Also, the creation of recipients using a different key attribute is not possible.
|
30 |
-
* <p>
|
31 |
-
* Note: Resubscription is not supported by <code>BatchChannel</code>.
|
32 |
-
* If you wish to resubscribe a recipient, use <i>In_Api_Recipient_UnsubscriptionRecipientRowSet::resubscribe($sDate)</i> instead.
|
33 |
-
* <p>
|
34 |
-
* The following snippet shows how to add two new addresses and change their "Firstname" and "Lastname" attributes.
|
35 |
-
* If the addresses exist already, these attribute values will be overwritten.
|
36 |
-
*
|
37 |
-
* <pre>
|
38 |
-
* $oRecipientContext = $oSession->createRecipientContext();
|
39 |
-
* $oBatchChannel = $oRecipientContext->createBatchChannel();
|
40 |
-
* $oRecipientMetaData = $oRecipientContext->getMetaData();
|
41 |
-
*
|
42 |
-
* $oBatchChannel->createRecipient( "mueller@yourcompany.com", true );
|
43 |
-
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Firstname" ), "George" );
|
44 |
-
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Lastname" ), "Müller" );
|
45 |
-
*
|
46 |
-
* $oBatchChannel->createRecipient( "clinton@yourcompany.com", true );
|
47 |
-
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Firstname" ), "Bill" );
|
48 |
-
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Lastname" ), "Clinton" );
|
49 |
-
*
|
50 |
-
* $retArr = $oBatchChannel->executeBatch();
|
51 |
-
* </pre>
|
52 |
-
*
|
53 |
-
* Note: The <i>boolean</i> parameter of <i>createRecipient</i> defines how to handle already existent recipients.
|
54 |
-
* If the parameter is set to <i>true</i> - as in the example - the recipient will only be created if it does not already exist.
|
55 |
-
* Existent recipients are selected instead.
|
56 |
-
* If the parameter is set to <i>false</i> the <i>BatchChannel</i> will attempt to create the recipient.
|
57 |
-
* If the recipient is not already existing it will be created and selected.
|
58 |
-
* However, if the recipient exists already, the result will be <i>RESULT_FAILURE_DUPLICATE_KEY</i> and the recipient will
|
59 |
-
* <strong>not</strong> be selected.
|
60 |
-
* Therefore, all succeeding operations on this recipient will not be committed (<i>RESULT_NOT_COMMITTED</i>).
|
61 |
-
* <p>
|
62 |
-
* The selection and removal of recipients works very much the same, except that <i>removeRecipient($sKeyValue)</i> will
|
63 |
-
* not select the deleted recipient of course.
|
64 |
-
* After deleting a recipient, a new recipient must be selected (or created) before any tasks may be invoked.
|
65 |
-
* This is because the <i>remove()</i> method resets the currently selected recipient.
|
66 |
-
* <p>
|
67 |
-
* The <i>writeIfNull($oAttribute, $sValue)</i> method allows you to set an attribute value only, if no value was
|
68 |
-
* assigned previously (i.e. the attribute value is <i>null</i>).
|
69 |
-
* A similar technique is used by <i>subscribeIfNotUnsubscribed($oListContext, $sDate)</i>.
|
70 |
-
* This method subscribes the selected recipient to the given list, only when the recipient was not unsubscribed from that list before.
|
71 |
-
* <p>
|
72 |
-
* Each command to the BatchChannel results in a value in the returned integer array.
|
73 |
-
* By scanning the array, you can find out which of the commands have been executed, and which have not.
|
74 |
-
* <p>
|
75 |
-
* The values produced by <code>removeRecipient()</code>:
|
76 |
-
* <ul>
|
77 |
-
* <LI>The recipientId is returned if the recipient is removed
|
78 |
-
* <LI><i>RESULT_FAILURE_KEY_NOT_FOUND</i> is returned if the recipient doesn't exists
|
79 |
-
* </ul>
|
80 |
-
* <P>
|
81 |
-
* The values produced by <i>selectRecipient()</i>:
|
82 |
-
* <ul>
|
83 |
-
* <LI>The recipientId is returned if the recipient is selected
|
84 |
-
* <LI><i>RESULT_FAILURE_DUPLICATE_KEY</i> is returned if the unique key already exists
|
85 |
-
* <LI><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i> is returned if the email address is blocked
|
86 |
-
* <LI><i>RESULT_FAILURE_KEY_NOT_FOUND</i> is returned if the recipient doesn't exist
|
87 |
-
* </ul>
|
88 |
-
* <P>
|
89 |
-
* The values produced by <i>createRecipient()</i>:
|
90 |
-
* <ul>
|
91 |
-
* <LI>The recipientId is returned if the recipient was successfully created or selected
|
92 |
-
* <LI><i>RESULT_FAILURE_DUPLICATE_KEY</i> is returned if the unique key already exists
|
93 |
-
* <LI><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i> is returned if the email address is blocked
|
94 |
-
* <LI><i>RESULT_FAILURE_ILLEGAL_VALUE</i> is returned if the key value is illegal
|
95 |
-
* </ul>
|
96 |
-
* <P>
|
97 |
-
* The values produced by <i>write()</i> and <i>writeIfNull()</i>
|
98 |
-
* <ul>
|
99 |
-
* <LI><i>RESULT_COMMITTED</i> is returned if the value is set and committed
|
100 |
-
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the value is set, but could not be committed
|
101 |
-
* <LI><i>RESULT_FAILURE_ILLEGAL_VALUE</i> is returned if the value of the attribute is illegal
|
102 |
-
* </ul>
|
103 |
-
* <P>
|
104 |
-
* The values produced by <i>subscribeIfNotUnsubscribed()</i>
|
105 |
-
* <ul>
|
106 |
-
* <LI><i>RESULT_COMMITTED</i> is returned if the recipient was subscribed
|
107 |
-
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the recipient was unsubscribed before
|
108 |
-
* </ul>
|
109 |
-
* <P>
|
110 |
-
* The values produced by <i>unsubscribe()</i>
|
111 |
-
* <ul>
|
112 |
-
* <LI><i>RESULT_COMMITTED</i> is returned if the recipient was unsubscribed
|
113 |
-
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the recipient was already unsubscribed before
|
114 |
-
* </ul>
|
115 |
-
* <p>
|
116 |
-
* For more information on recipients, see the <i>Inx_Api_Recipient_RecipientContext</i> documentation.
|
117 |
-
*
|
118 |
-
* @see Inx_Api_Recipient_RecipientContext
|
119 |
-
* @since API 1.0
|
120 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
121 |
-
* @package Inxmail
|
122 |
-
* @subpackage Recipient
|
123 |
-
*/
|
124 |
-
interface Inx_Api_Recipient_BatchChannel
|
125 |
-
{
|
126 |
-
|
127 |
-
/** RESULT_COMMITTED is returned if the value is set and committed. */
|
128 |
-
const RESULT_COMMITTED = -100;
|
129 |
-
|
130 |
-
/** RESULT_NOT_COMMITTED is returned if the data was not committed. */
|
131 |
-
const RESULT_NOT_COMMITTED = -101;
|
132 |
-
|
133 |
-
/** RESULT_FAILURE_ILLEGAL_VALUE is returned if the key value is illegal. */
|
134 |
-
const RESULT_FAILURE_ILLEGAL_VALUE = -102;
|
135 |
-
|
136 |
-
/** RESULT_FAILURE_BLOCKED_BY_BLACKLIST is returned if the email address is blocked by a blacklist entry. */
|
137 |
-
const RESULT_FAILURE_BLOCKED_BY_BLACKLIST = -103;
|
138 |
-
|
139 |
-
/** RESULT_FAILURE_DUPLICATE_KEY is returned if the unique key already exists. */
|
140 |
-
const RESULT_FAILURE_DUPLICATE_KEY = -104;
|
141 |
-
|
142 |
-
/** RESULT_FAILURE_KEY_NOT_FOUND is returned if the recipient doesn't exist. */
|
143 |
-
const RESULT_FAILURE_KEY_NOT_FOUND = -105;
|
144 |
-
|
145 |
-
/** RESULT_PERMISSION_DENIED is returned if the permission is denied to create, update or remove a recipient. */
|
146 |
-
const RESULT_PERMISSION_DENIED = -200;
|
147 |
-
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Removes the recipient identified by the given key value from the system.
|
151 |
-
* <p>
|
152 |
-
* A key different from the email address may be specified using
|
153 |
-
* <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i>.
|
154 |
-
* However, be careful with that method, as the selected recipient for non unique key attributes is not determined.
|
155 |
-
* In such a case, any of the matching recipients may be removed.
|
156 |
-
*
|
157 |
-
* @param string $sKeyValue the key value of the desired recipient.
|
158 |
-
*/
|
159 |
-
public function removeRecipient( $sKeyValue );
|
160 |
-
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Selects an existing recipient identified by the given key value.
|
164 |
-
* <p>
|
165 |
-
* A key different from the email address may be specified using
|
166 |
-
* <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i>.
|
167 |
-
* However, be careful with that method, as the selected recipient for non unique key attributes is not determined.
|
168 |
-
* In such a case, any of the matching recipients may be selected.
|
169 |
-
*
|
170 |
-
* @param string $sKeyValue the key value from the desired recipient.
|
171 |
-
*/
|
172 |
-
public function selectRecipient( $sKeyValue );
|
173 |
-
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Create and/or select a recipient identified by the given key value.
|
177 |
-
* The behaviour of this method depends on the value of the <i>bool</i> parameter and the recipient state (existing or not existing).
|
178 |
-
* The behaviour is defined as follows:
|
179 |
-
* <ul>
|
180 |
-
* <li>Recipient does not exist, parameter is <i>false</i>: The recipient will be created and selected.
|
181 |
-
* <li>Recipient already exists, parameter is <i>false</i>: The recipient will neither be created nor selected.
|
182 |
-
* <li>Recipient does not exist, parameter is <i>true</i>: The recipient will be created and selected.
|
183 |
-
* <li>Recipient already exists, parameter is <i>true</i>: The recipient will not be created but selected.
|
184 |
-
* </ul>
|
185 |
-
* <strong>Note:</strong> If a key different from the email address is used by this <i>Inx_Api_Recipient_BatchChannel</i>
|
186 |
-
* this method will not create any recipient.
|
187 |
-
* To use this method you must use the email address as recipient key.
|
188 |
-
* <p>
|
189 |
-
*
|
190 |
-
* @param string $sKeyValue the key value of the recipient to create/select.
|
191 |
-
* @param bool $blSelectIfExistant <i>true</i> if existent recipients shall be selected, <i>false</i> if existent
|
192 |
-
* recipients shall neither be created nor selected.
|
193 |
-
*/
|
194 |
-
public function createRecipient( $sKeyValue, $blSelectIfExistant );
|
195 |
-
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Sets a new value to the specified attribute.
|
199 |
-
* Requires a previously invoked select or create command.
|
200 |
-
* If the attribute is changed several times during a batch command, the last will be the new value.
|
201 |
-
*
|
202 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to be set.
|
203 |
-
* @param string $sValue the new value.
|
204 |
-
*/
|
205 |
-
public function write( Inx_Api_Recipient_Attribute $oAttribute, $sValue );
|
206 |
-
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Sets a new value to the specified attribute, only if the current value is <i>null</i>.
|
210 |
-
* Requires a previously invoked select or create command.
|
211 |
-
* If this method is invoked several times during a batch command, the first value will be set.
|
212 |
-
*
|
213 |
-
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to be set.
|
214 |
-
* @param string $sValue the new value.
|
215 |
-
*/
|
216 |
-
public function writeIfNull( Inx_Api_Recipient_Attribute $oAttribute, $sValue );
|
217 |
-
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Unsubscribes the current recipient from the specified list.
|
221 |
-
* Requires a previously invoked select or create command and the recipient must be a member of the list.
|
222 |
-
*
|
223 |
-
* @param lc the list from which the recipient should be unsubscribed.
|
224 |
-
* @since API 1.6.0
|
225 |
-
*/
|
226 |
-
public function unsubscribe( Inx_Api_List_ListContext $lc );
|
227 |
-
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Subscribes a new recipient to the given list, if she/he was not unsubscribed from it before.
|
231 |
-
* Use the <i>write()</i> method to overwrite the unsubscription of the recipient or use
|
232 |
-
* <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet::resubscribe($sDate)</i> instead.
|
233 |
-
*
|
234 |
-
* @param lc the list to which the recipient should be subscribed.
|
235 |
-
* @param subscriptionDate the subscription date. May <strong>not</strong> be <i>null</i>.
|
236 |
-
* @since API 1.6.0
|
237 |
-
*/
|
238 |
-
public function subscribeIfNotUnsubscribed( Inx_Api_List_ListContext $lc, $subscriptionDate );
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Execute the batched commands.
|
244 |
-
*
|
245 |
-
* @return array an array of <i>int</i>, with each element indicating the result of a the corresponding command.
|
246 |
-
* May be one of:
|
247 |
-
* <ul>
|
248 |
-
* <li><i>RESULT_COMMITTED</i>
|
249 |
-
* <li><i>RESULT_NOT_COMMITTED</i>
|
250 |
-
* <li><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i>
|
251 |
-
* <li><i>RESULT_FAILURE_DUPLICATE_KEY</i>
|
252 |
-
* <li><i>RESULT_FAILURE_ILLEGAL_VALUE</i>
|
253 |
-
* <li><i>RESULT_FAILURE_KEY_NOT_FOUND</i>
|
254 |
-
* <li><i>RESULT_PERMISSION_DENIED</i>
|
255 |
-
* </ul>
|
256 |
-
*/
|
257 |
-
public function executeBatch();
|
258 |
-
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Retrieves the <i>Inx_Api_Recipient_RecipientContext</i> which created this <i>BatchChannel</i>.
|
262 |
-
*
|
263 |
-
* @return Inx_Api_Recipient_RecipientContext the <i>RecipientContext</i> which created this <i>BatchChannel</i>.
|
264 |
-
*/
|
265 |
-
public function getContext();
|
266 |
-
|
267 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Recipient
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Recipient_BatchChannel</i> can (and should) be used for manipulation of large amounts of data.
|
9 |
+
* The <i>createRecipient()</i> and <i>selectRecipient()</i> methods are used to create and/or select a recipient.
|
10 |
+
* After creating or selecting a recipient, the following batch commands operate on this until another recipient is selected.
|
11 |
+
* <p>
|
12 |
+
* An <i>Inx_Api_Recipient_BatchChannel</i> may be used to perform the following operations:
|
13 |
+
* <p>
|
14 |
+
* <ul>
|
15 |
+
* <li>Select recipients: <i>selectRecipient($sKeyValue)</i>
|
16 |
+
* <li>Create recipients: <i>createRecipient($sKeyValue, $blSelectIfExistant)</i>
|
17 |
+
* <li>Remove recipients: <i>removeRecipient($sKeyValue)</i>
|
18 |
+
* <li>Manipulate recipient attributes <i>write($oAttribute, $oValue)</i> and <i>writeIfNull($oAttribute, $sValue)</i>
|
19 |
+
* <li>Subscribe recipients: <i>subscribeIfNotUnsubscribed($oListContext, $sSubscriptionDate)</i>
|
20 |
+
* <li>Unsubscribe recipients: <i>unsubscribe($oListContext)</i>
|
21 |
+
* </ul>
|
22 |
+
* The selection, creation and removal of recipients requires a value corresponding to the recipient key.
|
23 |
+
* Usually, this key is the email address.
|
24 |
+
* It is possible to use a different attribute as recipient key for the <i>BatchChannel</i>.
|
25 |
+
* To do this, use the <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i> method to create
|
26 |
+
* the <i>Inx_Api_Recipient_BatchChannel</i> object and pass the attribute used as key.
|
27 |
+
* However, be aware that the attribute used as key should be unique, although this is no hard technical requirement.
|
28 |
+
* Using a non unique attribute as key will return any of the matching recipients (undetermined).
|
29 |
+
* Also, the creation of recipients using a different key attribute is not possible.
|
30 |
+
* <p>
|
31 |
+
* Note: Resubscription is not supported by <code>BatchChannel</code>.
|
32 |
+
* If you wish to resubscribe a recipient, use <i>In_Api_Recipient_UnsubscriptionRecipientRowSet::resubscribe($sDate)</i> instead.
|
33 |
+
* <p>
|
34 |
+
* The following snippet shows how to add two new addresses and change their "Firstname" and "Lastname" attributes.
|
35 |
+
* If the addresses exist already, these attribute values will be overwritten.
|
36 |
+
*
|
37 |
+
* <pre>
|
38 |
+
* $oRecipientContext = $oSession->createRecipientContext();
|
39 |
+
* $oBatchChannel = $oRecipientContext->createBatchChannel();
|
40 |
+
* $oRecipientMetaData = $oRecipientContext->getMetaData();
|
41 |
+
*
|
42 |
+
* $oBatchChannel->createRecipient( "mueller@yourcompany.com", true );
|
43 |
+
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Firstname" ), "George" );
|
44 |
+
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Lastname" ), "Müller" );
|
45 |
+
*
|
46 |
+
* $oBatchChannel->createRecipient( "clinton@yourcompany.com", true );
|
47 |
+
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Firstname" ), "Bill" );
|
48 |
+
* $oBatchChannel->write( $oRecipientMetaData->getUserAttribute( "Lastname" ), "Clinton" );
|
49 |
+
*
|
50 |
+
* $retArr = $oBatchChannel->executeBatch();
|
51 |
+
* </pre>
|
52 |
+
*
|
53 |
+
* Note: The <i>boolean</i> parameter of <i>createRecipient</i> defines how to handle already existent recipients.
|
54 |
+
* If the parameter is set to <i>true</i> - as in the example - the recipient will only be created if it does not already exist.
|
55 |
+
* Existent recipients are selected instead.
|
56 |
+
* If the parameter is set to <i>false</i> the <i>BatchChannel</i> will attempt to create the recipient.
|
57 |
+
* If the recipient is not already existing it will be created and selected.
|
58 |
+
* However, if the recipient exists already, the result will be <i>RESULT_FAILURE_DUPLICATE_KEY</i> and the recipient will
|
59 |
+
* <strong>not</strong> be selected.
|
60 |
+
* Therefore, all succeeding operations on this recipient will not be committed (<i>RESULT_NOT_COMMITTED</i>).
|
61 |
+
* <p>
|
62 |
+
* The selection and removal of recipients works very much the same, except that <i>removeRecipient($sKeyValue)</i> will
|
63 |
+
* not select the deleted recipient of course.
|
64 |
+
* After deleting a recipient, a new recipient must be selected (or created) before any tasks may be invoked.
|
65 |
+
* This is because the <i>remove()</i> method resets the currently selected recipient.
|
66 |
+
* <p>
|
67 |
+
* The <i>writeIfNull($oAttribute, $sValue)</i> method allows you to set an attribute value only, if no value was
|
68 |
+
* assigned previously (i.e. the attribute value is <i>null</i>).
|
69 |
+
* A similar technique is used by <i>subscribeIfNotUnsubscribed($oListContext, $sDate)</i>.
|
70 |
+
* This method subscribes the selected recipient to the given list, only when the recipient was not unsubscribed from that list before.
|
71 |
+
* <p>
|
72 |
+
* Each command to the BatchChannel results in a value in the returned integer array.
|
73 |
+
* By scanning the array, you can find out which of the commands have been executed, and which have not.
|
74 |
+
* <p>
|
75 |
+
* The values produced by <code>removeRecipient()</code>:
|
76 |
+
* <ul>
|
77 |
+
* <LI>The recipientId is returned if the recipient is removed
|
78 |
+
* <LI><i>RESULT_FAILURE_KEY_NOT_FOUND</i> is returned if the recipient doesn't exists
|
79 |
+
* </ul>
|
80 |
+
* <P>
|
81 |
+
* The values produced by <i>selectRecipient()</i>:
|
82 |
+
* <ul>
|
83 |
+
* <LI>The recipientId is returned if the recipient is selected
|
84 |
+
* <LI><i>RESULT_FAILURE_DUPLICATE_KEY</i> is returned if the unique key already exists
|
85 |
+
* <LI><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i> is returned if the email address is blocked
|
86 |
+
* <LI><i>RESULT_FAILURE_KEY_NOT_FOUND</i> is returned if the recipient doesn't exist
|
87 |
+
* </ul>
|
88 |
+
* <P>
|
89 |
+
* The values produced by <i>createRecipient()</i>:
|
90 |
+
* <ul>
|
91 |
+
* <LI>The recipientId is returned if the recipient was successfully created or selected
|
92 |
+
* <LI><i>RESULT_FAILURE_DUPLICATE_KEY</i> is returned if the unique key already exists
|
93 |
+
* <LI><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i> is returned if the email address is blocked
|
94 |
+
* <LI><i>RESULT_FAILURE_ILLEGAL_VALUE</i> is returned if the key value is illegal
|
95 |
+
* </ul>
|
96 |
+
* <P>
|
97 |
+
* The values produced by <i>write()</i> and <i>writeIfNull()</i>
|
98 |
+
* <ul>
|
99 |
+
* <LI><i>RESULT_COMMITTED</i> is returned if the value is set and committed
|
100 |
+
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the value is set, but could not be committed
|
101 |
+
* <LI><i>RESULT_FAILURE_ILLEGAL_VALUE</i> is returned if the value of the attribute is illegal
|
102 |
+
* </ul>
|
103 |
+
* <P>
|
104 |
+
* The values produced by <i>subscribeIfNotUnsubscribed()</i>
|
105 |
+
* <ul>
|
106 |
+
* <LI><i>RESULT_COMMITTED</i> is returned if the recipient was subscribed
|
107 |
+
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the recipient was unsubscribed before
|
108 |
+
* </ul>
|
109 |
+
* <P>
|
110 |
+
* The values produced by <i>unsubscribe()</i>
|
111 |
+
* <ul>
|
112 |
+
* <LI><i>RESULT_COMMITTED</i> is returned if the recipient was unsubscribed
|
113 |
+
* <LI><i>RESULT_NOT_COMMITTED</i> is returned if the recipient was already unsubscribed before
|
114 |
+
* </ul>
|
115 |
+
* <p>
|
116 |
+
* For more information on recipients, see the <i>Inx_Api_Recipient_RecipientContext</i> documentation.
|
117 |
+
*
|
118 |
+
* @see Inx_Api_Recipient_RecipientContext
|
119 |
+
* @since API 1.0
|
120 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
121 |
+
* @package Inxmail
|
122 |
+
* @subpackage Recipient
|
123 |
+
*/
|
124 |
+
interface Inx_Api_Recipient_BatchChannel
|
125 |
+
{
|
126 |
+
|
127 |
+
/** RESULT_COMMITTED is returned if the value is set and committed. */
|
128 |
+
const RESULT_COMMITTED = -100;
|
129 |
+
|
130 |
+
/** RESULT_NOT_COMMITTED is returned if the data was not committed. */
|
131 |
+
const RESULT_NOT_COMMITTED = -101;
|
132 |
+
|
133 |
+
/** RESULT_FAILURE_ILLEGAL_VALUE is returned if the key value is illegal. */
|
134 |
+
const RESULT_FAILURE_ILLEGAL_VALUE = -102;
|
135 |
+
|
136 |
+
/** RESULT_FAILURE_BLOCKED_BY_BLACKLIST is returned if the email address is blocked by a blacklist entry. */
|
137 |
+
const RESULT_FAILURE_BLOCKED_BY_BLACKLIST = -103;
|
138 |
+
|
139 |
+
/** RESULT_FAILURE_DUPLICATE_KEY is returned if the unique key already exists. */
|
140 |
+
const RESULT_FAILURE_DUPLICATE_KEY = -104;
|
141 |
+
|
142 |
+
/** RESULT_FAILURE_KEY_NOT_FOUND is returned if the recipient doesn't exist. */
|
143 |
+
const RESULT_FAILURE_KEY_NOT_FOUND = -105;
|
144 |
+
|
145 |
+
/** RESULT_PERMISSION_DENIED is returned if the permission is denied to create, update or remove a recipient. */
|
146 |
+
const RESULT_PERMISSION_DENIED = -200;
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Removes the recipient identified by the given key value from the system.
|
151 |
+
* <p>
|
152 |
+
* A key different from the email address may be specified using
|
153 |
+
* <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i>.
|
154 |
+
* However, be careful with that method, as the selected recipient for non unique key attributes is not determined.
|
155 |
+
* In such a case, any of the matching recipients may be removed.
|
156 |
+
*
|
157 |
+
* @param string $sKeyValue the key value of the desired recipient.
|
158 |
+
*/
|
159 |
+
public function removeRecipient( $sKeyValue );
|
160 |
+
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Selects an existing recipient identified by the given key value.
|
164 |
+
* <p>
|
165 |
+
* A key different from the email address may be specified using
|
166 |
+
* <i>Inx_Api_Recipient_RecipientContext::createBatchChannel($oAttribute)</i>.
|
167 |
+
* However, be careful with that method, as the selected recipient for non unique key attributes is not determined.
|
168 |
+
* In such a case, any of the matching recipients may be selected.
|
169 |
+
*
|
170 |
+
* @param string $sKeyValue the key value from the desired recipient.
|
171 |
+
*/
|
172 |
+
public function selectRecipient( $sKeyValue );
|
173 |
+
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Create and/or select a recipient identified by the given key value.
|
177 |
+
* The behaviour of this method depends on the value of the <i>bool</i> parameter and the recipient state (existing or not existing).
|
178 |
+
* The behaviour is defined as follows:
|
179 |
+
* <ul>
|
180 |
+
* <li>Recipient does not exist, parameter is <i>false</i>: The recipient will be created and selected.
|
181 |
+
* <li>Recipient already exists, parameter is <i>false</i>: The recipient will neither be created nor selected.
|
182 |
+
* <li>Recipient does not exist, parameter is <i>true</i>: The recipient will be created and selected.
|
183 |
+
* <li>Recipient already exists, parameter is <i>true</i>: The recipient will not be created but selected.
|
184 |
+
* </ul>
|
185 |
+
* <strong>Note:</strong> If a key different from the email address is used by this <i>Inx_Api_Recipient_BatchChannel</i>
|
186 |
+
* this method will not create any recipient.
|
187 |
+
* To use this method you must use the email address as recipient key.
|
188 |
+
* <p>
|
189 |
+
*
|
190 |
+
* @param string $sKeyValue the key value of the recipient to create/select.
|
191 |
+
* @param bool $blSelectIfExistant <i>true</i> if existent recipients shall be selected, <i>false</i> if existent
|
192 |
+
* recipients shall neither be created nor selected.
|
193 |
+
*/
|
194 |
+
public function createRecipient( $sKeyValue, $blSelectIfExistant );
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Sets a new value to the specified attribute.
|
199 |
+
* Requires a previously invoked select or create command.
|
200 |
+
* If the attribute is changed several times during a batch command, the last will be the new value.
|
201 |
+
*
|
202 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to be set.
|
203 |
+
* @param string $sValue the new value.
|
204 |
+
*/
|
205 |
+
public function write( Inx_Api_Recipient_Attribute $oAttribute, $sValue );
|
206 |
+
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Sets a new value to the specified attribute, only if the current value is <i>null</i>.
|
210 |
+
* Requires a previously invoked select or create command.
|
211 |
+
* If this method is invoked several times during a batch command, the first value will be set.
|
212 |
+
*
|
213 |
+
* @param Inx_Api_Recipient_Attribute $oAttribute the attribute to be set.
|
214 |
+
* @param string $sValue the new value.
|
215 |
+
*/
|
216 |
+
public function writeIfNull( Inx_Api_Recipient_Attribute $oAttribute, $sValue );
|
217 |
+
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Unsubscribes the current recipient from the specified list.
|
221 |
+
* Requires a previously invoked select or create command and the recipient must be a member of the list.
|
222 |
+
*
|
223 |
+
* @param lc the list from which the recipient should be unsubscribed.
|
224 |
+
* @since API 1.6.0
|
225 |
+
*/
|
226 |
+
public function unsubscribe( Inx_Api_List_ListContext $lc );
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Subscribes a new recipient to the given list, if she/he was not unsubscribed from it before.
|
231 |
+
* Use the <i>write()</i> method to overwrite the unsubscription of the recipient or use
|
232 |
+
* <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet::resubscribe($sDate)</i> instead.
|
233 |
+
*
|
234 |
+
* @param lc the list to which the recipient should be subscribed.
|
235 |
+
* @param subscriptionDate the subscription date. May <strong>not</strong> be <i>null</i>.
|
236 |
+
* @since API 1.6.0
|
237 |
+
*/
|
238 |
+
public function subscribeIfNotUnsubscribed( Inx_Api_List_ListContext $lc, $subscriptionDate );
|
239 |
+
|
240 |
+
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Execute the batched commands.
|
244 |
+
*
|
245 |
+
* @return array an array of <i>int</i>, with each element indicating the result of a the corresponding command.
|
246 |
+
* May be one of:
|
247 |
+
* <ul>
|
248 |
+
* <li><i>RESULT_COMMITTED</i>
|
249 |
+
* <li><i>RESULT_NOT_COMMITTED</i>
|
250 |
+
* <li><i>RESULT_FAILURE_BLOCKED_BY_BLACKLIST</i>
|
251 |
+
* <li><i>RESULT_FAILURE_DUPLICATE_KEY</i>
|
252 |
+
* <li><i>RESULT_FAILURE_ILLEGAL_VALUE</i>
|
253 |
+
* <li><i>RESULT_FAILURE_KEY_NOT_FOUND</i>
|
254 |
+
* <li><i>RESULT_PERMISSION_DENIED</i>
|
255 |
+
* </ul>
|
256 |
+
*/
|
257 |
+
public function executeBatch();
|
258 |
+
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Retrieves the <i>Inx_Api_Recipient_RecipientContext</i> which created this <i>BatchChannel</i>.
|
262 |
+
*
|
263 |
+
* @return Inx_Api_Recipient_RecipientContext the <i>RecipientContext</i> which created this <i>BatchChannel</i>.
|
264 |
+
*/
|
265 |
+
public function getContext();
|
266 |
+
|
267 |
+
}
|
lib/Inx/Api/Recipient/BlackListException.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Recipient
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* A <i>Inx_Api_Recipient_BlackListException</i> is thrown when the email address of a recipient is blocked by the black list.
|
8 |
-
*
|
9 |
-
* @since API 1.0
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
* @subpackage Recipient
|
13 |
-
*/
|
14 |
-
class Inx_Api_Recipient_BlackListException extends Exception
|
15 |
-
{
|
16 |
-
|
17 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Recipient
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* A <i>Inx_Api_Recipient_BlackListException</i> is thrown when the email address of a recipient is blocked by the black list.
|
8 |
+
*
|
9 |
+
* @since API 1.0
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
* @subpackage Recipient
|
13 |
+
*/
|
14 |
+
class Inx_Api_Recipient_BlackListException extends Exception
|
15 |
+
{
|
16 |
+
|
17 |
}
|
lib/Inx/Api/Recipient/DuplicateKeyException.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Recipient
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* An <i>Inx_Api_Recipient_DuplicateKeyException</i> is thrown when a recipient with the same key value already exists.
|
8 |
-
* The key usually is the email address.
|
9 |
-
*
|
10 |
-
* @since API 1.0
|
11 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
-
* @package Inxmail
|
13 |
-
* @subpackage Recipient
|
14 |
-
*/
|
15 |
-
class Inx_Api_Recipient_DuplicateKeyException extends Exception
|
16 |
-
{
|
17 |
-
|
18 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Recipient
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* An <i>Inx_Api_Recipient_DuplicateKeyException</i> is thrown when a recipient with the same key value already exists.
|
8 |
+
* The key usually is the email address.
|
9 |
+
*
|
10 |
+
* @since API 1.0
|
11 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
+
* @package Inxmail
|
13 |
+
* @subpackage Recipient
|
14 |
+
*/
|
15 |
+
class Inx_Api_Recipient_DuplicateKeyException extends Exception
|
16 |
+
{
|
17 |
+
|
18 |
+
}
|
lib/Inx/Api/Recipient/IllegalValueException.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Recipient
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* Thrown by the <i>commitRowUpdate</i> method of an <I>Inx_Api_Recipient_RecipientRowSet</i> or
|
9 |
-
* <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet</i> to indicate that the value of the specified attribute is illegal.
|
10 |
-
* The source attribute id is coded as error code.
|
11 |
-
*
|
12 |
-
* @since API 1.0
|
13 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage Recipient
|
16 |
-
*/
|
17 |
-
class Inx_Api_Recipient_IllegalValueException extends Exception
|
18 |
-
{
|
19 |
-
|
20 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Recipient
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* Thrown by the <i>commitRowUpdate</i> method of an <I>Inx_Api_Recipient_RecipientRowSet</i> or
|
9 |
+
* <i>Inx_Api_Recipient_UnsubscriptionRecipientRowSet</i> to indicate that the value of the specified attribute is illegal.
|
10 |
+
* The source attribute id is coded as error code.
|
11 |
+
*
|
12 |
+
* @since API 1.0
|
13 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage Recipient
|
16 |
+
*/
|
17 |
+
class Inx_Api_Recipient_IllegalValueException extends Exception
|
18 |
+
{
|
19 |
+
|
20 |
+
}
|
lib/Inx/Api/Recipient/RecipientMetaData.php
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Recipient
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Recipient_RecipientMetaData</i> object contains meta data about the recipients represented by an
|
9 |
-
* <i>Inx_Api_Recipient_RecipientContext</i> object.
|
10 |
-
* The meta data includes information about the available attributes, though can not be used to retrieve the
|
11 |
-
* actual attribute values.
|
12 |
-
*
|
13 |
-
* @see Inx_Api_Recipient_RecipientContext
|
14 |
-
* @since API 1.0
|
15 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
16 |
-
* @package Inxmail
|
17 |
-
* @subpackage Recipient
|
18 |
-
*/
|
19 |
-
interface Inx_Api_Recipient_RecipientMetaData
|
20 |
-
{
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Returns the id attribute.
|
24 |
-
*
|
25 |
-
* @return Inx_Api_Recipient_Attribute the id attribute.
|
26 |
-
*/
|
27 |
-
public function getIdAttribute();
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Returns the key attribute.
|
31 |
-
*
|
32 |
-
* @return Inx_Api_Recipient_Attribute the key attribute.
|
33 |
-
*/
|
34 |
-
public function getKeyAttribute();
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Returns the email attribute.
|
38 |
-
*
|
39 |
-
* @return Inx_Api_Recipient_Attribute the email attribute.
|
40 |
-
*/
|
41 |
-
public function getEmailAttribute();
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Returns the last modification attribute.
|
46 |
-
*
|
47 |
-
* @return Inx_Api_Recipient_Attribute the last modification attribute.
|
48 |
-
*/
|
49 |
-
public function getLastModificationAttribute();
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Returns the hardbounce attribute.
|
55 |
-
*
|
56 |
-
* @return Inx_Api_Recipient_Attribute the hardbounce attribute.
|
57 |
-
*/
|
58 |
-
public function getHardbounceAttribute();
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Returns the attribute specified by the given name.
|
63 |
-
*
|
64 |
-
* @param string $sAttributeName the name of the attribute to retrieve, ignoring case considerations.
|
65 |
-
*
|
66 |
-
* @return Inx_Api_Recipient_Attribute the attribute object.
|
67 |
-
* @throws Inx_Api_Recipient_AttributeNotFoundException if the attribute could not be found.
|
68 |
-
*/
|
69 |
-
public function getUserAttribute( $sAttributeName );
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Returns the subscription attribute for the specified list.
|
73 |
-
* A recipient has a subscription attribute for each standard list.
|
74 |
-
*
|
75 |
-
* @param Inx_Api_List_ListContext $oList the list context.
|
76 |
-
*
|
77 |
-
* @return Inx_Api_Recipient_Attribute the attribute object.
|
78 |
-
* @throws Inx_Api_Recipient_AttributeNotFoundException if the list is not a standard list.
|
79 |
-
*/
|
80 |
-
public function getSubscriptionAttribute( Inx_Api_List_ListContext $oList );
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Returns the attribute specified by the given id.
|
84 |
-
*
|
85 |
-
* @param int $iAttributeId the id of the attribute to retrieve.
|
86 |
-
*
|
87 |
-
* @return Inx_Api_Recipient_Attribute the attribute object.
|
88 |
-
* @throws Inx_Api_Recipient_AttributeNotFoundException if the attribute could not be found.
|
89 |
-
*/
|
90 |
-
public function getAttribute( $iAttributeId );
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Returns the number of attributes.
|
94 |
-
*
|
95 |
-
* @return int the number of attributes.
|
96 |
-
*/
|
97 |
-
public function getAttributeCount();
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Returns an <i>Inx_Apiimpl_Recipient_RecipientContextImpl_AttributeIterator</i> over the attributes in this meta data.
|
101 |
-
* <p>
|
102 |
-
* The following snippet shows how to iterate over the recipient attributes:
|
103 |
-
*
|
104 |
-
* <pre>
|
105 |
-
* $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
|
106 |
-
* $oAttributeIterator = $oRecipientMetaData->getAttributeIterator();
|
107 |
-
*
|
108 |
-
* while( $oAttributeIterator->hasNext() )
|
109 |
-
* {
|
110 |
-
* $oAttribute = $oAttributeIterator->current();
|
111 |
-
* echo $oAttribute->getName()."<br>";
|
112 |
-
* $oAttributeIterator->next();
|
113 |
-
* }
|
114 |
-
* </pre>
|
115 |
-
*
|
116 |
-
* @return Inx_Apiimpl_Recipient_RecipientContextImpl_AttributeIterator an iterator over the attributes.
|
117 |
-
*/
|
118 |
-
public function getAttributeIterator();
|
119 |
-
|
120 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Recipient
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Recipient_RecipientMetaData</i> object contains meta data about the recipients represented by an
|
9 |
+
* <i>Inx_Api_Recipient_RecipientContext</i> object.
|
10 |
+
* The meta data includes information about the available attributes, though can not be used to retrieve the
|
11 |
+
* actual attribute values.
|
12 |
+
*
|
13 |
+
* @see Inx_Api_Recipient_RecipientContext
|
14 |
+
* @since API 1.0
|
15 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
16 |
+
* @package Inxmail
|
17 |
+
* @subpackage Recipient
|
18 |
+
*/
|
19 |
+
interface Inx_Api_Recipient_RecipientMetaData
|
20 |
+
{
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Returns the id attribute.
|
24 |
+
*
|
25 |
+
* @return Inx_Api_Recipient_Attribute the id attribute.
|
26 |
+
*/
|
27 |
+
public function getIdAttribute();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Returns the key attribute.
|
31 |
+
*
|
32 |
+
* @return Inx_Api_Recipient_Attribute the key attribute.
|
33 |
+
*/
|
34 |
+
public function getKeyAttribute();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Returns the email attribute.
|
38 |
+
*
|
39 |
+
* @return Inx_Api_Recipient_Attribute the email attribute.
|
40 |
+
*/
|
41 |
+
public function getEmailAttribute();
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Returns the last modification attribute.
|
46 |
+
*
|
47 |
+
* @return Inx_Api_Recipient_Attribute the last modification attribute.
|
48 |
+
*/
|
49 |
+
public function getLastModificationAttribute();
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Returns the hardbounce attribute.
|
55 |
+
*
|
56 |
+
* @return Inx_Api_Recipient_Attribute the hardbounce attribute.
|
57 |
+
*/
|
58 |
+
public function getHardbounceAttribute();
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Returns the attribute specified by the given name.
|
63 |
+
*
|
64 |
+
* @param string $sAttributeName the name of the attribute to retrieve, ignoring case considerations.
|
65 |
+
*
|
66 |
+
* @return Inx_Api_Recipient_Attribute the attribute object.
|
67 |
+
* @throws Inx_Api_Recipient_AttributeNotFoundException if the attribute could not be found.
|
68 |
+
*/
|
69 |
+
public function getUserAttribute( $sAttributeName );
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Returns the subscription attribute for the specified list.
|
73 |
+
* A recipient has a subscription attribute for each standard list.
|
74 |
+
*
|
75 |
+
* @param Inx_Api_List_ListContext $oList the list context.
|
76 |
+
*
|
77 |
+
* @return Inx_Api_Recipient_Attribute the attribute object.
|
78 |
+
* @throws Inx_Api_Recipient_AttributeNotFoundException if the list is not a standard list.
|
79 |
+
*/
|
80 |
+
public function getSubscriptionAttribute( Inx_Api_List_ListContext $oList );
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Returns the attribute specified by the given id.
|
84 |
+
*
|
85 |
+
* @param int $iAttributeId the id of the attribute to retrieve.
|
86 |
+
*
|
87 |
+
* @return Inx_Api_Recipient_Attribute the attribute object.
|
88 |
+
* @throws Inx_Api_Recipient_AttributeNotFoundException if the attribute could not be found.
|
89 |
+
*/
|
90 |
+
public function getAttribute( $iAttributeId );
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Returns the number of attributes.
|
94 |
+
*
|
95 |
+
* @return int the number of attributes.
|
96 |
+
*/
|
97 |
+
public function getAttributeCount();
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns an <i>Inx_Apiimpl_Recipient_RecipientContextImpl_AttributeIterator</i> over the attributes in this meta data.
|
101 |
+
* <p>
|
102 |
+
* The following snippet shows how to iterate over the recipient attributes:
|
103 |
+
*
|
104 |
+
* <pre>
|
105 |
+
* $oRecipientMetaData = $oSession->createRecipientContext()->getMetaData();
|
106 |
+
* $oAttributeIterator = $oRecipientMetaData->getAttributeIterator();
|
107 |
+
*
|
108 |
+
* while( $oAttributeIterator->hasNext() )
|
109 |
+
* {
|
110 |
+
* $oAttribute = $oAttributeIterator->current();
|
111 |
+
* echo $oAttribute->getName()."<br>";
|
112 |
+
* $oAttributeIterator->next();
|
113 |
+
* }
|
114 |
+
* </pre>
|
115 |
+
*
|
116 |
+
* @return Inx_Apiimpl_Recipient_RecipientContextImpl_AttributeIterator an iterator over the attributes.
|
117 |
+
*/
|
118 |
+
public function getAttributeIterator();
|
119 |
+
|
120 |
+
}
|
lib/Inx/Api/Recipient/SelectException.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Recipient
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Recipient_SelectException</i> is thrown by the <i>select()</i> methods of the
|
9 |
-
* <i>Inx_Api_Recipient_RecipientContext</i> when a selection failed.
|
10 |
-
*
|
11 |
-
* @see Inx_Api_Recipient_RecipientContext
|
12 |
-
* @since API 1.0
|
13 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
-
* @package Inxmail
|
15 |
-
* @subpackage Recipient
|
16 |
-
*/
|
17 |
-
class Inx_Api_Recipient_SelectException extends Exception
|
18 |
-
{
|
19 |
-
|
20 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Recipient
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Recipient_SelectException</i> is thrown by the <i>select()</i> methods of the
|
9 |
+
* <i>Inx_Api_Recipient_RecipientContext</i> when a selection failed.
|
10 |
+
*
|
11 |
+
* @see Inx_Api_Recipient_RecipientContext
|
12 |
+
* @since API 1.0
|
13 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
14 |
+
* @package Inxmail
|
15 |
+
* @subpackage Recipient
|
16 |
+
*/
|
17 |
+
class Inx_Api_Recipient_SelectException extends Exception
|
18 |
+
{
|
19 |
+
|
20 |
+
}
|
lib/Inx/Api/RemoteException.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* @package Inxmail
|
7 |
-
*/
|
8 |
-
class Inx_Api_RemoteException extends Exception
|
9 |
-
{
|
10 |
-
protected $_oOrigExc = null;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Enter description here...
|
14 |
-
*
|
15 |
-
* @param string $sMsg
|
16 |
-
* @param int $iCode
|
17 |
-
* @param Exception $oOrigExc original exception object
|
18 |
-
*/
|
19 |
-
public function __construct($sMsg, $iCode=null, $oOrigExc=null)
|
20 |
-
{
|
21 |
-
$this->_oOrigExc = $oOrigExc;
|
22 |
-
parent::__construct($sMsg, $iCode);
|
23 |
-
}
|
24 |
-
/**
|
25 |
-
* @return Exception object
|
26 |
-
*/
|
27 |
-
public function getOrigException()
|
28 |
-
{
|
29 |
-
return $this->_oOrigExc;
|
30 |
-
}
|
31 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* @package Inxmail
|
7 |
+
*/
|
8 |
+
class Inx_Api_RemoteException extends Exception
|
9 |
+
{
|
10 |
+
protected $_oOrigExc = null;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Enter description here...
|
14 |
+
*
|
15 |
+
* @param string $sMsg
|
16 |
+
* @param int $iCode
|
17 |
+
* @param Exception $oOrigExc original exception object
|
18 |
+
*/
|
19 |
+
public function __construct($sMsg, $iCode=null, $oOrigExc=null)
|
20 |
+
{
|
21 |
+
$this->_oOrigExc = $oOrigExc;
|
22 |
+
parent::__construct($sMsg, $iCode);
|
23 |
+
}
|
24 |
+
/**
|
25 |
+
* @return Exception object
|
26 |
+
*/
|
27 |
+
public function getOrigException()
|
28 |
+
{
|
29 |
+
return $this->_oOrigExc;
|
30 |
+
}
|
31 |
}
|
lib/Inx/Api/Reporting/ConfigDescriptor.php
CHANGED
@@ -1,106 +1,106 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Reporting
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* Every report type has a configuration descriptor.
|
9 |
-
* The <i>Inx_Api_Reporting_ConfigDescriptor</i> describes the structure and elements of the report configuration area.
|
10 |
-
* A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s (mostly zero or one) which in turn
|
11 |
-
* contain a set of <i>Inx_Api_Reporting_Control</i>s.
|
12 |
-
* An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
|
13 |
-
* <p>
|
14 |
-
* The following snippet shows how to print out the content of the <i>ConfigurationDescriptor</i> for the
|
15 |
-
* ClickReactionTimeResponse report:
|
16 |
-
*
|
17 |
-
* <pre>
|
18 |
-
* $oReportEngine = $oSession->getReportEngine();
|
19 |
-
* $oConfigDescriptor = $oReportEngine->getDescriptor( "ClickReactionTimeResponse", "en_GB" );
|
20 |
-
*
|
21 |
-
* echo "<pre>";
|
22 |
-
* echo "Localized Report Title: ".$oConfigDescriptor->getTitle()."<br><br>";
|
23 |
-
*
|
24 |
-
* for( $i = 0; $i < $oConfigDescriptor->getControlUnitCount(); $i++ )
|
25 |
-
* {
|
26 |
-
* echo "Control Unit #".$i.":<br>";
|
27 |
-
* $oControlUnit = $oConfigDescriptor->getControlUnit( $i );
|
28 |
-
*
|
29 |
-
* echo "Localized control title: ".$oControlUnit->getTitle()."<br>";
|
30 |
-
*
|
31 |
-
* for( $j = 0; $j < $oControlUnit->getControlCount(); $j++ )
|
32 |
-
* {
|
33 |
-
* $oControl = $oControlUnit->getControl( $j );
|
34 |
-
*
|
35 |
-
* echo " Control #".$j.":<br>";
|
36 |
-
* echo " Control type: ".$oControl->getType()."<br>";
|
37 |
-
*
|
38 |
-
* foreach( $oControl->getPropertyKeys() as $sKey )
|
39 |
-
* {
|
40 |
-
* echo " Key: ".$sKey." - Value: ".$oControl->getProperty( $sKey )."<br>";
|
41 |
-
* }
|
42 |
-
* }
|
43 |
-
* }
|
44 |
-
*
|
45 |
-
* echo "</pre>";
|
46 |
-
* </pre>
|
47 |
-
*
|
48 |
-
* This snippet will produce the following output:
|
49 |
-
*
|
50 |
-
* <pre>
|
51 |
-
* Localized Report Title: Clicks over time
|
52 |
-
*
|
53 |
-
* Control Unit #0:
|
54 |
-
* Localized control title: Settings
|
55 |
-
* Control #0:
|
56 |
-
* Control type: mailingChooser
|
57 |
-
* Key: listTitle - Value: Mailing list:
|
58 |
-
* Key: mailingTitle - Value: Mailing:
|
59 |
-
* Key: listBind - Value: listid
|
60 |
-
* Key: mailingBind - Value: mailingid
|
61 |
-
* Control #1:
|
62 |
-
* Control type: simpleTimeIntervalControl
|
63 |
-
* Key: title - Value: Report time period:
|
64 |
-
* Key: countBind - Value: count
|
65 |
-
* Key: intervalBind - Value: interval
|
66 |
-
* Key: clause - Value: until today
|
67 |
-
* </pre>
|
68 |
-
* <p>
|
69 |
-
* For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
|
70 |
-
*
|
71 |
-
* @see Inx_Api_Reporting_ReportEngine
|
72 |
-
* @see Inx_Api_Reporting_ControlUnit
|
73 |
-
* @see Inx_Api_Reporting_Control
|
74 |
-
* @since API 1.3
|
75 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
76 |
-
* @package Inxmail
|
77 |
-
* @subpackage Reporting
|
78 |
-
*/
|
79 |
-
interface Inx_Api_Reporting_ConfigDescriptor
|
80 |
-
{
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Returns the localized title of this report.
|
84 |
-
*
|
85 |
-
* @return string the localized title of this report.
|
86 |
-
*/
|
87 |
-
public function getTitle();
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Returns the <i>Inx_Api_Reporting_ControlUnit</i> at the specified position.
|
92 |
-
*
|
93 |
-
* @param int $iIndex the index of the control unit to return.
|
94 |
-
* @return Inx_Api_Reporting_ControlUnit the control unit at the specified position.
|
95 |
-
*/
|
96 |
-
public function getControlUnit( $iIndex );
|
97 |
-
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Returns the number of <i>Inx_Api_Reporting_ControlUnit</i>s.
|
101 |
-
*
|
102 |
-
* @return int the number of control units.
|
103 |
-
*/
|
104 |
-
public function getControlUnitCount();
|
105 |
-
|
106 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Reporting
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* Every report type has a configuration descriptor.
|
9 |
+
* The <i>Inx_Api_Reporting_ConfigDescriptor</i> describes the structure and elements of the report configuration area.
|
10 |
+
* A <i>ConfigDescriptor</i> contains a set of <i>Inx_Api_Reporting_ControlUnit</i>s (mostly zero or one) which in turn
|
11 |
+
* contain a set of <i>Inx_Api_Reporting_Control</i>s.
|
12 |
+
* An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
|
13 |
+
* <p>
|
14 |
+
* The following snippet shows how to print out the content of the <i>ConfigurationDescriptor</i> for the
|
15 |
+
* ClickReactionTimeResponse report:
|
16 |
+
*
|
17 |
+
* <pre>
|
18 |
+
* $oReportEngine = $oSession->getReportEngine();
|
19 |
+
* $oConfigDescriptor = $oReportEngine->getDescriptor( "ClickReactionTimeResponse", "en_GB" );
|
20 |
+
*
|
21 |
+
* echo "<pre>";
|
22 |
+
* echo "Localized Report Title: ".$oConfigDescriptor->getTitle()."<br><br>";
|
23 |
+
*
|
24 |
+
* for( $i = 0; $i < $oConfigDescriptor->getControlUnitCount(); $i++ )
|
25 |
+
* {
|
26 |
+
* echo "Control Unit #".$i.":<br>";
|
27 |
+
* $oControlUnit = $oConfigDescriptor->getControlUnit( $i );
|
28 |
+
*
|
29 |
+
* echo "Localized control title: ".$oControlUnit->getTitle()."<br>";
|
30 |
+
*
|
31 |
+
* for( $j = 0; $j < $oControlUnit->getControlCount(); $j++ )
|
32 |
+
* {
|
33 |
+
* $oControl = $oControlUnit->getControl( $j );
|
34 |
+
*
|
35 |
+
* echo " Control #".$j.":<br>";
|
36 |
+
* echo " Control type: ".$oControl->getType()."<br>";
|
37 |
+
*
|
38 |
+
* foreach( $oControl->getPropertyKeys() as $sKey )
|
39 |
+
* {
|
40 |
+
* echo " Key: ".$sKey." - Value: ".$oControl->getProperty( $sKey )."<br>";
|
41 |
+
* }
|
42 |
+
* }
|
43 |
+
* }
|
44 |
+
*
|
45 |
+
* echo "</pre>";
|
46 |
+
* </pre>
|
47 |
+
*
|
48 |
+
* This snippet will produce the following output:
|
49 |
+
*
|
50 |
+
* <pre>
|
51 |
+
* Localized Report Title: Clicks over time
|
52 |
+
*
|
53 |
+
* Control Unit #0:
|
54 |
+
* Localized control title: Settings
|
55 |
+
* Control #0:
|
56 |
+
* Control type: mailingChooser
|
57 |
+
* Key: listTitle - Value: Mailing list:
|
58 |
+
* Key: mailingTitle - Value: Mailing:
|
59 |
+
* Key: listBind - Value: listid
|
60 |
+
* Key: mailingBind - Value: mailingid
|
61 |
+
* Control #1:
|
62 |
+
* Control type: simpleTimeIntervalControl
|
63 |
+
* Key: title - Value: Report time period:
|
64 |
+
* Key: countBind - Value: count
|
65 |
+
* Key: intervalBind - Value: interval
|
66 |
+
* Key: clause - Value: until today
|
67 |
+
* </pre>
|
68 |
+
* <p>
|
69 |
+
* For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
|
70 |
+
*
|
71 |
+
* @see Inx_Api_Reporting_ReportEngine
|
72 |
+
* @see Inx_Api_Reporting_ControlUnit
|
73 |
+
* @see Inx_Api_Reporting_Control
|
74 |
+
* @since API 1.3
|
75 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
76 |
+
* @package Inxmail
|
77 |
+
* @subpackage Reporting
|
78 |
+
*/
|
79 |
+
interface Inx_Api_Reporting_ConfigDescriptor
|
80 |
+
{
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Returns the localized title of this report.
|
84 |
+
*
|
85 |
+
* @return string the localized title of this report.
|
86 |
+
*/
|
87 |
+
public function getTitle();
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Returns the <i>Inx_Api_Reporting_ControlUnit</i> at the specified position.
|
92 |
+
*
|
93 |
+
* @param int $iIndex the index of the control unit to return.
|
94 |
+
* @return Inx_Api_Reporting_ControlUnit the control unit at the specified position.
|
95 |
+
*/
|
96 |
+
public function getControlUnit( $iIndex );
|
97 |
+
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns the number of <i>Inx_Api_Reporting_ControlUnit</i>s.
|
101 |
+
*
|
102 |
+
* @return int the number of control units.
|
103 |
+
*/
|
104 |
+
public function getControlUnitCount();
|
105 |
+
|
106 |
+
}
|
lib/Inx/Api/Reporting/Control.php
CHANGED
@@ -1,129 +1,129 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Reporting
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
|
9 |
-
* You can determine which element a <i>Control</i> describes using the <i>getType()</i> method.
|
10 |
-
* For a list of all available types, see below.
|
11 |
-
* A <i>Control</i> also provides some localized labels and the names of the value bindings, used to set
|
12 |
-
* the value of a property.
|
13 |
-
* <p>
|
14 |
-
* The following snippet shows how to use <i>getProperty($sKey)</i> to acquire the parameter bindings:
|
15 |
-
*
|
16 |
-
* <pre>
|
17 |
-
* $domainParam = $domainControl->getProperty( "bind" ); // $domainControl is of type stringControl
|
18 |
-
* $intervalParam = $timeIntervalChooser->getProperty( "intervalBind" );
|
19 |
-
* $countParam = $timeIntervalChooser->getProperty( "countBind" );
|
20 |
-
*
|
21 |
-
* $oReportRequest = new Inx_Api_Reporting_ReportRequest( "IncomingMailDetailsForDomain",
|
22 |
-
* Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML, "de_DE", "Europe/Berlin" );
|
23 |
-
* $oReportRequest->putParameter( $domainParam, "org" );
|
24 |
-
* $oReportRequest->putParameter( $intervalParam, "day" );
|
25 |
-
* $oReportRequest->putParameter( $countParam, "14" );
|
26 |
-
* </pre>
|
27 |
-
* <p>
|
28 |
-
* <b><u>Supported control types since Inxmail 3.5:</u></b>
|
29 |
-
* <p>
|
30 |
-
* <b>stringControl</b><br>
|
31 |
-
* This control has following properties:<br>
|
32 |
-
* title - the localized title of the control<br>
|
33 |
-
* bind - the unique parameter key (like "domain"); the value as string (like "com")<br>
|
34 |
-
* <p>
|
35 |
-
* <b>timeIntervalChooser</b><br>
|
36 |
-
* title - the localized title of this control<br>
|
37 |
-
* beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
|
38 |
-
* 00:00:00 GMT<br>
|
39 |
-
* endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
|
40 |
-
* 00:00:00 GMT<br>
|
41 |
-
* intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
|
42 |
-
* countBind - the unique parameter key; the count of intervals<br>
|
43 |
-
* <p>
|
44 |
-
* <b>simpleTimeIntervalControl</b><br>
|
45 |
-
* title - the localized title of this control<br>
|
46 |
-
* clause - the localized title of this control<br>
|
47 |
-
* intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
|
48 |
-
* countBind - the unique parameter key; the count of intervals<br>
|
49 |
-
* <p>
|
50 |
-
* <b>dateSpanControl</b><br>
|
51 |
-
* title - the localized title of this control<br>
|
52 |
-
* beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
|
53 |
-
* 00:00:00 GMT<br>
|
54 |
-
* endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
|
55 |
-
* 00:00:00 GMT<br>
|
56 |
-
* countBind - the unique parameter key; the count of intervals<br>
|
57 |
-
* <p>
|
58 |
-
* <b>limitControl</b><br>
|
59 |
-
* title - the localized title of this control<br>
|
60 |
-
* bind - the unique parameter key (like "limit"); the integer value as string (like "25")<br>
|
61 |
-
* <p>
|
62 |
-
* <b>attributeChooser</b><br>
|
63 |
-
* title - the localized title of this control<br>
|
64 |
-
* bind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
|
65 |
-
* <p>
|
66 |
-
* <b>listChooser</b><br>
|
67 |
-
* title - the localized title of this control<br>
|
68 |
-
* bind - the unique parameter key (like "listid"); the parameter value is the list id<br>
|
69 |
-
* <p>
|
70 |
-
* <b>mailingChooser</b><br>
|
71 |
-
* listTitle - the localized title of this control<br>
|
72 |
-
* mailingTitle - the localized title of this control<br>
|
73 |
-
* listBind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
|
74 |
-
* mailingBind - the unique parameter key (like "listid"); the parameter value is the list id<br>
|
75 |
-
* <p>
|
76 |
-
* <b>checkboxControl</b><br>
|
77 |
-
* title - the localized title of this control<br>
|
78 |
-
* bind - the unique parameter key (like "enabled1"); the valid values are "true" and "false"<br>
|
79 |
-
* <p>
|
80 |
-
* For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
|
81 |
-
*
|
82 |
-
* @see Inx_Api_Reporting_ControlUnit
|
83 |
-
* @see Inx_Api_Reporting_ConfigDescriptor
|
84 |
-
* @since API 1.3
|
85 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
86 |
-
* @package Inxmail
|
87 |
-
* @subpackage Reporting
|
88 |
-
*/
|
89 |
-
interface Inx_Api_Reporting_Control
|
90 |
-
{
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Returns the type of this control.
|
94 |
-
* <p>
|
95 |
-
* The supported types are:
|
96 |
-
* <ul>
|
97 |
-
* <li>stringControl,
|
98 |
-
* <li>timeIntervalChooser,
|
99 |
-
* <li>simpleTimeIntervalControl,
|
100 |
-
* <li>dateSpanControl,
|
101 |
-
* <li>limitControl,
|
102 |
-
* <li>attributeChooser,
|
103 |
-
* <li>listChooser,
|
104 |
-
* <li>mailingChooser and
|
105 |
-
* <li>checkboxControl
|
106 |
-
* </ul>
|
107 |
-
*
|
108 |
-
* @return string the type of this control.
|
109 |
-
*/
|
110 |
-
public function getType();
|
111 |
-
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Returns the value to which this control maps the specified key.
|
115 |
-
* The control contains localized titles and parameter bindings.
|
116 |
-
*
|
117 |
-
* @param string $sKey the key whose associated value shall be returned.
|
118 |
-
* @return string the value to which this control maps the specified key.
|
119 |
-
*/
|
120 |
-
public function getProperty( $sKey );
|
121 |
-
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Returns an array of the keys contained in this control.
|
125 |
-
*
|
126 |
-
* @return array an array of the keys.
|
127 |
-
*/
|
128 |
-
public function getPropertyKeys();
|
129 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Reporting
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Reporting_Control</i> describes a configuration element like the list or mailing chooser.
|
9 |
+
* You can determine which element a <i>Control</i> describes using the <i>getType()</i> method.
|
10 |
+
* For a list of all available types, see below.
|
11 |
+
* A <i>Control</i> also provides some localized labels and the names of the value bindings, used to set
|
12 |
+
* the value of a property.
|
13 |
+
* <p>
|
14 |
+
* The following snippet shows how to use <i>getProperty($sKey)</i> to acquire the parameter bindings:
|
15 |
+
*
|
16 |
+
* <pre>
|
17 |
+
* $domainParam = $domainControl->getProperty( "bind" ); // $domainControl is of type stringControl
|
18 |
+
* $intervalParam = $timeIntervalChooser->getProperty( "intervalBind" );
|
19 |
+
* $countParam = $timeIntervalChooser->getProperty( "countBind" );
|
20 |
+
*
|
21 |
+
* $oReportRequest = new Inx_Api_Reporting_ReportRequest( "IncomingMailDetailsForDomain",
|
22 |
+
* Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML, "de_DE", "Europe/Berlin" );
|
23 |
+
* $oReportRequest->putParameter( $domainParam, "org" );
|
24 |
+
* $oReportRequest->putParameter( $intervalParam, "day" );
|
25 |
+
* $oReportRequest->putParameter( $countParam, "14" );
|
26 |
+
* </pre>
|
27 |
+
* <p>
|
28 |
+
* <b><u>Supported control types since Inxmail 3.5:</u></b>
|
29 |
+
* <p>
|
30 |
+
* <b>stringControl</b><br>
|
31 |
+
* This control has following properties:<br>
|
32 |
+
* title - the localized title of the control<br>
|
33 |
+
* bind - the unique parameter key (like "domain"); the value as string (like "com")<br>
|
34 |
+
* <p>
|
35 |
+
* <b>timeIntervalChooser</b><br>
|
36 |
+
* title - the localized title of this control<br>
|
37 |
+
* beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
|
38 |
+
* 00:00:00 GMT<br>
|
39 |
+
* endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
|
40 |
+
* 00:00:00 GMT<br>
|
41 |
+
* intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
|
42 |
+
* countBind - the unique parameter key; the count of intervals<br>
|
43 |
+
* <p>
|
44 |
+
* <b>simpleTimeIntervalControl</b><br>
|
45 |
+
* title - the localized title of this control<br>
|
46 |
+
* clause - the localized title of this control<br>
|
47 |
+
* intervalBind - the unique parameter key; the interval type - hour, day, week and month<br>
|
48 |
+
* countBind - the unique parameter key; the count of intervals<br>
|
49 |
+
* <p>
|
50 |
+
* <b>dateSpanControl</b><br>
|
51 |
+
* title - the localized title of this control<br>
|
52 |
+
* beginBind - the unique parameter key; the begin date of the interval as number of milliseconds since January 1, 1970,
|
53 |
+
* 00:00:00 GMT<br>
|
54 |
+
* endBind - the unique parameter key; the end date of the interval as number of milliseconds since January 1, 1970,
|
55 |
+
* 00:00:00 GMT<br>
|
56 |
+
* countBind - the unique parameter key; the count of intervals<br>
|
57 |
+
* <p>
|
58 |
+
* <b>limitControl</b><br>
|
59 |
+
* title - the localized title of this control<br>
|
60 |
+
* bind - the unique parameter key (like "limit"); the integer value as string (like "25")<br>
|
61 |
+
* <p>
|
62 |
+
* <b>attributeChooser</b><br>
|
63 |
+
* title - the localized title of this control<br>
|
64 |
+
* bind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
|
65 |
+
* <p>
|
66 |
+
* <b>listChooser</b><br>
|
67 |
+
* title - the localized title of this control<br>
|
68 |
+
* bind - the unique parameter key (like "listid"); the parameter value is the list id<br>
|
69 |
+
* <p>
|
70 |
+
* <b>mailingChooser</b><br>
|
71 |
+
* listTitle - the localized title of this control<br>
|
72 |
+
* mailingTitle - the localized title of this control<br>
|
73 |
+
* listBind - the unique parameter key (like "attrid"); the parameter value is the attribute id<br>
|
74 |
+
* mailingBind - the unique parameter key (like "listid"); the parameter value is the list id<br>
|
75 |
+
* <p>
|
76 |
+
* <b>checkboxControl</b><br>
|
77 |
+
* title - the localized title of this control<br>
|
78 |
+
* bind - the unique parameter key (like "enabled1"); the valid values are "true" and "false"<br>
|
79 |
+
* <p>
|
80 |
+
* For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
|
81 |
+
*
|
82 |
+
* @see Inx_Api_Reporting_ControlUnit
|
83 |
+
* @see Inx_Api_Reporting_ConfigDescriptor
|
84 |
+
* @since API 1.3
|
85 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
86 |
+
* @package Inxmail
|
87 |
+
* @subpackage Reporting
|
88 |
+
*/
|
89 |
+
interface Inx_Api_Reporting_Control
|
90 |
+
{
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Returns the type of this control.
|
94 |
+
* <p>
|
95 |
+
* The supported types are:
|
96 |
+
* <ul>
|
97 |
+
* <li>stringControl,
|
98 |
+
* <li>timeIntervalChooser,
|
99 |
+
* <li>simpleTimeIntervalControl,
|
100 |
+
* <li>dateSpanControl,
|
101 |
+
* <li>limitControl,
|
102 |
+
* <li>attributeChooser,
|
103 |
+
* <li>listChooser,
|
104 |
+
* <li>mailingChooser and
|
105 |
+
* <li>checkboxControl
|
106 |
+
* </ul>
|
107 |
+
*
|
108 |
+
* @return string the type of this control.
|
109 |
+
*/
|
110 |
+
public function getType();
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns the value to which this control maps the specified key.
|
115 |
+
* The control contains localized titles and parameter bindings.
|
116 |
+
*
|
117 |
+
* @param string $sKey the key whose associated value shall be returned.
|
118 |
+
* @return string the value to which this control maps the specified key.
|
119 |
+
*/
|
120 |
+
public function getProperty( $sKey );
|
121 |
+
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Returns an array of the keys contained in this control.
|
125 |
+
*
|
126 |
+
* @return array an array of the keys.
|
127 |
+
*/
|
128 |
+
public function getPropertyKeys();
|
129 |
+
}
|
lib/Inx/Api/Reporting/ControlUnit.php
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Reporting
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Reporting_ControlUnit</i> describes the configuration area of a report.
|
9 |
-
* It holds the localized title and a list of <i>Inx_Api_Reporting_Control</i>s.
|
10 |
-
* <i>Inx_Api_Reporting_Control</i>s describe configuration elements like the list or mailing chooser.
|
11 |
-
* <p>
|
12 |
-
* For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
|
13 |
-
* <p>
|
14 |
-
* For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
|
15 |
-
*
|
16 |
-
* @see Inx_Api_Reporting_ConfigDescriptor
|
17 |
-
* @see Inx_Api_Reporting_Control
|
18 |
-
* @since API 1.3
|
19 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
20 |
-
* @package Inxmail
|
21 |
-
* @subpackage Reporting
|
22 |
-
*/
|
23 |
-
interface Inx_Api_Reporting_ControlUnit
|
24 |
-
{
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Returns the localized title of this control unit.
|
28 |
-
*
|
29 |
-
* @return string the localized title of this control unit.
|
30 |
-
*/
|
31 |
-
public function getTitle();
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Returns the control at the specified position.
|
36 |
-
*
|
37 |
-
* @param int $iIndex the index of the control to return.
|
38 |
-
* @return Inx_Api_Reporting_Control the control at the specified position.
|
39 |
-
*/
|
40 |
-
public function getControl( $iIndex );
|
41 |
-
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Returns the number of controls.
|
45 |
-
*
|
46 |
-
* @return int the number of controls.
|
47 |
-
*/
|
48 |
-
public function getControlCount();
|
49 |
-
|
50 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Reporting
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Reporting_ControlUnit</i> describes the configuration area of a report.
|
9 |
+
* It holds the localized title and a list of <i>Inx_Api_Reporting_Control</i>s.
|
10 |
+
* <i>Inx_Api_Reporting_Control</i>s describe configuration elements like the list or mailing chooser.
|
11 |
+
* <p>
|
12 |
+
* For more information on controls, see the <i>Inx_Api_Reporting_Control</i> documentation.
|
13 |
+
* <p>
|
14 |
+
* For more information on the report configuration in general, see the <i>Inx_Api_Reporting_ConfigDescriptor</i> documentation.
|
15 |
+
*
|
16 |
+
* @see Inx_Api_Reporting_ConfigDescriptor
|
17 |
+
* @see Inx_Api_Reporting_Control
|
18 |
+
* @since API 1.3
|
19 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
20 |
+
* @package Inxmail
|
21 |
+
* @subpackage Reporting
|
22 |
+
*/
|
23 |
+
interface Inx_Api_Reporting_ControlUnit
|
24 |
+
{
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Returns the localized title of this control unit.
|
28 |
+
*
|
29 |
+
* @return string the localized title of this control unit.
|
30 |
+
*/
|
31 |
+
public function getTitle();
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns the control at the specified position.
|
36 |
+
*
|
37 |
+
* @param int $iIndex the index of the control to return.
|
38 |
+
* @return Inx_Api_Reporting_Control the control at the specified position.
|
39 |
+
*/
|
40 |
+
public function getControl( $iIndex );
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Returns the number of controls.
|
45 |
+
*
|
46 |
+
* @return int the number of controls.
|
47 |
+
*/
|
48 |
+
public function getControlCount();
|
49 |
+
|
50 |
+
}
|
lib/Inx/Api/Reporting/DownloadableResult.php
CHANGED
@@ -1,108 +1,108 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Reporting
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* Use the <i>Inx_Api_Reporting_DownloadableResult</i> to download a generated report.
|
9 |
-
* A <i>DownloadableResult</i> can be obtained using <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i>.
|
10 |
-
* The report ticket is returned by <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
|
11 |
-
* As the report generation is an asynchronous process, the <i>DownloadableResult</i> must be polled.
|
12 |
-
* <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> will return <i>null</i> as long as the report
|
13 |
-
* generation has not finished.
|
14 |
-
* <p/>
|
15 |
-
* The following snippet shows how to download a report using the <i>DownloadableResult</i>:
|
16 |
-
*
|
17 |
-
* <pre>
|
18 |
-
* $oResult = $oReportTicket->fetchDownloadableResult();
|
19 |
-
* while( $oResult == null )
|
20 |
-
* {
|
21 |
-
* sleep( 3 );
|
22 |
-
* $oResult = $oReportTicket->fetchDownloadableResult();
|
23 |
-
* }
|
24 |
-
*
|
25 |
-
* $sOutputFile = "SystemDomainDistribution.pdf";
|
26 |
-
* download( $oResult->getInputStream(), $sOutputFile );
|
27 |
-
*
|
28 |
-
* if( $oReportTicket != null )
|
29 |
-
* {
|
30 |
-
* $oReportTicket->close();
|
31 |
-
* }
|
32 |
-
* </pre>
|
33 |
-
* <p/>
|
34 |
-
* Some output formats (e.g. <code>OUTPUT_FORMAT_HTML</code>, <code>OUTPUT_FORMAT_HTML_INXLINKS</code> or
|
35 |
-
* <code>OUTPUT_FORMAT_CSV</code>) are provide as ZIP compressed archive file, as these formats usually contain several
|
36 |
-
* files.
|
37 |
-
* The PDF output formats on the other hand are provided as single PDF files.
|
38 |
-
* The <code>download()</code> method presented in the following snippet is used to download these files, but will not
|
39 |
-
* uncompress ZIP files:
|
40 |
-
*
|
41 |
-
* <pre>
|
42 |
-
* function download($inputStream, $sFileName)
|
43 |
-
* {
|
44 |
-
* $handle = fopen($sFileName, 'w+b');
|
45 |
-
* while (($ch = $inputStream->read()) != -1)
|
46 |
-
* {
|
47 |
-
* fwrite($handle, $ch);
|
48 |
-
* }
|
49 |
-
*
|
50 |
-
* $inputStream->close();
|
51 |
-
* fclose($handle);
|
52 |
-
* }
|
53 |
-
* </pre>
|
54 |
-
* <p/>
|
55 |
-
* For a more complete example on how to generate and download reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
|
56 |
-
*
|
57 |
-
* @see Inx_Api_Reporting_ReportEngine
|
58 |
-
* @since API 1.3
|
59 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
60 |
-
* @package Inxmail
|
61 |
-
* @subpackage Reporting
|
62 |
-
*/
|
63 |
-
interface Inx_Api_Reporting_DownloadableResult
|
64 |
-
{
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Returns an <i>Inx_Api_InputStream</i> which can be used to download the report.
|
68 |
-
*
|
69 |
-
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the report.
|
70 |
-
*/
|
71 |
-
public function getInputStream();
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
* This method returns the content type of the data in the form of a string.
|
76 |
-
* <p/>
|
77 |
-
* It always returns one of the following types:
|
78 |
-
* <ol>
|
79 |
-
* <li>"zip" - if the output format is one of:
|
80 |
-
* <ul>
|
81 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML</i>,</li>
|
82 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML_INXLINKS</i> or</li>
|
83 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_CSV</i></li>
|
84 |
-
* </ul>
|
85 |
-
* </li>
|
86 |
-
* <li>"pdf" - if the output format is one of
|
87 |
-
* <ul>
|
88 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4</i></li>
|
89 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LETTER</i></li>
|
90 |
-
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LEGAL</i></li>
|
91 |
-
* </ul>
|
92 |
-
* </li>
|
93 |
-
* </ol>
|
94 |
-
*
|
95 |
-
* @return string the content type.
|
96 |
-
*/
|
97 |
-
public function getContentType();
|
98 |
-
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Returns the creation date of this report.
|
102 |
-
* The date will be returned as ISO-8601 formatted datetime string.
|
103 |
-
*
|
104 |
-
* @return string the creation date of this report.
|
105 |
-
*/
|
106 |
-
public function getCreationDate();
|
107 |
-
|
108 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Reporting
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* Use the <i>Inx_Api_Reporting_DownloadableResult</i> to download a generated report.
|
9 |
+
* A <i>DownloadableResult</i> can be obtained using <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i>.
|
10 |
+
* The report ticket is returned by <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
|
11 |
+
* As the report generation is an asynchronous process, the <i>DownloadableResult</i> must be polled.
|
12 |
+
* <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> will return <i>null</i> as long as the report
|
13 |
+
* generation has not finished.
|
14 |
+
* <p/>
|
15 |
+
* The following snippet shows how to download a report using the <i>DownloadableResult</i>:
|
16 |
+
*
|
17 |
+
* <pre>
|
18 |
+
* $oResult = $oReportTicket->fetchDownloadableResult();
|
19 |
+
* while( $oResult == null )
|
20 |
+
* {
|
21 |
+
* sleep( 3 );
|
22 |
+
* $oResult = $oReportTicket->fetchDownloadableResult();
|
23 |
+
* }
|
24 |
+
*
|
25 |
+
* $sOutputFile = "SystemDomainDistribution.pdf";
|
26 |
+
* download( $oResult->getInputStream(), $sOutputFile );
|
27 |
+
*
|
28 |
+
* if( $oReportTicket != null )
|
29 |
+
* {
|
30 |
+
* $oReportTicket->close();
|
31 |
+
* }
|
32 |
+
* </pre>
|
33 |
+
* <p/>
|
34 |
+
* Some output formats (e.g. <code>OUTPUT_FORMAT_HTML</code>, <code>OUTPUT_FORMAT_HTML_INXLINKS</code> or
|
35 |
+
* <code>OUTPUT_FORMAT_CSV</code>) are provide as ZIP compressed archive file, as these formats usually contain several
|
36 |
+
* files.
|
37 |
+
* The PDF output formats on the other hand are provided as single PDF files.
|
38 |
+
* The <code>download()</code> method presented in the following snippet is used to download these files, but will not
|
39 |
+
* uncompress ZIP files:
|
40 |
+
*
|
41 |
+
* <pre>
|
42 |
+
* function download($inputStream, $sFileName)
|
43 |
+
* {
|
44 |
+
* $handle = fopen($sFileName, 'w+b');
|
45 |
+
* while (($ch = $inputStream->read()) != -1)
|
46 |
+
* {
|
47 |
+
* fwrite($handle, $ch);
|
48 |
+
* }
|
49 |
+
*
|
50 |
+
* $inputStream->close();
|
51 |
+
* fclose($handle);
|
52 |
+
* }
|
53 |
+
* </pre>
|
54 |
+
* <p/>
|
55 |
+
* For a more complete example on how to generate and download reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
|
56 |
+
*
|
57 |
+
* @see Inx_Api_Reporting_ReportEngine
|
58 |
+
* @since API 1.3
|
59 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
60 |
+
* @package Inxmail
|
61 |
+
* @subpackage Reporting
|
62 |
+
*/
|
63 |
+
interface Inx_Api_Reporting_DownloadableResult
|
64 |
+
{
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Returns an <i>Inx_Api_InputStream</i> which can be used to download the report.
|
68 |
+
*
|
69 |
+
* @return Inx_Api_InputStream an <i>Inx_Api_InputStream</i> to download the report.
|
70 |
+
*/
|
71 |
+
public function getInputStream();
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* This method returns the content type of the data in the form of a string.
|
76 |
+
* <p/>
|
77 |
+
* It always returns one of the following types:
|
78 |
+
* <ol>
|
79 |
+
* <li>"zip" - if the output format is one of:
|
80 |
+
* <ul>
|
81 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML</i>,</li>
|
82 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_HTML_INXLINKS</i> or</li>
|
83 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_CSV</i></li>
|
84 |
+
* </ul>
|
85 |
+
* </li>
|
86 |
+
* <li>"pdf" - if the output format is one of
|
87 |
+
* <ul>
|
88 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4</i></li>
|
89 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LETTER</i></li>
|
90 |
+
* <li><i>Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_US_LEGAL</i></li>
|
91 |
+
* </ul>
|
92 |
+
* </li>
|
93 |
+
* </ol>
|
94 |
+
*
|
95 |
+
* @return string the content type.
|
96 |
+
*/
|
97 |
+
public function getContentType();
|
98 |
+
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Returns the creation date of this report.
|
102 |
+
* The date will be returned as ISO-8601 formatted datetime string.
|
103 |
+
*
|
104 |
+
* @return string the creation date of this report.
|
105 |
+
*/
|
106 |
+
public function getCreationDate();
|
107 |
+
|
108 |
+
}
|
lib/Inx/Api/Reporting/ReportException.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Reporting
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* This exception may be thrown by <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> if an
|
9 |
-
* invalid configuration of the <i>Inx_Api_Reporting_ReportRequest</i> or an internal runtime error was detected.
|
10 |
-
*
|
11 |
-
* @since API 1.3
|
12 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
-
* @package Inxmail
|
14 |
-
* @subpackage Reporting
|
15 |
-
*/
|
16 |
-
class Inx_Api_Reporting_ReportException extends Exception
|
17 |
-
{
|
18 |
-
|
19 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Reporting
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* This exception may be thrown by <i>Inx_Api_Reporting_ReportTicket::fetchDownloadableResult()</i> if an
|
9 |
+
* invalid configuration of the <i>Inx_Api_Reporting_ReportRequest</i> or an internal runtime error was detected.
|
10 |
+
*
|
11 |
+
* @since API 1.3
|
12 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
13 |
+
* @package Inxmail
|
14 |
+
* @subpackage Reporting
|
15 |
+
*/
|
16 |
+
class Inx_Api_Reporting_ReportException extends Exception
|
17 |
+
{
|
18 |
+
|
19 |
+
}
|
lib/Inx/Api/Reporting/ReportTicket.php
CHANGED
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Reporting
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_Reporting_ReportTicket</i> is a handle to access the report.
|
8 |
-
* Using the <i>Inx_Api_Reporting_ReportEngine</i> it is not possible to generate a report synchronous.
|
9 |
-
* The <i>Inx_Api_Reporting_ReportRequest</i> is sent to the server instead, where the actual generation takes place.
|
10 |
-
* This generation is processed asynchronous, thus the result must be polled.
|
11 |
-
* This polling is accomplished using the <i>ReportTicket</i> returned by
|
12 |
-
* <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
|
13 |
-
* <p>
|
14 |
-
* The following snippet briefly shows how to retrieve and use a <i>ReportTicket</i>:
|
15 |
-
*
|
16 |
-
* <pre>
|
17 |
-
* $oReportRequest = new Inx_Api_Reporting_ReportRequest( "SystemDomainDistribution",
|
18 |
-
* Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, "de_DE", "Europe/Berlin" );
|
19 |
-
* $oReportRequest->putParameter( "limit", 20 );
|
20 |
-
*
|
21 |
-
* $oTicket = $oSession->getReportEngine()->generate( $oReportRequest, false );
|
22 |
-
* try
|
23 |
-
* {
|
24 |
-
* $oDownloadableResult = $oTicket->fetchDownloadableResult();
|
25 |
-
* while( $oDownloadableResult == null )
|
26 |
-
* {
|
27 |
-
* echo "Waiting for the report to finish..." ;
|
28 |
-
* sleep( 3 );
|
29 |
-
* $oDownloadableResult = $oTicket->fetchDownloadableResult();
|
30 |
-
* }
|
31 |
-
*
|
32 |
-
* $oInputStream = $oDownloadableResult->getInputStream();
|
33 |
-
* ...
|
34 |
-
* }
|
35 |
-
* catch( ReportException x )
|
36 |
-
* {
|
37 |
-
* echo $x->getMessage();
|
38 |
-
* }
|
39 |
-
*
|
40 |
-
* if($oTicket != null)
|
41 |
-
* {
|
42 |
-
* $oTicket->close();
|
43 |
-
* }
|
44 |
-
* </pre>
|
45 |
-
* <p>
|
46 |
-
* The <i>Inx_Api_Reporting_DownloadableResult</i> fetched from the <i>ReportTicket</i> is used to download the generated report.
|
47 |
-
* <i>fetchDownloadableResult()</i> will return <i>null</i> as long as the report generation is not finished.
|
48 |
-
* To download the report, just poll for the <i>DownloadableResult</i> to become something different from <i>null</i>
|
49 |
-
* and use the provided <i>Inx_Api_InputStream</i> to download the report.
|
50 |
-
* <p>
|
51 |
-
* <strong>Note:</strong> An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
|
52 |
-
* anymore to prevent memory leaks and other potentially harmful side effects.
|
53 |
-
* <p>
|
54 |
-
* For a more complete example on how to generate and retrieve reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
|
55 |
-
*
|
56 |
-
* @see Inx_Api_Reporting_ReportEngine
|
57 |
-
* @since API 1.3
|
58 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
59 |
-
* @package Inxmail
|
60 |
-
* @subpackage Reporting
|
61 |
-
*/
|
62 |
-
interface Inx_Api_Reporting_ReportTicket
|
63 |
-
{
|
64 |
-
|
65 |
-
/**
|
66 |
-
* The original description used to generate this report.
|
67 |
-
*
|
68 |
-
* @return Inx_Api_Reporting_ReportRequest the report request
|
69 |
-
*/
|
70 |
-
public function getReportRequest();
|
71 |
-
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Returns the <i>Inx_Api_Reporting_DownloadableResult</i> object, if the report is completely generated.
|
75 |
-
* Returns <i>null</i>, if the generation of the report has not yet finished.
|
76 |
-
*
|
77 |
-
* @return the <i>DownloadableResult</i> or <i>null</i>.
|
78 |
-
* @throws Inx_Api_Reporting_ReportException if an error in the report engine has occurred.
|
79 |
-
*/
|
80 |
-
public function fetchDownloadableResult();
|
81 |
-
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Closes this <i>Inx_Api_Reporting_ReportTicket</i> and releases any resources on
|
85 |
-
* the server associated with this object.
|
86 |
-
* An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
|
87 |
-
* anymore to prevent memory leaks and other potentially harmful side effects.
|
88 |
-
*/
|
89 |
-
public function close();
|
90 |
-
|
91 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Reporting
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_Reporting_ReportTicket</i> is a handle to access the report.
|
8 |
+
* Using the <i>Inx_Api_Reporting_ReportEngine</i> it is not possible to generate a report synchronous.
|
9 |
+
* The <i>Inx_Api_Reporting_ReportRequest</i> is sent to the server instead, where the actual generation takes place.
|
10 |
+
* This generation is processed asynchronous, thus the result must be polled.
|
11 |
+
* This polling is accomplished using the <i>ReportTicket</i> returned by
|
12 |
+
* <i>Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache)</i>.
|
13 |
+
* <p>
|
14 |
+
* The following snippet briefly shows how to retrieve and use a <i>ReportTicket</i>:
|
15 |
+
*
|
16 |
+
* <pre>
|
17 |
+
* $oReportRequest = new Inx_Api_Reporting_ReportRequest( "SystemDomainDistribution",
|
18 |
+
* Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, "de_DE", "Europe/Berlin" );
|
19 |
+
* $oReportRequest->putParameter( "limit", 20 );
|
20 |
+
*
|
21 |
+
* $oTicket = $oSession->getReportEngine()->generate( $oReportRequest, false );
|
22 |
+
* try
|
23 |
+
* {
|
24 |
+
* $oDownloadableResult = $oTicket->fetchDownloadableResult();
|
25 |
+
* while( $oDownloadableResult == null )
|
26 |
+
* {
|
27 |
+
* echo "Waiting for the report to finish..." ;
|
28 |
+
* sleep( 3 );
|
29 |
+
* $oDownloadableResult = $oTicket->fetchDownloadableResult();
|
30 |
+
* }
|
31 |
+
*
|
32 |
+
* $oInputStream = $oDownloadableResult->getInputStream();
|
33 |
+
* ...
|
34 |
+
* }
|
35 |
+
* catch( ReportException x )
|
36 |
+
* {
|
37 |
+
* echo $x->getMessage();
|
38 |
+
* }
|
39 |
+
*
|
40 |
+
* if($oTicket != null)
|
41 |
+
* {
|
42 |
+
* $oTicket->close();
|
43 |
+
* }
|
44 |
+
* </pre>
|
45 |
+
* <p>
|
46 |
+
* The <i>Inx_Api_Reporting_DownloadableResult</i> fetched from the <i>ReportTicket</i> is used to download the generated report.
|
47 |
+
* <i>fetchDownloadableResult()</i> will return <i>null</i> as long as the report generation is not finished.
|
48 |
+
* To download the report, just poll for the <i>DownloadableResult</i> to become something different from <i>null</i>
|
49 |
+
* and use the provided <i>Inx_Api_InputStream</i> to download the report.
|
50 |
+
* <p>
|
51 |
+
* <strong>Note:</strong> An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
|
52 |
+
* anymore to prevent memory leaks and other potentially harmful side effects.
|
53 |
+
* <p>
|
54 |
+
* For a more complete example on how to generate and retrieve reports, see the <i>Inx_Api_Reporting_ReportEngine</i> documentation.
|
55 |
+
*
|
56 |
+
* @see Inx_Api_Reporting_ReportEngine
|
57 |
+
* @since API 1.3
|
58 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
59 |
+
* @package Inxmail
|
60 |
+
* @subpackage Reporting
|
61 |
+
*/
|
62 |
+
interface Inx_Api_Reporting_ReportTicket
|
63 |
+
{
|
64 |
+
|
65 |
+
/**
|
66 |
+
* The original description used to generate this report.
|
67 |
+
*
|
68 |
+
* @return Inx_Api_Reporting_ReportRequest the report request
|
69 |
+
*/
|
70 |
+
public function getReportRequest();
|
71 |
+
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Returns the <i>Inx_Api_Reporting_DownloadableResult</i> object, if the report is completely generated.
|
75 |
+
* Returns <i>null</i>, if the generation of the report has not yet finished.
|
76 |
+
*
|
77 |
+
* @return the <i>DownloadableResult</i> or <i>null</i>.
|
78 |
+
* @throws Inx_Api_Reporting_ReportException if an error in the report engine has occurred.
|
79 |
+
*/
|
80 |
+
public function fetchDownloadableResult();
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Closes this <i>Inx_Api_Reporting_ReportTicket</i> and releases any resources on
|
85 |
+
* the server associated with this object.
|
86 |
+
* An <i>Inx_Api_Reporting_ReportTicket</i> object <strong>must</strong> be closed once it is not needed
|
87 |
+
* anymore to prevent memory leaks and other potentially harmful side effects.
|
88 |
+
*/
|
89 |
+
public function close();
|
90 |
+
|
91 |
}
|
lib/Inx/Api/Resource/Resource.php
CHANGED
@@ -1,196 +1,196 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Resource
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_Resource_Resource</i> is a business object representing an attachment or an embedded image stored on the server.
|
9 |
-
* <i>Resource</i>s can be used in mailings, depending on their sharing type.
|
10 |
-
* The following sharing types are supported:
|
11 |
-
* <p>
|
12 |
-
* <ul>
|
13 |
-
* <li><i>SHARING_TYPE_SYSTEM</i>: The resource can be used by all mailings in all lists
|
14 |
-
* <li><i>SHARING_TYPE_MAILING</i>: The resource can only be used by one specific mailing
|
15 |
-
* <li><i>SHARING_TYPE_LIST</i>: The resource can be used by all mailings of a specific list
|
16 |
-
* </ul>
|
17 |
-
* <p>
|
18 |
-
* Besides of the sharing type a <i>Resource</i> contains meta information about the represented resource:
|
19 |
-
* <p>
|
20 |
-
* <ul>
|
21 |
-
* <li><i>The name</i>: Each resource has a name. The name does not have to be unique.
|
22 |
-
* <li><i>The content type</i>: Contains the MIME type of the resource.
|
23 |
-
* <li><i>The creation datetime</i>: The datetime when the resource was uploaded.
|
24 |
-
* <li><i>The size</i>: The size of the resource in bytes.
|
25 |
-
* <li><i>The user id</i>: References the user who uploaded the resource.
|
26 |
-
* </ul>
|
27 |
-
* <p>
|
28 |
-
* To download a resource, use the <i>Inx_Api_InputStream</i> provided by <i>getInputStream()</i>.
|
29 |
-
* <p>
|
30 |
-
* For an example on how to upload, retrieve and use resources, see the <i>Inx_Api_Resource_ResourceManager</i>
|
31 |
-
* documentation.
|
32 |
-
*
|
33 |
-
* @see com.inxmail.xpro.api.resource.ResourceManager
|
34 |
-
* @since API 1.0
|
35 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
36 |
-
* @package Inxmail
|
37 |
-
* @subpackage Resource
|
38 |
-
*/
|
39 |
-
interface Inx_Api_Resource_Resource extends Inx_Api_BusinessObject
|
40 |
-
{
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Constant for the name attribute.
|
44 |
-
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
45 |
-
*
|
46 |
-
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
47 |
-
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
48 |
-
* @var int
|
49 |
-
*/
|
50 |
-
const ATTRIBUTE_NAME = 0;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Constant for the size attribute.
|
54 |
-
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
55 |
-
*
|
56 |
-
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
57 |
-
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
58 |
-
* @var int
|
59 |
-
*/
|
60 |
-
const ATTRIBUTE_SIZE = 1;
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Constant for the creation date attribute.
|
64 |
-
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
65 |
-
*
|
66 |
-
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
67 |
-
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
68 |
-
* @var int
|
69 |
-
*/
|
70 |
-
const ATTRIBUTE_CREATION_DATETIME = 2;
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Constant for the sharing type attribute.
|
74 |
-
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
75 |
-
*
|
76 |
-
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
77 |
-
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
78 |
-
* @var int
|
79 |
-
*/
|
80 |
-
const ATTRIBUTE_SHARING_TYPE = 4;
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Constant for the user id attribute.
|
84 |
-
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
85 |
-
*
|
86 |
-
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
87 |
-
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
88 |
-
* @var int
|
89 |
-
*/
|
90 |
-
const ATTRIBUTE_USER_ID = 5;
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Sharing behaviour: Resource is not shared, but bound to the specified mailing - <i>getMailingId()</i>.
|
95 |
-
*
|
96 |
-
* @see ::getSharingType()
|
97 |
-
* @var int
|
98 |
-
*/
|
99 |
-
const SHARING_TYPE_MAILING = 0;
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Sharing behaviour: Resource is list shared, thus bound to the the specified list - <i>getListContextId()</i>.
|
103 |
-
*
|
104 |
-
* @see ::getSharingType()
|
105 |
-
* @var int
|
106 |
-
*/
|
107 |
-
const SHARING_TYPE_LIST = 1;
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Sharing behaviour: Resource is system shared, thus not bound to a single mailing or list.
|
111 |
-
*
|
112 |
-
* @see ::getSharingType()
|
113 |
-
* @var int
|
114 |
-
*/
|
115 |
-
const SHARING_TYPE_SYSTEM = 2;
|
116 |
-
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Returns the filename of the resource.
|
120 |
-
*
|
121 |
-
* @return string the filename of the resource.
|
122 |
-
*/
|
123 |
-
public function getName();
|
124 |
-
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Returns the creation date of the resource.
|
128 |
-
*
|
129 |
-
* @return string the creation date of the resource.
|
130 |
-
*/
|
131 |
-
public function getCreationDatetime();
|
132 |
-
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Returns the size of the resource file in bytes.
|
136 |
-
*
|
137 |
-
* @return int the size of the resource file in bytes.
|
138 |
-
*/
|
139 |
-
public function getSize();
|
140 |
-
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Returns the id of the user who uploaded the resource.
|
144 |
-
*
|
145 |
-
* @return int the id of the user who uploaded the resource.
|
146 |
-
*/
|
147 |
-
public function getUserId();
|
148 |
-
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Returns the id of the list this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_LIST</i>.
|
152 |
-
*
|
153 |
-
* @return int the id of the list this resource is bound to.
|
154 |
-
*/
|
155 |
-
public function getListContextId();
|
156 |
-
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Returns the id of the mailing this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_MAILING</i>.
|
160 |
-
*
|
161 |
-
* @return int the id of the mailing this resource is bound to.
|
162 |
-
*/
|
163 |
-
public function getMailingId();
|
164 |
-
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Returns the sharing type. The following sharing type values are allowed:
|
168 |
-
* <ul>
|
169 |
-
* <li> <i>SHARING_TYPE_MAILING</i>: Resource is not shared, but bound to the specified mailing - <i>getMailingId</i>.
|
170 |
-
* <li> <i>SHARING_TYPE_LIST</i>: Resource is list shared, thus bound to the the specified list - <i>getListContextId</i>.
|
171 |
-
* <li> <i>SHARING_TYPE_SYSTEM</i>: Resource is system shared, thus not bound to a single mailing or list.
|
172 |
-
* </ul>
|
173 |
-
*
|
174 |
-
* @return int the sharing type.
|
175 |
-
*/
|
176 |
-
public function getSharingType();
|
177 |
-
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Returns the MIME type of the content.
|
181 |
-
*
|
182 |
-
* @return string the MIME type of the content.
|
183 |
-
*/
|
184 |
-
public function getContentType();
|
185 |
-
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Returns an <i>Inx_Api_InputStream</i> which can be used to download the resource file.
|
189 |
-
*
|
190 |
-
* @return Inx_Api_InputStream an <i>InputStream</i> to download the resource file.
|
191 |
-
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
192 |
-
* <i>Inx_Api_UserRights::RESOURCE_FEATURE_USE</i>
|
193 |
-
*/
|
194 |
-
public function getInputStream();
|
195 |
-
|
196 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Resource
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_Resource_Resource</i> is a business object representing an attachment or an embedded image stored on the server.
|
9 |
+
* <i>Resource</i>s can be used in mailings, depending on their sharing type.
|
10 |
+
* The following sharing types are supported:
|
11 |
+
* <p>
|
12 |
+
* <ul>
|
13 |
+
* <li><i>SHARING_TYPE_SYSTEM</i>: The resource can be used by all mailings in all lists
|
14 |
+
* <li><i>SHARING_TYPE_MAILING</i>: The resource can only be used by one specific mailing
|
15 |
+
* <li><i>SHARING_TYPE_LIST</i>: The resource can be used by all mailings of a specific list
|
16 |
+
* </ul>
|
17 |
+
* <p>
|
18 |
+
* Besides of the sharing type a <i>Resource</i> contains meta information about the represented resource:
|
19 |
+
* <p>
|
20 |
+
* <ul>
|
21 |
+
* <li><i>The name</i>: Each resource has a name. The name does not have to be unique.
|
22 |
+
* <li><i>The content type</i>: Contains the MIME type of the resource.
|
23 |
+
* <li><i>The creation datetime</i>: The datetime when the resource was uploaded.
|
24 |
+
* <li><i>The size</i>: The size of the resource in bytes.
|
25 |
+
* <li><i>The user id</i>: References the user who uploaded the resource.
|
26 |
+
* </ul>
|
27 |
+
* <p>
|
28 |
+
* To download a resource, use the <i>Inx_Api_InputStream</i> provided by <i>getInputStream()</i>.
|
29 |
+
* <p>
|
30 |
+
* For an example on how to upload, retrieve and use resources, see the <i>Inx_Api_Resource_ResourceManager</i>
|
31 |
+
* documentation.
|
32 |
+
*
|
33 |
+
* @see com.inxmail.xpro.api.resource.ResourceManager
|
34 |
+
* @since API 1.0
|
35 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
36 |
+
* @package Inxmail
|
37 |
+
* @subpackage Resource
|
38 |
+
*/
|
39 |
+
interface Inx_Api_Resource_Resource extends Inx_Api_BusinessObject
|
40 |
+
{
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Constant for the name attribute.
|
44 |
+
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
45 |
+
*
|
46 |
+
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
47 |
+
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
48 |
+
* @var int
|
49 |
+
*/
|
50 |
+
const ATTRIBUTE_NAME = 0;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Constant for the size attribute.
|
54 |
+
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
55 |
+
*
|
56 |
+
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
57 |
+
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
58 |
+
* @var int
|
59 |
+
*/
|
60 |
+
const ATTRIBUTE_SIZE = 1;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Constant for the creation date attribute.
|
64 |
+
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
65 |
+
*
|
66 |
+
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
67 |
+
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
68 |
+
* @var int
|
69 |
+
*/
|
70 |
+
const ATTRIBUTE_CREATION_DATETIME = 2;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Constant for the sharing type attribute.
|
74 |
+
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
75 |
+
*
|
76 |
+
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
77 |
+
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
78 |
+
* @var int
|
79 |
+
*/
|
80 |
+
const ATTRIBUTE_SHARING_TYPE = 4;
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Constant for the user id attribute.
|
84 |
+
* Used by the <i>select()</i> and <i>selectAll()</i> methods to order the result.
|
85 |
+
*
|
86 |
+
* @see Inx_Api_Resource_ResourceManager#select(Mailing, int orderAttribute, int)
|
87 |
+
* @see Inx_Api_Resource_ResourceManager#selectAll(int orderAttribute, int)
|
88 |
+
* @var int
|
89 |
+
*/
|
90 |
+
const ATTRIBUTE_USER_ID = 5;
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Sharing behaviour: Resource is not shared, but bound to the specified mailing - <i>getMailingId()</i>.
|
95 |
+
*
|
96 |
+
* @see ::getSharingType()
|
97 |
+
* @var int
|
98 |
+
*/
|
99 |
+
const SHARING_TYPE_MAILING = 0;
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Sharing behaviour: Resource is list shared, thus bound to the the specified list - <i>getListContextId()</i>.
|
103 |
+
*
|
104 |
+
* @see ::getSharingType()
|
105 |
+
* @var int
|
106 |
+
*/
|
107 |
+
const SHARING_TYPE_LIST = 1;
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Sharing behaviour: Resource is system shared, thus not bound to a single mailing or list.
|
111 |
+
*
|
112 |
+
* @see ::getSharingType()
|
113 |
+
* @var int
|
114 |
+
*/
|
115 |
+
const SHARING_TYPE_SYSTEM = 2;
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Returns the filename of the resource.
|
120 |
+
*
|
121 |
+
* @return string the filename of the resource.
|
122 |
+
*/
|
123 |
+
public function getName();
|
124 |
+
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Returns the creation date of the resource.
|
128 |
+
*
|
129 |
+
* @return string the creation date of the resource.
|
130 |
+
*/
|
131 |
+
public function getCreationDatetime();
|
132 |
+
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Returns the size of the resource file in bytes.
|
136 |
+
*
|
137 |
+
* @return int the size of the resource file in bytes.
|
138 |
+
*/
|
139 |
+
public function getSize();
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Returns the id of the user who uploaded the resource.
|
144 |
+
*
|
145 |
+
* @return int the id of the user who uploaded the resource.
|
146 |
+
*/
|
147 |
+
public function getUserId();
|
148 |
+
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Returns the id of the list this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_LIST</i>.
|
152 |
+
*
|
153 |
+
* @return int the id of the list this resource is bound to.
|
154 |
+
*/
|
155 |
+
public function getListContextId();
|
156 |
+
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Returns the id of the mailing this resource is bound to. Only specified, if the sharing type is <i>SHARING_TYPE_MAILING</i>.
|
160 |
+
*
|
161 |
+
* @return int the id of the mailing this resource is bound to.
|
162 |
+
*/
|
163 |
+
public function getMailingId();
|
164 |
+
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Returns the sharing type. The following sharing type values are allowed:
|
168 |
+
* <ul>
|
169 |
+
* <li> <i>SHARING_TYPE_MAILING</i>: Resource is not shared, but bound to the specified mailing - <i>getMailingId</i>.
|
170 |
+
* <li> <i>SHARING_TYPE_LIST</i>: Resource is list shared, thus bound to the the specified list - <i>getListContextId</i>.
|
171 |
+
* <li> <i>SHARING_TYPE_SYSTEM</i>: Resource is system shared, thus not bound to a single mailing or list.
|
172 |
+
* </ul>
|
173 |
+
*
|
174 |
+
* @return int the sharing type.
|
175 |
+
*/
|
176 |
+
public function getSharingType();
|
177 |
+
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Returns the MIME type of the content.
|
181 |
+
*
|
182 |
+
* @return string the MIME type of the content.
|
183 |
+
*/
|
184 |
+
public function getContentType();
|
185 |
+
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Returns an <i>Inx_Api_InputStream</i> which can be used to download the resource file.
|
189 |
+
*
|
190 |
+
* @return Inx_Api_InputStream an <i>InputStream</i> to download the resource file.
|
191 |
+
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
192 |
+
* <i>Inx_Api_UserRights::RESOURCE_FEATURE_USE</i>
|
193 |
+
*/
|
194 |
+
public function getInputStream();
|
195 |
+
|
196 |
+
}
|
lib/Inx/Api/Resource/ResourceManager.php
CHANGED
@@ -1,118 +1,118 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Resource
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Resource_ResourceManager</i> manages the file resources.
|
9 |
-
* An <i>Inx_Api_Resource_Resource</i> can be used as attachment or embedded image in a mailing.
|
10 |
-
* <p>
|
11 |
-
* Attachments and embedded images used in mailings are "resources".
|
12 |
-
* Using the <i>ResourceManager</i>, these resources can be upload to and download from the Inxmail server.
|
13 |
-
* Resources can be bound to mailing lists or mailings, which means they are not visible outside these bounds,
|
14 |
-
* and will be removed with their mailing list or mailing.
|
15 |
-
* <p>
|
16 |
-
* The following snippet shows how to upload a resource (logo.gif) which can be used by all mailings in all lists:
|
17 |
-
*
|
18 |
-
* <PRE>
|
19 |
-
* $oResourceManager = $oSession->getResourceManager();
|
20 |
-
* $in = fopen("/images/logo.gif", 'rb');
|
21 |
-
* $oResource = $oResourceManager->upload( null, "logo.gif", $in );
|
22 |
-
* fclose($in);
|
23 |
-
* </PRE>
|
24 |
-
*
|
25 |
-
* Inxmail assigns an unique identifier to the uploaded resource.
|
26 |
-
* To attach a resource to a mailing, add the <i>attach</i> tag to the mail body.
|
27 |
-
* The following snippet shows how to attach the resource with the id 42 to a mailing:
|
28 |
-
*
|
29 |
-
* <PRE>
|
30 |
-
* $sb = "[%attach(".$oResource->getId(). "); ".$res->getName(). "]" ;
|
31 |
-
* </PRE>
|
32 |
-
*
|
33 |
-
* This results in a string like <i>[%attach(42); logo.gif]</i>.
|
34 |
-
* To embed an image instead of adding it as attachment, replace 'attach' with 'embedded-image':
|
35 |
-
* <i>[%embedded-image(42); logo.gif]</i>.
|
36 |
-
* <p>
|
37 |
-
* To locate existing resources, use one of the <i>select</i> methods of the <i>ResourceManager</i>.
|
38 |
-
* The following snippet shows how to retrieve all <i>Inx_Api_Resource_Resource</i>s available for a specific mailing
|
39 |
-
* and prints their IDs and names:
|
40 |
-
*
|
41 |
-
* <pre>
|
42 |
-
* $oMailing = $oSession->getMailingManager()->get( 4711 );
|
43 |
-
*
|
44 |
-
* $oResourceManager = $oSession->getResourceManager();
|
45 |
-
* $oBOResultSet = $oResourceManager->select( $oMailing, Inx_Api_Resource_Resource::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
|
46 |
-
*
|
47 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
48 |
-
* {
|
49 |
-
* $oResource = $oBOResultSet->get( $i );
|
50 |
-
* echo $oResource->getId().": ".$oResource->getName()."<br>";
|
51 |
-
* }
|
52 |
-
* </pre>
|
53 |
-
* <p>
|
54 |
-
* For more information on resources, see the <i>Inx_Api_Resource_Resource</i> documentation.
|
55 |
-
*
|
56 |
-
* @see Inx_Api_Resource_Resource
|
57 |
-
* @since API 1.0
|
58 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
59 |
-
* @package Inxmail
|
60 |
-
* @subpackage Resource
|
61 |
-
*/
|
62 |
-
interface Inx_Api_Resource_ResourceManager extends Inx_Api_BOManager
|
63 |
-
{
|
64 |
-
|
65 |
-
/** @deprecated replaced by <i>Inx_Api_Order::ASC</i> */
|
66 |
-
const ORDER_ASC = 0;
|
67 |
-
|
68 |
-
/** @deprecated replaced by <i>Inx_Api_Order::DESC</i> */
|
69 |
-
const ORDER_DESC = 1;
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Uploads a file resource to Inxmail.
|
74 |
-
* The sharing type depends on the type of the $mOwner parameter:
|
75 |
-
* <ol>
|
76 |
-
* <li>If you pass a <code>null</code> value, the resource will be shared with all other mailings in the system (i.e.
|
77 |
-
* sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_SYSTEM</i>).
|
78 |
-
* <li>If you pass an instance of <i>Inx_Api_Mailing_Mailing</i>, the resource will not be shared with other mailings
|
79 |
-
* (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_MAILING</i>).
|
80 |
-
* <li>If you pass an instance of <i>Inx_Api_List_ListContext</i>, The resource will be shared with other mailings in
|
81 |
-
* the specified list (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_LIST</i>).
|
82 |
-
* <li>Any other non <i>null</i> value will render no effect. The method will not perform the upload.
|
83 |
-
* </ol>
|
84 |
-
* If a resource with the specified name already exists it will not be overwritten.
|
85 |
-
* Instead a second resource with the same name and the new content will be created.
|
86 |
-
*
|
87 |
-
* @param Inx_Api_List_ListContext|Inx_Api_Mailing_Mailing $mOwner the list or mailing this resource will be restricted to.
|
88 |
-
* May be <i>null</i> to share the resource with all mailings in all lists.
|
89 |
-
* @param string $sFilename the filename of the resource (e.g. logo.gif).
|
90 |
-
* @param resource $rsInputStream the input stream of the file content.
|
91 |
-
* @return Inx_Api_Resource_Resource the new resource, or <i>null</i> if the upload failed.
|
92 |
-
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
93 |
-
* <i>Inx_Api_UserRights::RESOURCE_UPLOAD_MAILING_SHARING</i>
|
94 |
-
*/
|
95 |
-
public function upload( $mOwner, $sFilename, $rsInputStream );
|
96 |
-
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Returns an <i>Inx_Api_BOResultSet</i> containing all resources available for the given <i>Inx_Api_Mailing_Mailing</i>.
|
100 |
-
* This includes all non shared resources available for this mailing, list shared resources and system shared resources.
|
101 |
-
*
|
102 |
-
* @param Inx_Api_Mailing_Mailing $oMailing the mailing for which the available resources shall be retrieved.
|
103 |
-
* @param int $iOrderAttribute the order attribute. May be one of:
|
104 |
-
* <ul>
|
105 |
-
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_NAME</i>
|
106 |
-
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SHARING_TYPE</i>
|
107 |
-
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SIZE</i>
|
108 |
-
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_CREATION_DATETIME</i>
|
109 |
-
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_USER_ID</i>
|
110 |
-
* </ul>
|
111 |
-
* @param int $iOrderType the order type <i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
|
112 |
-
* @return Inx_Api_BOResultSet an <i>BOResultSet</i> object that contains the data produced by the given query.
|
113 |
-
* @throws SecurityException if the session user doesn't have the following permission:
|
114 |
-
* <i>Inx__Api_UserRights::RESOURCE_FEATURE_USE</i>
|
115 |
-
*/
|
116 |
-
public function select( Inx_Api_Mailing_Mailing $oMailing, $iOrderAttribute, $iOrderType );
|
117 |
-
|
118 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Resource
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Resource_ResourceManager</i> manages the file resources.
|
9 |
+
* An <i>Inx_Api_Resource_Resource</i> can be used as attachment or embedded image in a mailing.
|
10 |
+
* <p>
|
11 |
+
* Attachments and embedded images used in mailings are "resources".
|
12 |
+
* Using the <i>ResourceManager</i>, these resources can be upload to and download from the Inxmail server.
|
13 |
+
* Resources can be bound to mailing lists or mailings, which means they are not visible outside these bounds,
|
14 |
+
* and will be removed with their mailing list or mailing.
|
15 |
+
* <p>
|
16 |
+
* The following snippet shows how to upload a resource (logo.gif) which can be used by all mailings in all lists:
|
17 |
+
*
|
18 |
+
* <PRE>
|
19 |
+
* $oResourceManager = $oSession->getResourceManager();
|
20 |
+
* $in = fopen("/images/logo.gif", 'rb');
|
21 |
+
* $oResource = $oResourceManager->upload( null, "logo.gif", $in );
|
22 |
+
* fclose($in);
|
23 |
+
* </PRE>
|
24 |
+
*
|
25 |
+
* Inxmail assigns an unique identifier to the uploaded resource.
|
26 |
+
* To attach a resource to a mailing, add the <i>attach</i> tag to the mail body.
|
27 |
+
* The following snippet shows how to attach the resource with the id 42 to a mailing:
|
28 |
+
*
|
29 |
+
* <PRE>
|
30 |
+
* $sb = "[%attach(".$oResource->getId(). "); ".$res->getName(). "]" ;
|
31 |
+
* </PRE>
|
32 |
+
*
|
33 |
+
* This results in a string like <i>[%attach(42); logo.gif]</i>.
|
34 |
+
* To embed an image instead of adding it as attachment, replace 'attach' with 'embedded-image':
|
35 |
+
* <i>[%embedded-image(42); logo.gif]</i>.
|
36 |
+
* <p>
|
37 |
+
* To locate existing resources, use one of the <i>select</i> methods of the <i>ResourceManager</i>.
|
38 |
+
* The following snippet shows how to retrieve all <i>Inx_Api_Resource_Resource</i>s available for a specific mailing
|
39 |
+
* and prints their IDs and names:
|
40 |
+
*
|
41 |
+
* <pre>
|
42 |
+
* $oMailing = $oSession->getMailingManager()->get( 4711 );
|
43 |
+
*
|
44 |
+
* $oResourceManager = $oSession->getResourceManager();
|
45 |
+
* $oBOResultSet = $oResourceManager->select( $oMailing, Inx_Api_Resource_Resource::ATTRIBUTE_NAME, Inx_Api_Order::ASC );
|
46 |
+
*
|
47 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
48 |
+
* {
|
49 |
+
* $oResource = $oBOResultSet->get( $i );
|
50 |
+
* echo $oResource->getId().": ".$oResource->getName()."<br>";
|
51 |
+
* }
|
52 |
+
* </pre>
|
53 |
+
* <p>
|
54 |
+
* For more information on resources, see the <i>Inx_Api_Resource_Resource</i> documentation.
|
55 |
+
*
|
56 |
+
* @see Inx_Api_Resource_Resource
|
57 |
+
* @since API 1.0
|
58 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
59 |
+
* @package Inxmail
|
60 |
+
* @subpackage Resource
|
61 |
+
*/
|
62 |
+
interface Inx_Api_Resource_ResourceManager extends Inx_Api_BOManager
|
63 |
+
{
|
64 |
+
|
65 |
+
/** @deprecated replaced by <i>Inx_Api_Order::ASC</i> */
|
66 |
+
const ORDER_ASC = 0;
|
67 |
+
|
68 |
+
/** @deprecated replaced by <i>Inx_Api_Order::DESC</i> */
|
69 |
+
const ORDER_DESC = 1;
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Uploads a file resource to Inxmail.
|
74 |
+
* The sharing type depends on the type of the $mOwner parameter:
|
75 |
+
* <ol>
|
76 |
+
* <li>If you pass a <code>null</code> value, the resource will be shared with all other mailings in the system (i.e.
|
77 |
+
* sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_SYSTEM</i>).
|
78 |
+
* <li>If you pass an instance of <i>Inx_Api_Mailing_Mailing</i>, the resource will not be shared with other mailings
|
79 |
+
* (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_MAILING</i>).
|
80 |
+
* <li>If you pass an instance of <i>Inx_Api_List_ListContext</i>, The resource will be shared with other mailings in
|
81 |
+
* the specified list (i.e. sharingType is <i>Inx_Api_Resource_Resource::SHARING_TYPE_LIST</i>).
|
82 |
+
* <li>Any other non <i>null</i> value will render no effect. The method will not perform the upload.
|
83 |
+
* </ol>
|
84 |
+
* If a resource with the specified name already exists it will not be overwritten.
|
85 |
+
* Instead a second resource with the same name and the new content will be created.
|
86 |
+
*
|
87 |
+
* @param Inx_Api_List_ListContext|Inx_Api_Mailing_Mailing $mOwner the list or mailing this resource will be restricted to.
|
88 |
+
* May be <i>null</i> to share the resource with all mailings in all lists.
|
89 |
+
* @param string $sFilename the filename of the resource (e.g. logo.gif).
|
90 |
+
* @param resource $rsInputStream the input stream of the file content.
|
91 |
+
* @return Inx_Api_Resource_Resource the new resource, or <i>null</i> if the upload failed.
|
92 |
+
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
93 |
+
* <i>Inx_Api_UserRights::RESOURCE_UPLOAD_MAILING_SHARING</i>
|
94 |
+
*/
|
95 |
+
public function upload( $mOwner, $sFilename, $rsInputStream );
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Returns an <i>Inx_Api_BOResultSet</i> containing all resources available for the given <i>Inx_Api_Mailing_Mailing</i>.
|
100 |
+
* This includes all non shared resources available for this mailing, list shared resources and system shared resources.
|
101 |
+
*
|
102 |
+
* @param Inx_Api_Mailing_Mailing $oMailing the mailing for which the available resources shall be retrieved.
|
103 |
+
* @param int $iOrderAttribute the order attribute. May be one of:
|
104 |
+
* <ul>
|
105 |
+
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_NAME</i>
|
106 |
+
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SHARING_TYPE</i>
|
107 |
+
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_SIZE</i>
|
108 |
+
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_CREATION_DATETIME</i>
|
109 |
+
* <li><i>Inx_Api_Resource_Resource::ATTRIBUTE_USER_ID</i>
|
110 |
+
* </ul>
|
111 |
+
* @param int $iOrderType the order type <i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DESC</i>).
|
112 |
+
* @return Inx_Api_BOResultSet an <i>BOResultSet</i> object that contains the data produced by the given query.
|
113 |
+
* @throws SecurityException if the session user doesn't have the following permission:
|
114 |
+
* <i>Inx__Api_UserRights::RESOURCE_FEATURE_USE</i>
|
115 |
+
*/
|
116 |
+
public function select( Inx_Api_Mailing_Mailing $oMailing, $iOrderAttribute, $iOrderType );
|
117 |
+
|
118 |
+
}
|
lib/Inx/Api/SecurityException.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* @package Inxmail
|
7 |
-
*/
|
8 |
-
class Inx_Api_SecurityException extends Exception
|
9 |
-
{
|
10 |
-
|
11 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* @package Inxmail
|
7 |
+
*/
|
8 |
+
class Inx_Api_SecurityException extends Exception
|
9 |
+
{
|
10 |
+
|
11 |
}
|
lib/Inx/Api/ServerTime.php
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* The <i>Inx_Api_ServerTime</code> represents the server time. With this, you are able to translate the date from your time
|
7 |
-
* zone to the time zone of the server. Copyright (c) 2008 Inxmail GmbH. All Rights Reserved.
|
8 |
-
*
|
9 |
-
* @since API 1.4.4
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
*/
|
13 |
-
interface Inx_Api_ServerTime
|
14 |
-
{
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Returns the server time as iso 8601 formatted datetime string.
|
18 |
-
*
|
19 |
-
* @return the server time as iso 8601 formatted datetime string.
|
20 |
-
*/
|
21 |
-
public function getDatetime();
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Returns the GMT offset of the server in milliseconds.
|
26 |
-
*
|
27 |
-
* @return the GMT offset in milliseconds.
|
28 |
-
*/
|
29 |
-
public function getGMTOffset();
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Returns the day light saving time offset of the server in milliseconds.
|
34 |
-
*
|
35 |
-
* @return the DST offset in milliseconds.
|
36 |
-
*/
|
37 |
-
public function getDSTOffset();
|
38 |
-
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Returns the time zone id, for example "Europe/Berlin".
|
42 |
-
*
|
43 |
-
* @return the time zone as string.
|
44 |
-
*/
|
45 |
-
public function getTimezoneId();
|
46 |
-
|
47 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* The <i>Inx_Api_ServerTime</code> represents the server time. With this, you are able to translate the date from your time
|
7 |
+
* zone to the time zone of the server. Copyright (c) 2008 Inxmail GmbH. All Rights Reserved.
|
8 |
+
*
|
9 |
+
* @since API 1.4.4
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
*/
|
13 |
+
interface Inx_Api_ServerTime
|
14 |
+
{
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Returns the server time as iso 8601 formatted datetime string.
|
18 |
+
*
|
19 |
+
* @return the server time as iso 8601 formatted datetime string.
|
20 |
+
*/
|
21 |
+
public function getDatetime();
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Returns the GMT offset of the server in milliseconds.
|
26 |
+
*
|
27 |
+
* @return the GMT offset in milliseconds.
|
28 |
+
*/
|
29 |
+
public function getGMTOffset();
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Returns the day light saving time offset of the server in milliseconds.
|
34 |
+
*
|
35 |
+
* @return the DST offset in milliseconds.
|
36 |
+
*/
|
37 |
+
public function getDSTOffset();
|
38 |
+
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Returns the time zone id, for example "Europe/Berlin".
|
42 |
+
*
|
43 |
+
* @return the time zone as string.
|
44 |
+
*/
|
45 |
+
public function getTimezoneId();
|
46 |
+
|
47 |
+
}
|
lib/Inx/Api/Testprofiles/TestRecipientContext.php
CHANGED
@@ -1,146 +1,146 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Recipient
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* The <i>Inx_Api_Testprofiles_TestRecipientContext</i> is used to access and manipulate test recipient data.
|
10 |
-
* The following operations can be performed using the <i>Inx_Api_Testprofiles_TestRecipientContext</i>:
|
11 |
-
* <p>
|
12 |
-
* <ul>
|
13 |
-
* <li>Fetch test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>
|
14 |
-
* <li>Add and remove test recipients
|
15 |
-
* <li>Retrieve and update test recipient attribute values
|
16 |
-
* </ul>
|
17 |
-
* There are various methods for fetching test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
18 |
-
* The following snippet exemplary shows how to use one specific <code>select</code> method which retrieves all
|
19 |
-
* test recipients of the specified list whose name is equal to smith, ignoring case considerations:
|
20 |
-
*
|
21 |
-
* <pre>
|
22 |
-
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
23 |
-
* $oRecipientContext = $oSession->createRecipientContext();
|
24 |
-
* $oAttribute_name = $oRecipientContext->getMetaData()->getUserAttribute( "name" );
|
25 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
26 |
-
*
|
27 |
-
* $sNameFilter = 'Column("name") LIKE "smith"';
|
28 |
-
* $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, $sNameFilter );
|
29 |
-
*
|
30 |
-
* while( $oTestRecipientRowSet->next() )
|
31 |
-
* {
|
32 |
-
* echo $oTestRecipientRowSet->getString( $oAttribute_name )."<br>";
|
33 |
-
* }
|
34 |
-
*
|
35 |
-
* $oTestRecipientRowSet->close();
|
36 |
-
* </pre>
|
37 |
-
*
|
38 |
-
* <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the <i>TestRecipientContext</i>.
|
39 |
-
* If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
|
40 |
-
* For example the filter statement <i>"Column(\"name\") LIKE \"s%\""</i> will match test
|
41 |
-
* recipients whose name is either s% or S% but not, for example, Smith.
|
42 |
-
* <p>
|
43 |
-
* Adding and removing recipients can be accomplished by using the <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
44 |
-
* The name and email address are mandatory fields and must be updated.
|
45 |
-
* Otherwise an <i>Inx_Api_Recipient_IllegalValueException</i> will be triggered.
|
46 |
-
* The following snippet shows how to add a new test recipient using an empty <i>TestRecipientRowSet</i>:
|
47 |
-
*
|
48 |
-
* <pre>
|
49 |
-
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
50 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
51 |
-
* $oTestRecipientRowSet = $oTestRecipientContext->createRowSet( $oListContext );
|
52 |
-
* $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
|
53 |
-
*
|
54 |
-
* $oTestRecipientRowSet->moveToInsertRow();
|
55 |
-
* $oTestRecipientRowSet->updateName( "New recipient" );
|
56 |
-
* $oTestRecipientRowSet->updateString( $oAttribute_email, "new@recipient.invalid" );
|
57 |
-
* $oTestRecipientRowSet->commitRowUpdate();
|
58 |
-
* $oTestRecipientRowSet->close();
|
59 |
-
* </pre>
|
60 |
-
*
|
61 |
-
* Removing a recipient using the <i>TestRecipientRowSet</i> can be accomplished by selecting only one specific test recipient.
|
62 |
-
* To do so, use a filter expression on the email attribute.
|
63 |
-
* The following snippet shows how to do this:
|
64 |
-
*
|
65 |
-
* <pre>
|
66 |
-
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
67 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
68 |
-
* $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, 'Column("email") = "abusive@recipient.invalid"' );
|
69 |
-
*
|
70 |
-
* $oTestRecipientRowSet->next();
|
71 |
-
* $oTestRecipientRowSet->deleteRow();
|
72 |
-
* $oTestRecipientRowSet->close();
|
73 |
-
* </pre>
|
74 |
-
* <p>
|
75 |
-
* Test recipient attribute values can be updated using the
|
76 |
-
* <i>Inx_Api_Testprofiles_TestRecipientRowSet::setAttributeValue($oAttribute, $oValue)</i> method.
|
77 |
-
* The test recipient creation example further above used this method to update the email address of the newly created test recipient.
|
78 |
-
* <p>
|
79 |
-
* <strong>Note:</strong> Getting this context from the session will get a snapshot of the current attributes defined.
|
80 |
-
* This snapshot will be used for the lifetime of the context, changes in the underlying attribute configuration won't
|
81 |
-
* be reflected to it.
|
82 |
-
* This ensures that you can safely work with recipient data, even if other users possibly add or change attributes.
|
83 |
-
* <p>
|
84 |
-
* However, if a recipient attribute is deleted or the type is changed, this will also not be reflected to the
|
85 |
-
* <i>TestRecipientContext</i>.
|
86 |
-
* The attribute values may still be changed without any error, though this change will not be visible in Inxmail.
|
87 |
-
* The recipient attribute will not be undeleted.
|
88 |
-
* Therefore, it is not recommended to use the same test recipient context during long operations as the possibility
|
89 |
-
* of changes in the recipient attributes will rise.
|
90 |
-
* <p>
|
91 |
-
* <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
|
92 |
-
* needed anymore to prevent memory leaks and other potentially harmful side effects.
|
93 |
-
*
|
94 |
-
* @see Inx_Api_Testprofiles_TestRecipientRowSet
|
95 |
-
* @see Inx_Api_Recipient_RecipientContext
|
96 |
-
* @see Inx_Api_Recipient_RecipientMetaData
|
97 |
-
* @since API 1.6
|
98 |
-
* @version $Revision: 9506 $ $Date: 2007-12-20 15:44:56 +0200 (Kt, 20 Grd 2007) $ $Author: vladas $
|
99 |
-
* @package Inxmail
|
100 |
-
* @subpackage Testprofiles
|
101 |
-
*/
|
102 |
-
interface Inx_Api_Testprofiles_TestRecipientContext
|
103 |
-
{
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Returns an <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> containing all test recipients that are members of
|
107 |
-
* the given list and match the given filter and additional filter statement.
|
108 |
-
* The filter and additional filter statement attributes may be ommitted or <i>null</i>, though the list
|
109 |
-
* parameter is mandatory.
|
110 |
-
* <p>
|
111 |
-
* For further information on the filter statement syntax, see the
|
112 |
-
* <i>Inx_Api_Filter_Filter::updateStatement($sStatement)</i> documentation.
|
113 |
-
* <p>
|
114 |
-
* <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the* <i>TestRecipientContext</i>.
|
115 |
-
* If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
|
116 |
-
* For example the filter statement <i>'Column("name") LIKE "s%"'</i> will match test recipients
|
117 |
-
* whose name is either s% or S% but not, for example, Smith.
|
118 |
-
*
|
119 |
-
* @param Inx_Api_List_ListContext $list all members of this list will be selected.
|
120 |
-
* @param Inx_Api_Filter_Filter $oFilter the selection filter. May be ommitted or <i>null</i>.
|
121 |
-
* @param string $sAdditionalFilter the additional filter statement. May be ommitted or <i>null</i>.
|
122 |
-
* @return a <i>TestRecipientRowSet</i> containing all test recipients fetched by the given query.
|
123 |
-
* @throws Inx_Api_Recipient_SelectException if the selection failed.
|
124 |
-
*/
|
125 |
-
public function select( Inx_Api_List_ListContext $list=null, Inx_Api_Filter_Filter $oFilter=null, $sAdditionalFilter=null );
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Returns an empty <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
130 |
-
* Use this to add new test recipients to the specified list.
|
131 |
-
*
|
132 |
-
* @param Inx_Api_List_ListContext $list the list context for which the test recipient should be created.
|
133 |
-
* @return an empty <i>TestRecipientRowSet</i>.
|
134 |
-
*/
|
135 |
-
public function createRowSet( Inx_Api_List_ListContext $list );
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Closes this test recipient context and releases any resources associated with it.
|
139 |
-
* An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
|
140 |
-
* needed anymore to prevent memory leaks and other potentially harmful side effects.
|
141 |
-
*/
|
142 |
-
public function close();
|
143 |
-
|
144 |
-
}
|
145 |
-
|
146 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Recipient
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The <i>Inx_Api_Testprofiles_TestRecipientContext</i> is used to access and manipulate test recipient data.
|
10 |
+
* The following operations can be performed using the <i>Inx_Api_Testprofiles_TestRecipientContext</i>:
|
11 |
+
* <p>
|
12 |
+
* <ul>
|
13 |
+
* <li>Fetch test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>
|
14 |
+
* <li>Add and remove test recipients
|
15 |
+
* <li>Retrieve and update test recipient attribute values
|
16 |
+
* </ul>
|
17 |
+
* There are various methods for fetching test recipient data as <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
18 |
+
* The following snippet exemplary shows how to use one specific <code>select</code> method which retrieves all
|
19 |
+
* test recipients of the specified list whose name is equal to smith, ignoring case considerations:
|
20 |
+
*
|
21 |
+
* <pre>
|
22 |
+
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
23 |
+
* $oRecipientContext = $oSession->createRecipientContext();
|
24 |
+
* $oAttribute_name = $oRecipientContext->getMetaData()->getUserAttribute( "name" );
|
25 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
26 |
+
*
|
27 |
+
* $sNameFilter = 'Column("name") LIKE "smith"';
|
28 |
+
* $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, $sNameFilter );
|
29 |
+
*
|
30 |
+
* while( $oTestRecipientRowSet->next() )
|
31 |
+
* {
|
32 |
+
* echo $oTestRecipientRowSet->getString( $oAttribute_name )."<br>";
|
33 |
+
* }
|
34 |
+
*
|
35 |
+
* $oTestRecipientRowSet->close();
|
36 |
+
* </pre>
|
37 |
+
*
|
38 |
+
* <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the <i>TestRecipientContext</i>.
|
39 |
+
* If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
|
40 |
+
* For example the filter statement <i>"Column(\"name\") LIKE \"s%\""</i> will match test
|
41 |
+
* recipients whose name is either s% or S% but not, for example, Smith.
|
42 |
+
* <p>
|
43 |
+
* Adding and removing recipients can be accomplished by using the <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
44 |
+
* The name and email address are mandatory fields and must be updated.
|
45 |
+
* Otherwise an <i>Inx_Api_Recipient_IllegalValueException</i> will be triggered.
|
46 |
+
* The following snippet shows how to add a new test recipient using an empty <i>TestRecipientRowSet</i>:
|
47 |
+
*
|
48 |
+
* <pre>
|
49 |
+
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
50 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
51 |
+
* $oTestRecipientRowSet = $oTestRecipientContext->createRowSet( $oListContext );
|
52 |
+
* $oAttribute_email = $oSession->createRecipientContext()->getMetaData()->getEmailAttribute();
|
53 |
+
*
|
54 |
+
* $oTestRecipientRowSet->moveToInsertRow();
|
55 |
+
* $oTestRecipientRowSet->updateName( "New recipient" );
|
56 |
+
* $oTestRecipientRowSet->updateString( $oAttribute_email, "new@recipient.invalid" );
|
57 |
+
* $oTestRecipientRowSet->commitRowUpdate();
|
58 |
+
* $oTestRecipientRowSet->close();
|
59 |
+
* </pre>
|
60 |
+
*
|
61 |
+
* Removing a recipient using the <i>TestRecipientRowSet</i> can be accomplished by selecting only one specific test recipient.
|
62 |
+
* To do so, use a filter expression on the email attribute.
|
63 |
+
* The following snippet shows how to do this:
|
64 |
+
*
|
65 |
+
* <pre>
|
66 |
+
* $oTestRecipientContext = $oSession->createTestRecipientContext();
|
67 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
|
68 |
+
* $oTestRecipientRowSet = $oTestRecipientContext->select( $oListContext, null, 'Column("email") = "abusive@recipient.invalid"' );
|
69 |
+
*
|
70 |
+
* $oTestRecipientRowSet->next();
|
71 |
+
* $oTestRecipientRowSet->deleteRow();
|
72 |
+
* $oTestRecipientRowSet->close();
|
73 |
+
* </pre>
|
74 |
+
* <p>
|
75 |
+
* Test recipient attribute values can be updated using the
|
76 |
+
* <i>Inx_Api_Testprofiles_TestRecipientRowSet::setAttributeValue($oAttribute, $oValue)</i> method.
|
77 |
+
* The test recipient creation example further above used this method to update the email address of the newly created test recipient.
|
78 |
+
* <p>
|
79 |
+
* <strong>Note:</strong> Getting this context from the session will get a snapshot of the current attributes defined.
|
80 |
+
* This snapshot will be used for the lifetime of the context, changes in the underlying attribute configuration won't
|
81 |
+
* be reflected to it.
|
82 |
+
* This ensures that you can safely work with recipient data, even if other users possibly add or change attributes.
|
83 |
+
* <p>
|
84 |
+
* However, if a recipient attribute is deleted or the type is changed, this will also not be reflected to the
|
85 |
+
* <i>TestRecipientContext</i>.
|
86 |
+
* The attribute values may still be changed without any error, though this change will not be visible in Inxmail.
|
87 |
+
* The recipient attribute will not be undeleted.
|
88 |
+
* Therefore, it is not recommended to use the same test recipient context during long operations as the possibility
|
89 |
+
* of changes in the recipient attributes will rise.
|
90 |
+
* <p>
|
91 |
+
* <strong>Note:</strong> An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
|
92 |
+
* needed anymore to prevent memory leaks and other potentially harmful side effects.
|
93 |
+
*
|
94 |
+
* @see Inx_Api_Testprofiles_TestRecipientRowSet
|
95 |
+
* @see Inx_Api_Recipient_RecipientContext
|
96 |
+
* @see Inx_Api_Recipient_RecipientMetaData
|
97 |
+
* @since API 1.6
|
98 |
+
* @version $Revision: 9506 $ $Date: 2007-12-20 15:44:56 +0200 (Kt, 20 Grd 2007) $ $Author: vladas $
|
99 |
+
* @package Inxmail
|
100 |
+
* @subpackage Testprofiles
|
101 |
+
*/
|
102 |
+
interface Inx_Api_Testprofiles_TestRecipientContext
|
103 |
+
{
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Returns an <i>Inx_Api_Testprofiles_TestRecipientRowSet</i> containing all test recipients that are members of
|
107 |
+
* the given list and match the given filter and additional filter statement.
|
108 |
+
* The filter and additional filter statement attributes may be ommitted or <i>null</i>, though the list
|
109 |
+
* parameter is mandatory.
|
110 |
+
* <p>
|
111 |
+
* For further information on the filter statement syntax, see the
|
112 |
+
* <i>Inx_Api_Filter_Filter::updateStatement($sStatement)</i> documentation.
|
113 |
+
* <p>
|
114 |
+
* <strong>Note:</strong> The % sign can not be used as wildcard in the LIKE statements of the* <i>TestRecipientContext</i>.
|
115 |
+
* If you use a filter which includes the % sign, the filter will only match test recipients which contain the % sign.<br>
|
116 |
+
* For example the filter statement <i>'Column("name") LIKE "s%"'</i> will match test recipients
|
117 |
+
* whose name is either s% or S% but not, for example, Smith.
|
118 |
+
*
|
119 |
+
* @param Inx_Api_List_ListContext $list all members of this list will be selected.
|
120 |
+
* @param Inx_Api_Filter_Filter $oFilter the selection filter. May be ommitted or <i>null</i>.
|
121 |
+
* @param string $sAdditionalFilter the additional filter statement. May be ommitted or <i>null</i>.
|
122 |
+
* @return a <i>TestRecipientRowSet</i> containing all test recipients fetched by the given query.
|
123 |
+
* @throws Inx_Api_Recipient_SelectException if the selection failed.
|
124 |
+
*/
|
125 |
+
public function select( Inx_Api_List_ListContext $list=null, Inx_Api_Filter_Filter $oFilter=null, $sAdditionalFilter=null );
|
126 |
+
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Returns an empty <i>Inx_Api_Testprofiles_TestRecipientRowSet</i>.
|
130 |
+
* Use this to add new test recipients to the specified list.
|
131 |
+
*
|
132 |
+
* @param Inx_Api_List_ListContext $list the list context for which the test recipient should be created.
|
133 |
+
* @return an empty <i>TestRecipientRowSet</i>.
|
134 |
+
*/
|
135 |
+
public function createRowSet( Inx_Api_List_ListContext $list );
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Closes this test recipient context and releases any resources associated with it.
|
139 |
+
* An <i>Inx_Api_Testprofiles_TestRecipientContext</i> object <strong>must</strong> be closed once it is not
|
140 |
+
* needed anymore to prevent memory leaks and other potentially harmful side effects.
|
141 |
+
*/
|
142 |
+
public function close();
|
143 |
+
|
144 |
+
}
|
145 |
+
|
146 |
+
?>
|
lib/Inx/Api/TextModule/TextModule.php
CHANGED
@@ -1,156 +1,156 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage Textmodule
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* This class defines a text module.
|
8 |
-
* Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text
|
9 |
-
* module is defined in the system list).
|
10 |
-
* A common text module is a custom, personalized salutation which will be shown later.
|
11 |
-
* <p>
|
12 |
-
* You can update both of the content types (plain Text and html) but via the client only the one(s) defined by the
|
13 |
-
* MIME type will be used.
|
14 |
-
* Also, the text module name may be updated, though NOT the MIME type.
|
15 |
-
* If you wish to alter the MIME type, you have to delete the text module and create a new one with the values of
|
16 |
-
* the old text module and the new MIME type.
|
17 |
-
* <p>
|
18 |
-
* The following snippet shows how to create a global custom salutation text module using the user defined
|
19 |
-
* recipient attributes 'Surname', 'First name' and 'Gender':
|
20 |
-
*
|
21 |
-
* <pre>
|
22 |
-
* $oTextModuleManager = $oSession->getTextmoduleManager();
|
23 |
-
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
24 |
-
* $oTextModule = $oTextModuleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT );
|
25 |
-
*
|
26 |
-
* $sContent = "[%if Surname IS_EMPTY]Dear Sir or Madam,\n";
|
27 |
-
* $sContent .= "[%elseif Column(\"Gender\") = \"m\"]Dear Mr ";
|
28 |
-
* $sContent .= "[First name,postfix( )][Surname], \n";
|
29 |
-
* $sContent .= "[%elseif Column(\"Gender\") = \"f\"]Dear Ms ";
|
30 |
-
* $sContent .= "[First name, postfix( )][Surname], \n ";
|
31 |
-
* $sContent .= "[%else]Dear Sir or Madam,[%endif] \n ";
|
32 |
-
*
|
33 |
-
* $oTextModule->updateName( "salutation" );
|
34 |
-
* $oTextModule->updatePlainTextContent( $sContent );
|
35 |
-
* $oTextModule->commitUpdate();
|
36 |
-
* </pre>
|
37 |
-
* <p>
|
38 |
-
* For more information on the possible contents of text modules, see the corresponding section of the Inxmail client manual.
|
39 |
-
* <p>
|
40 |
-
* For an example on how to retrieve existing text modules, see the <i>In_Api_TextModule_TextModuleManager</i> documentation.
|
41 |
-
*
|
42 |
-
* @see In_Api_TextModule_TextModuleManager
|
43 |
-
* @since API 1.4.0
|
44 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
45 |
-
* @package Inxmail
|
46 |
-
* @subpackage Textmodule
|
47 |
-
*/
|
48 |
-
interface Inx_Api_TextModule_TextModule extends Inx_Api_BusinessObject
|
49 |
-
{
|
50 |
-
|
51 |
-
/**
|
52 |
-
* MIME type constant for HTML text modules. This text module has only a HTML text part.
|
53 |
-
*/
|
54 |
-
const MIME_TYPE_HTML_TEXT = 0;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* MIME type constant for plain text modules. This text module has only a plain text part.
|
58 |
-
*/
|
59 |
-
const MIME_TYPE_PLAIN_TEXT = 1;
|
60 |
-
|
61 |
-
/**
|
62 |
-
* MIME type constant for multipart text modules. This text module has a HTML and a plain text part.
|
63 |
-
*/
|
64 |
-
const MIME_TYPE_MULTIPART = 2;
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Constant for the name attribute. Used for ordering by the <i>Inx_Api_TextModule_TextModuleManager</i>.
|
68 |
-
*
|
69 |
-
* @see Inx_Api_TextModule_TextModuleManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
70 |
-
*/
|
71 |
-
const ATTRIBUTE_NAME = 0;
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Constant for the plain text attribute.
|
75 |
-
*/
|
76 |
-
const ATTRIBUTE_PLAIN_TEXT = 1;
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Constant for the HTML text attribute.
|
80 |
-
*/
|
81 |
-
const ATTRIBUTE_HTML_TEXT = 2;
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Constant for the list context id attribute.
|
85 |
-
*/
|
86 |
-
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Constant for the MIME type attribute.
|
90 |
-
*/
|
91 |
-
const ATTRIBUTE_MIME_TYPE = 4;
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Returns the name of this text module.
|
95 |
-
*
|
96 |
-
* @return string the name of this text module.
|
97 |
-
*/
|
98 |
-
public function getName();
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Updates the name of the text module.
|
102 |
-
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
103 |
-
*
|
104 |
-
* @param string $sName the new text module name.
|
105 |
-
*/
|
106 |
-
public function updateName( $sName );
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Returns the id of the list which this text module belongs to.
|
110 |
-
*
|
111 |
-
* @return int the id of the list which this text module belongs to.
|
112 |
-
*/
|
113 |
-
public function getListContextId();
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Returns the MIME type of this text module. May be one of:
|
117 |
-
* <ul>
|
118 |
-
* <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
|
119 |
-
* <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
|
120 |
-
* <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
|
121 |
-
* </ul>
|
122 |
-
*
|
123 |
-
* @return int the MIME type of this text module.
|
124 |
-
*/
|
125 |
-
public function getMimeType();
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Returns the HTML text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_PLAIN_TEXT</i>.
|
129 |
-
*
|
130 |
-
* @return string the HTML text part of this text module, if any.
|
131 |
-
*/
|
132 |
-
public function getHtmlTextContent();
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Updates the HTML text part of this text module.
|
136 |
-
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
137 |
-
*
|
138 |
-
* @param string $sHtmlTextContent the new HTML text part.
|
139 |
-
*/
|
140 |
-
public function updateHtmlTextContent( $sHtmlTextContent );
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Returns the plain text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_HTML_TEXT</i>.
|
144 |
-
*
|
145 |
-
* @return string the plain text part of this text module, if any.
|
146 |
-
*/
|
147 |
-
public function getPlainTextContent();
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Updates the plain text part of the text module.
|
151 |
-
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
152 |
-
*
|
153 |
-
* @param string $sPlainTextContent the new plain text part.
|
154 |
-
*/
|
155 |
-
public function updatePlainTextContent( $sPlainTextContent );
|
156 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage Textmodule
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* This class defines a text module.
|
8 |
+
* Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text
|
9 |
+
* module is defined in the system list).
|
10 |
+
* A common text module is a custom, personalized salutation which will be shown later.
|
11 |
+
* <p>
|
12 |
+
* You can update both of the content types (plain Text and html) but via the client only the one(s) defined by the
|
13 |
+
* MIME type will be used.
|
14 |
+
* Also, the text module name may be updated, though NOT the MIME type.
|
15 |
+
* If you wish to alter the MIME type, you have to delete the text module and create a new one with the values of
|
16 |
+
* the old text module and the new MIME type.
|
17 |
+
* <p>
|
18 |
+
* The following snippet shows how to create a global custom salutation text module using the user defined
|
19 |
+
* recipient attributes 'Surname', 'First name' and 'Gender':
|
20 |
+
*
|
21 |
+
* <pre>
|
22 |
+
* $oTextModuleManager = $oSession->getTextmoduleManager();
|
23 |
+
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
24 |
+
* $oTextModule = $oTextModuleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT );
|
25 |
+
*
|
26 |
+
* $sContent = "[%if Surname IS_EMPTY]Dear Sir or Madam,\n";
|
27 |
+
* $sContent .= "[%elseif Column(\"Gender\") = \"m\"]Dear Mr ";
|
28 |
+
* $sContent .= "[First name,postfix( )][Surname], \n";
|
29 |
+
* $sContent .= "[%elseif Column(\"Gender\") = \"f\"]Dear Ms ";
|
30 |
+
* $sContent .= "[First name, postfix( )][Surname], \n ";
|
31 |
+
* $sContent .= "[%else]Dear Sir or Madam,[%endif] \n ";
|
32 |
+
*
|
33 |
+
* $oTextModule->updateName( "salutation" );
|
34 |
+
* $oTextModule->updatePlainTextContent( $sContent );
|
35 |
+
* $oTextModule->commitUpdate();
|
36 |
+
* </pre>
|
37 |
+
* <p>
|
38 |
+
* For more information on the possible contents of text modules, see the corresponding section of the Inxmail client manual.
|
39 |
+
* <p>
|
40 |
+
* For an example on how to retrieve existing text modules, see the <i>In_Api_TextModule_TextModuleManager</i> documentation.
|
41 |
+
*
|
42 |
+
* @see In_Api_TextModule_TextModuleManager
|
43 |
+
* @since API 1.4.0
|
44 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
45 |
+
* @package Inxmail
|
46 |
+
* @subpackage Textmodule
|
47 |
+
*/
|
48 |
+
interface Inx_Api_TextModule_TextModule extends Inx_Api_BusinessObject
|
49 |
+
{
|
50 |
+
|
51 |
+
/**
|
52 |
+
* MIME type constant for HTML text modules. This text module has only a HTML text part.
|
53 |
+
*/
|
54 |
+
const MIME_TYPE_HTML_TEXT = 0;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* MIME type constant for plain text modules. This text module has only a plain text part.
|
58 |
+
*/
|
59 |
+
const MIME_TYPE_PLAIN_TEXT = 1;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* MIME type constant for multipart text modules. This text module has a HTML and a plain text part.
|
63 |
+
*/
|
64 |
+
const MIME_TYPE_MULTIPART = 2;
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Constant for the name attribute. Used for ordering by the <i>Inx_Api_TextModule_TextModuleManager</i>.
|
68 |
+
*
|
69 |
+
* @see Inx_Api_TextModule_TextModuleManager::select($oListContext, $iOrderAttribute, $iOrderType)
|
70 |
+
*/
|
71 |
+
const ATTRIBUTE_NAME = 0;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Constant for the plain text attribute.
|
75 |
+
*/
|
76 |
+
const ATTRIBUTE_PLAIN_TEXT = 1;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Constant for the HTML text attribute.
|
80 |
+
*/
|
81 |
+
const ATTRIBUTE_HTML_TEXT = 2;
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Constant for the list context id attribute.
|
85 |
+
*/
|
86 |
+
const ATTRIBUTE_LIST_CONTEXT_ID = 3;
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Constant for the MIME type attribute.
|
90 |
+
*/
|
91 |
+
const ATTRIBUTE_MIME_TYPE = 4;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Returns the name of this text module.
|
95 |
+
*
|
96 |
+
* @return string the name of this text module.
|
97 |
+
*/
|
98 |
+
public function getName();
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Updates the name of the text module.
|
102 |
+
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
103 |
+
*
|
104 |
+
* @param string $sName the new text module name.
|
105 |
+
*/
|
106 |
+
public function updateName( $sName );
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Returns the id of the list which this text module belongs to.
|
110 |
+
*
|
111 |
+
* @return int the id of the list which this text module belongs to.
|
112 |
+
*/
|
113 |
+
public function getListContextId();
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns the MIME type of this text module. May be one of:
|
117 |
+
* <ul>
|
118 |
+
* <li><i>MIME_TYPE_HTML_TEXT</i>: Only HTML text
|
119 |
+
* <li><i>MIME_TYPE_PLAIN_TEXT</i>: Only plain text
|
120 |
+
* <li><i>MIME_TYPE_MULTIPART</i>: Both, HTML and plain text
|
121 |
+
* </ul>
|
122 |
+
*
|
123 |
+
* @return int the MIME type of this text module.
|
124 |
+
*/
|
125 |
+
public function getMimeType();
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Returns the HTML text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_PLAIN_TEXT</i>.
|
129 |
+
*
|
130 |
+
* @return string the HTML text part of this text module, if any.
|
131 |
+
*/
|
132 |
+
public function getHtmlTextContent();
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Updates the HTML text part of this text module.
|
136 |
+
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
137 |
+
*
|
138 |
+
* @param string $sHtmlTextContent the new HTML text part.
|
139 |
+
*/
|
140 |
+
public function updateHtmlTextContent( $sHtmlTextContent );
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Returns the plain text part of this text module, or <i>null</i> if the MIME type is <i>MIME_TYPE_HTML_TEXT</i>.
|
144 |
+
*
|
145 |
+
* @return string the plain text part of this text module, if any.
|
146 |
+
*/
|
147 |
+
public function getPlainTextContent();
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Updates the plain text part of the text module.
|
151 |
+
* The text module will not be updated on the server until <i>commitUpdate()</i> has been called.
|
152 |
+
*
|
153 |
+
* @param string $sPlainTextContent the new plain text part.
|
154 |
+
*/
|
155 |
+
public function updatePlainTextContent( $sPlainTextContent );
|
156 |
+
}
|
lib/Inx/Api/TextModule/TextModuleManager.php
CHANGED
@@ -1,89 +1,89 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Textmodule
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TextModule_TextModuleManager</i> can be used to retrieve and create text modules.
|
9 |
-
* Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the
|
10 |
-
* text module is defined in the system list).
|
11 |
-
* A common text module is a custom, personalized salutation.
|
12 |
-
* <p>
|
13 |
-
* The following snippet shows how to create a new text module and update its name:
|
14 |
-
*
|
15 |
-
* <pre>
|
16 |
-
* $oTextmoduleManager = $oSession->getTextmoduleManager();
|
17 |
-
* $oListContext = $oSession->getListContextManager()->findByName( "Desired List" );
|
18 |
-
* $oTextModule = $oTextmoduleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT );
|
19 |
-
*
|
20 |
-
* $oTextModule->updateName( "Desired name" );
|
21 |
-
* $oTextModule->commitUpdate();
|
22 |
-
* </pre>
|
23 |
-
*
|
24 |
-
* </p>
|
25 |
-
* To retrieve existing text modules, use one of the two <i>select</i> methods provided by this manager.
|
26 |
-
* The following snippet shows how to retrieve all global text modules, ordered by their name, and prints out some
|
27 |
-
* information regarding these text modules:
|
28 |
-
*
|
29 |
-
* <pre>
|
30 |
-
* $oTextmoduleManager = $oSession->getTextmoduleManager();
|
31 |
-
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
32 |
-
* $oBOResultSet = $oTextmoduleManager->select( $oListContext, Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME, Inx_Api_Order::DESC );
|
33 |
-
*
|
34 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
35 |
-
* {
|
36 |
-
* $oTextModule = $oBOResultSet->get( $i );
|
37 |
-
* echo "Textmodule ".$oTextModule->getName()." has the content type ".$oTextModule->getMimeType()."<br>";
|
38 |
-
* }
|
39 |
-
*
|
40 |
-
* $oBOResultSet->close();
|
41 |
-
* </pre>
|
42 |
-
* <p>
|
43 |
-
* For more information on text modules, see the <i>Inx_Api_TextModule_TextModule</i> documentation.
|
44 |
-
*
|
45 |
-
* @see Inx_Api_TextModule_TextModule
|
46 |
-
* @since API 1.4.0
|
47 |
-
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
48 |
-
* @package Inxmail
|
49 |
-
* @subpackage Textmodule
|
50 |
-
*/
|
51 |
-
interface Inx_Api_TextModule_TextModuleManager extends Inx_Api_BOManager
|
52 |
-
{
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Creates a new text module in the specified list.
|
56 |
-
* To create a globally available text module, use the <i>SystemListContext</i>.
|
57 |
-
* The <i>SystemListContext</i> can be retrieved using the following snippet:
|
58 |
-
*
|
59 |
-
* <pre>
|
60 |
-
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
61 |
-
* </pre>
|
62 |
-
*
|
63 |
-
* @param Inx_Api_List_ListContext $oListContext the list the text module shall be created for.
|
64 |
-
* @param int $iMimeType the MIME type of this text module. May be one of:
|
65 |
-
* <ul>
|
66 |
-
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT</i>,
|
67 |
-
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT</i> or
|
68 |
-
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_MULTIPART</i>
|
69 |
-
* </ul>
|
70 |
-
* @return a new text module.
|
71 |
-
*/
|
72 |
-
public function createTextmodule( Inx_Api_List_ListContext $oListContext, $iMimeType );
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Returns an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list, ordered by the given
|
76 |
-
* attribute.
|
77 |
-
*
|
78 |
-
* @param Inx_Api_List_ListContext $oListContext all text modules of this list will be selected.
|
79 |
-
* @param int $iOrderAttribute the order attribute (only <i>Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME</i>).
|
80 |
-
* May be ommitted.
|
81 |
-
* @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DES</i>).
|
82 |
-
* May be ommitted.
|
83 |
-
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list.
|
84 |
-
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
85 |
-
* <i>Inx_Api_UserRights::TEXTMODULE_FEATURE_USE</i>
|
86 |
-
*/
|
87 |
-
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute=null, $iOrderType=null );
|
88 |
-
|
89 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Textmodule
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TextModule_TextModuleManager</i> can be used to retrieve and create text modules.
|
9 |
+
* Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the
|
10 |
+
* text module is defined in the system list).
|
11 |
+
* A common text module is a custom, personalized salutation.
|
12 |
+
* <p>
|
13 |
+
* The following snippet shows how to create a new text module and update its name:
|
14 |
+
*
|
15 |
+
* <pre>
|
16 |
+
* $oTextmoduleManager = $oSession->getTextmoduleManager();
|
17 |
+
* $oListContext = $oSession->getListContextManager()->findByName( "Desired List" );
|
18 |
+
* $oTextModule = $oTextmoduleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT );
|
19 |
+
*
|
20 |
+
* $oTextModule->updateName( "Desired name" );
|
21 |
+
* $oTextModule->commitUpdate();
|
22 |
+
* </pre>
|
23 |
+
*
|
24 |
+
* </p>
|
25 |
+
* To retrieve existing text modules, use one of the two <i>select</i> methods provided by this manager.
|
26 |
+
* The following snippet shows how to retrieve all global text modules, ordered by their name, and prints out some
|
27 |
+
* information regarding these text modules:
|
28 |
+
*
|
29 |
+
* <pre>
|
30 |
+
* $oTextmoduleManager = $oSession->getTextmoduleManager();
|
31 |
+
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
32 |
+
* $oBOResultSet = $oTextmoduleManager->select( $oListContext, Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME, Inx_Api_Order::DESC );
|
33 |
+
*
|
34 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
35 |
+
* {
|
36 |
+
* $oTextModule = $oBOResultSet->get( $i );
|
37 |
+
* echo "Textmodule ".$oTextModule->getName()." has the content type ".$oTextModule->getMimeType()."<br>";
|
38 |
+
* }
|
39 |
+
*
|
40 |
+
* $oBOResultSet->close();
|
41 |
+
* </pre>
|
42 |
+
* <p>
|
43 |
+
* For more information on text modules, see the <i>Inx_Api_TextModule_TextModule</i> documentation.
|
44 |
+
*
|
45 |
+
* @see Inx_Api_TextModule_TextModule
|
46 |
+
* @since API 1.4.0
|
47 |
+
* @version $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
|
48 |
+
* @package Inxmail
|
49 |
+
* @subpackage Textmodule
|
50 |
+
*/
|
51 |
+
interface Inx_Api_TextModule_TextModuleManager extends Inx_Api_BOManager
|
52 |
+
{
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Creates a new text module in the specified list.
|
56 |
+
* To create a globally available text module, use the <i>SystemListContext</i>.
|
57 |
+
* The <i>SystemListContext</i> can be retrieved using the following snippet:
|
58 |
+
*
|
59 |
+
* <pre>
|
60 |
+
* $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
|
61 |
+
* </pre>
|
62 |
+
*
|
63 |
+
* @param Inx_Api_List_ListContext $oListContext the list the text module shall be created for.
|
64 |
+
* @param int $iMimeType the MIME type of this text module. May be one of:
|
65 |
+
* <ul>
|
66 |
+
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT</i>,
|
67 |
+
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT</i> or
|
68 |
+
* <li><i>Inx_Api_TextModule_TextModule::MIME_TYPE_MULTIPART</i>
|
69 |
+
* </ul>
|
70 |
+
* @return a new text module.
|
71 |
+
*/
|
72 |
+
public function createTextmodule( Inx_Api_List_ListContext $oListContext, $iMimeType );
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Returns an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list, ordered by the given
|
76 |
+
* attribute.
|
77 |
+
*
|
78 |
+
* @param Inx_Api_List_ListContext $oListContext all text modules of this list will be selected.
|
79 |
+
* @param int $iOrderAttribute the order attribute (only <i>Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME</i>).
|
80 |
+
* May be ommitted.
|
81 |
+
* @param int $iOrderType the order type (<i>Inx_Api_Order::ASC</i> or <i>Inx_Api_Order::DES</i>).
|
82 |
+
* May be ommitted.
|
83 |
+
* @return Inx_Api_BOResultSet an <i>Inx_Api_BOResultSet</i> containing all text modules in the specified list.
|
84 |
+
* @throws Inx_Api_SecurityException if the session user doesn't have the following permission:
|
85 |
+
* <i>Inx_Api_UserRights::TEXTMODULE_FEATURE_USE</i>
|
86 |
+
*/
|
87 |
+
public function select( Inx_Api_List_ListContext $oListContext, $iOrderAttribute=null, $iOrderType=null );
|
88 |
+
|
89 |
+
}
|
lib/Inx/Api/TriggerMail/TriggerMailingConstants.php
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMail
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <code>TriggerMailingConstants</code> define some parameters for trigger mailings. The constants are used
|
9 |
-
* internally only.
|
10 |
-
*
|
11 |
-
* @author chge, 02.08.2012
|
12 |
-
*/
|
13 |
-
interface Inx_Api_TriggerMail_TriggerMailingConstants
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* the array index of list type of trigger mailing business object
|
17 |
-
*/
|
18 |
-
const INTERNAL_TRIGGER_MAILING_LIST_ID = 0;
|
19 |
-
|
20 |
-
const INTERNAL_TRIGGER_MAILING_CONTENT_TYPE = 1;
|
21 |
-
|
22 |
-
const INTERNAL_TRIGGER_MAILING_FEATURE_ID = 2;
|
23 |
-
|
24 |
-
const TRIGGER_MAILING_MAX_CHANGEDATTR_SIZE = 20;
|
25 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMail
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <code>TriggerMailingConstants</code> define some parameters for trigger mailings. The constants are used
|
9 |
+
* internally only.
|
10 |
+
*
|
11 |
+
* @author chge, 02.08.2012
|
12 |
+
*/
|
13 |
+
interface Inx_Api_TriggerMail_TriggerMailingConstants
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* the array index of list type of trigger mailing business object
|
17 |
+
*/
|
18 |
+
const INTERNAL_TRIGGER_MAILING_LIST_ID = 0;
|
19 |
+
|
20 |
+
const INTERNAL_TRIGGER_MAILING_CONTENT_TYPE = 1;
|
21 |
+
|
22 |
+
const INTERNAL_TRIGGER_MAILING_FEATURE_ID = 2;
|
23 |
+
|
24 |
+
const TRIGGER_MAILING_MAX_CHANGEDATTR_SIZE = 20;
|
25 |
}
|
lib/Inx/Api/TriggerMail/TriggerMailingExceptionType.php
CHANGED
@@ -1,140 +1,140 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMail
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <code>TriggerMailingExceptionType</code> defines the type or category of an exception that occurred while
|
9 |
-
* processing a request.
|
10 |
-
*
|
11 |
-
* @author chge, 02.08.2012
|
12 |
-
*/
|
13 |
-
final class Inx_Api_TriggerMail_TriggerMailingExceptionType
|
14 |
-
{
|
15 |
-
private static $STATE = null;
|
16 |
-
|
17 |
-
private static $RECIPIENT_NOT_FOUND = null;
|
18 |
-
|
19 |
-
private static $MAILBUILD = null;
|
20 |
-
|
21 |
-
private static $MAILING_FEATURE_DISABLED = null;
|
22 |
-
|
23 |
-
private static $APPROVAL = null;
|
24 |
-
|
25 |
-
private static $UNKNOWN = null;
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Type for {@link MailingStateException}.
|
30 |
-
*/
|
31 |
-
public static final function STATE()
|
32 |
-
{
|
33 |
-
if(null === self::$STATE)
|
34 |
-
self::$STATE = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1000 );
|
35 |
-
|
36 |
-
return self::$STATE;
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Type for {@link UnknownRecipientException} or an otherwise unknown recipient.
|
41 |
-
*/
|
42 |
-
public static final function RECIPIENT_NOT_FOUND()
|
43 |
-
{
|
44 |
-
if(null === self::$RECIPIENT_NOT_FOUND)
|
45 |
-
self::$RECIPIENT_NOT_FOUND = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1001 );
|
46 |
-
|
47 |
-
return self::$RECIPIENT_NOT_FOUND;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Type for an error which occurred during the building process of a mailing.
|
52 |
-
*/
|
53 |
-
public static final function MAILBUILD()
|
54 |
-
{
|
55 |
-
if(null === self::$MAILBUILD)
|
56 |
-
self::$MAILBUILD = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1002 );
|
57 |
-
|
58 |
-
return self::$MAILBUILD;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Type for missing mailing feature error.
|
63 |
-
*/
|
64 |
-
public static final function MAILING_FEATURE_DISABLED()
|
65 |
-
{
|
66 |
-
if(null === self::$MAILING_FEATURE_DISABLED)
|
67 |
-
self::$MAILING_FEATURE_DISABLED = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1003 );
|
68 |
-
|
69 |
-
return self::$MAILING_FEATURE_DISABLED;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Type for an error which occurred during the approval process of a mailing.
|
74 |
-
*/
|
75 |
-
public static final function APPROVAL()
|
76 |
-
{
|
77 |
-
if(null === self::$APPROVAL)
|
78 |
-
self::$APPROVAL = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1004 );
|
79 |
-
|
80 |
-
return self::$APPROVAL;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Type for an unknown error.
|
85 |
-
*/
|
86 |
-
public static final function UNKNOWN()
|
87 |
-
{
|
88 |
-
if(null === self::$UNKNOWN)
|
89 |
-
self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingExceptionType( -1 );
|
90 |
-
|
91 |
-
return self::$UNKNOWN;
|
92 |
-
}
|
93 |
-
|
94 |
-
private $id;
|
95 |
-
|
96 |
-
|
97 |
-
private function __construct( $iId )
|
98 |
-
{
|
99 |
-
$this->id = $iId;
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Returns the ID of the <code>TriggerMailingExceptionType</code>. The ID is used for transmission purposes and
|
105 |
-
* should not be used inside client code.
|
106 |
-
*
|
107 |
-
* @return the ID of the <code>TriggerMailingExceptionType</code>.
|
108 |
-
*/
|
109 |
-
public function getId()
|
110 |
-
{
|
111 |
-
return $this->id;
|
112 |
-
}
|
113 |
-
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Returns the <code>TriggerMailingExceptionType</code> corresponding to the given ID. If the ID is unknown, the
|
117 |
-
* UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client code.
|
118 |
-
*
|
119 |
-
* @param id the ID of the <code>TriggerMailingExceptionType</code> to retrieve.
|
120 |
-
* @return the <code>TriggerState</code> TriggerMailingExceptionType to the given ID.
|
121 |
-
*/
|
122 |
-
public static function byId( $iId )
|
123 |
-
{
|
124 |
-
foreach( self::values() as $type )
|
125 |
-
{
|
126 |
-
if( $type->getId() == $iId )
|
127 |
-
{
|
128 |
-
return $type;
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
return self::UNKNOWN();
|
133 |
-
}
|
134 |
-
|
135 |
-
public static function values()
|
136 |
-
{
|
137 |
-
return array(self::STATE(), self::RECIPIENT_NOT_FOUND(), self::MAILBUILD(), self::MAILING_FEATURE_DISABLED(),
|
138 |
-
self::APPROVAL(), self::UNKNOWN());
|
139 |
-
}
|
140 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMail
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <code>TriggerMailingExceptionType</code> defines the type or category of an exception that occurred while
|
9 |
+
* processing a request.
|
10 |
+
*
|
11 |
+
* @author chge, 02.08.2012
|
12 |
+
*/
|
13 |
+
final class Inx_Api_TriggerMail_TriggerMailingExceptionType
|
14 |
+
{
|
15 |
+
private static $STATE = null;
|
16 |
+
|
17 |
+
private static $RECIPIENT_NOT_FOUND = null;
|
18 |
+
|
19 |
+
private static $MAILBUILD = null;
|
20 |
+
|
21 |
+
private static $MAILING_FEATURE_DISABLED = null;
|
22 |
+
|
23 |
+
private static $APPROVAL = null;
|
24 |
+
|
25 |
+
private static $UNKNOWN = null;
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Type for {@link MailingStateException}.
|
30 |
+
*/
|
31 |
+
public static final function STATE()
|
32 |
+
{
|
33 |
+
if(null === self::$STATE)
|
34 |
+
self::$STATE = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1000 );
|
35 |
+
|
36 |
+
return self::$STATE;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Type for {@link UnknownRecipientException} or an otherwise unknown recipient.
|
41 |
+
*/
|
42 |
+
public static final function RECIPIENT_NOT_FOUND()
|
43 |
+
{
|
44 |
+
if(null === self::$RECIPIENT_NOT_FOUND)
|
45 |
+
self::$RECIPIENT_NOT_FOUND = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1001 );
|
46 |
+
|
47 |
+
return self::$RECIPIENT_NOT_FOUND;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Type for an error which occurred during the building process of a mailing.
|
52 |
+
*/
|
53 |
+
public static final function MAILBUILD()
|
54 |
+
{
|
55 |
+
if(null === self::$MAILBUILD)
|
56 |
+
self::$MAILBUILD = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1002 );
|
57 |
+
|
58 |
+
return self::$MAILBUILD;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Type for missing mailing feature error.
|
63 |
+
*/
|
64 |
+
public static final function MAILING_FEATURE_DISABLED()
|
65 |
+
{
|
66 |
+
if(null === self::$MAILING_FEATURE_DISABLED)
|
67 |
+
self::$MAILING_FEATURE_DISABLED = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1003 );
|
68 |
+
|
69 |
+
return self::$MAILING_FEATURE_DISABLED;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Type for an error which occurred during the approval process of a mailing.
|
74 |
+
*/
|
75 |
+
public static final function APPROVAL()
|
76 |
+
{
|
77 |
+
if(null === self::$APPROVAL)
|
78 |
+
self::$APPROVAL = new Inx_Api_TriggerMail_TriggerMailingExceptionType( 1004 );
|
79 |
+
|
80 |
+
return self::$APPROVAL;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Type for an unknown error.
|
85 |
+
*/
|
86 |
+
public static final function UNKNOWN()
|
87 |
+
{
|
88 |
+
if(null === self::$UNKNOWN)
|
89 |
+
self::$UNKNOWN = new Inx_Api_TriggerMail_TriggerMailingExceptionType( -1 );
|
90 |
+
|
91 |
+
return self::$UNKNOWN;
|
92 |
+
}
|
93 |
+
|
94 |
+
private $id;
|
95 |
+
|
96 |
+
|
97 |
+
private function __construct( $iId )
|
98 |
+
{
|
99 |
+
$this->id = $iId;
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Returns the ID of the <code>TriggerMailingExceptionType</code>. The ID is used for transmission purposes and
|
105 |
+
* should not be used inside client code.
|
106 |
+
*
|
107 |
+
* @return the ID of the <code>TriggerMailingExceptionType</code>.
|
108 |
+
*/
|
109 |
+
public function getId()
|
110 |
+
{
|
111 |
+
return $this->id;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns the <code>TriggerMailingExceptionType</code> corresponding to the given ID. If the ID is unknown, the
|
117 |
+
* UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client code.
|
118 |
+
*
|
119 |
+
* @param id the ID of the <code>TriggerMailingExceptionType</code> to retrieve.
|
120 |
+
* @return the <code>TriggerState</code> TriggerMailingExceptionType to the given ID.
|
121 |
+
*/
|
122 |
+
public static function byId( $iId )
|
123 |
+
{
|
124 |
+
foreach( self::values() as $type )
|
125 |
+
{
|
126 |
+
if( $type->getId() == $iId )
|
127 |
+
{
|
128 |
+
return $type;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
return self::UNKNOWN();
|
133 |
+
}
|
134 |
+
|
135 |
+
public static function values()
|
136 |
+
{
|
137 |
+
return array(self::STATE(), self::RECIPIENT_NOT_FOUND(), self::MAILBUILD(), self::MAILING_FEATURE_DISABLED(),
|
138 |
+
self::APPROVAL(), self::UNKNOWN());
|
139 |
+
}
|
140 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/ActionTriggerDescriptorBuilder.php
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder</i> is used to easily create action triggers.
|
9 |
-
* The following example shows how to create an action trigger descriptor:
|
10 |
-
*
|
11 |
-
* <pre>
|
12 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
13 |
-
* $descriptor = $factory->createActionTriggerDescriptorBuilder()->build();
|
14 |
-
* </pre>
|
15 |
-
*
|
16 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createActionTriggerDescriptorBuilder()
|
17 |
-
* @since API 1.10.0
|
18 |
-
* @author chge, 16.07.2012
|
19 |
-
*/
|
20 |
-
interface Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
21 |
-
{
|
22 |
-
|
23 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder</i> is used to easily create action triggers.
|
9 |
+
* The following example shows how to create an action trigger descriptor:
|
10 |
+
*
|
11 |
+
* <pre>
|
12 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
13 |
+
* $descriptor = $factory->createActionTriggerDescriptorBuilder()->build();
|
14 |
+
* </pre>
|
15 |
+
*
|
16 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createActionTriggerDescriptorBuilder()
|
17 |
+
* @since API 1.10.0
|
18 |
+
* @author chge, 16.07.2012
|
19 |
+
*/
|
20 |
+
interface Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
21 |
+
{
|
22 |
+
|
23 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/AnniversaryTriggerDescriptorBuilder.php
CHANGED
@@ -1,100 +1,100 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder</i> is used to easily create anniversary
|
9 |
-
* triggers. The following settings are mandatory:
|
10 |
-
* <p>
|
11 |
-
* <ul>
|
12 |
-
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
-
* <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
|
14 |
-
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
|
15 |
-
* <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired.
|
16 |
-
* </ul>
|
17 |
-
* <p>
|
18 |
-
* Using only these settings the easiest possible anniversary trigger descriptor can be built using the following
|
19 |
-
* statements:
|
20 |
-
*
|
21 |
-
* <pre>
|
22 |
-
* $rmd = $session->createRecipientContext()->getMetaData();
|
23 |
-
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
24 |
-
* $sendingTime = date('c', mktime(12, 30));
|
25 |
-
*
|
26 |
-
* $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
27 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
28 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
|
29 |
-
*
|
30 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
31 |
-
* $builder = $factory->createAnniversaryTriggerDescriptorBuilder();
|
32 |
-
* $builder->startDate( date('c') );
|
33 |
-
* $builder->sendingTime( $sendingTime );
|
34 |
-
* $builder->attribute( $birthdayId );
|
35 |
-
* $builder->columnModificator( $modificator );
|
36 |
-
* $descriptor = $builder->build();
|
37 |
-
* </pre>
|
38 |
-
* <p>
|
39 |
-
* There are also some optional settings which can be set:
|
40 |
-
* <p>
|
41 |
-
* <ul>
|
42 |
-
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
43 |
-
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
44 |
-
* trigger mailing shall be dispatched to a recipient.
|
45 |
-
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
46 |
-
* trigger mailing.
|
47 |
-
* </ul>
|
48 |
-
* <p>
|
49 |
-
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
50 |
-
*
|
51 |
-
* <pre>
|
52 |
-
* $rmd = $session->createRecipientContext()->getMetaData();
|
53 |
-
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
54 |
-
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
55 |
-
* $endDate = date('c', strtotime('+1 year'));
|
56 |
-
* $sendingTime = date('c', mktime(12, 30));
|
57 |
-
*
|
58 |
-
* $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
59 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
60 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
|
61 |
-
*
|
62 |
-
* $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
63 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
64 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1);
|
65 |
-
*
|
66 |
-
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
67 |
-
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
68 |
-
* $commands = array( $cmd );
|
69 |
-
*
|
70 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
71 |
-
* $descriptor = $factory->createAnniversaryTriggerDescriptorBuilder()->startDate( date('c') )
|
72 |
-
* ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )
|
73 |
-
* ->columnModificator( $modificator )->offset( $offset )->attributeValueSetters( $commands )
|
74 |
-
* ->build();
|
75 |
-
* </pre>
|
76 |
-
*
|
77 |
-
* The created trigger will fire one day before a recipients 50th birthday at 12:30 and will increase the Counter
|
78 |
-
* attribute. The trigger will be active from now on till the next year.
|
79 |
-
*
|
80 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createAnniversaryTriggerDescriptorBuilder()
|
81 |
-
* @since API 1.10.0
|
82 |
-
* @author chge, 16.07.2012
|
83 |
-
*/
|
84 |
-
interface Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder
|
85 |
-
extends Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
|
86 |
-
{
|
87 |
-
/**
|
88 |
-
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
|
89 |
-
* dispatch date and the date specified by the attribute. Be aware that the only legal offset type is WAS_AGO.
|
90 |
-
* For example: An anniversary trigger mailing can be sent out ten years after the date specified by the attribute.
|
91 |
-
* This setting is mandatory.
|
92 |
-
*
|
93 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator the <i>TimeTriggerOffset</i> used
|
94 |
-
* to define the time span between the dispatch date and the date specified by the attribute.
|
95 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder the builder.
|
96 |
-
* @throws Inx_Api_NullPointerException if the given offset is <i>null</i>.
|
97 |
-
* @throws Inx_Api_IllegalArgumentException if the offset type is not WAS_AGO.
|
98 |
-
*/
|
99 |
-
public function columnModificator( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator );
|
100 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder</i> is used to easily create anniversary
|
9 |
+
* triggers. The following settings are mandatory:
|
10 |
+
* <p>
|
11 |
+
* <ul>
|
12 |
+
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
+
* <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
|
14 |
+
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
|
15 |
+
* <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired.
|
16 |
+
* </ul>
|
17 |
+
* <p>
|
18 |
+
* Using only these settings the easiest possible anniversary trigger descriptor can be built using the following
|
19 |
+
* statements:
|
20 |
+
*
|
21 |
+
* <pre>
|
22 |
+
* $rmd = $session->createRecipientContext()->getMetaData();
|
23 |
+
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
24 |
+
* $sendingTime = date('c', mktime(12, 30));
|
25 |
+
*
|
26 |
+
* $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
27 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
28 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
|
29 |
+
*
|
30 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
31 |
+
* $builder = $factory->createAnniversaryTriggerDescriptorBuilder();
|
32 |
+
* $builder->startDate( date('c') );
|
33 |
+
* $builder->sendingTime( $sendingTime );
|
34 |
+
* $builder->attribute( $birthdayId );
|
35 |
+
* $builder->columnModificator( $modificator );
|
36 |
+
* $descriptor = $builder->build();
|
37 |
+
* </pre>
|
38 |
+
* <p>
|
39 |
+
* There are also some optional settings which can be set:
|
40 |
+
* <p>
|
41 |
+
* <ul>
|
42 |
+
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
43 |
+
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
44 |
+
* trigger mailing shall be dispatched to a recipient.
|
45 |
+
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
46 |
+
* trigger mailing.
|
47 |
+
* </ul>
|
48 |
+
* <p>
|
49 |
+
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
50 |
+
*
|
51 |
+
* <pre>
|
52 |
+
* $rmd = $session->createRecipientContext()->getMetaData();
|
53 |
+
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
54 |
+
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
55 |
+
* $endDate = date('c', strtotime('+1 year'));
|
56 |
+
* $sendingTime = date('c', mktime(12, 30));
|
57 |
+
*
|
58 |
+
* $modificator = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
59 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
60 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 50);
|
61 |
+
*
|
62 |
+
* $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
63 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
64 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1);
|
65 |
+
*
|
66 |
+
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
67 |
+
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
68 |
+
* $commands = array( $cmd );
|
69 |
+
*
|
70 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
71 |
+
* $descriptor = $factory->createAnniversaryTriggerDescriptorBuilder()->startDate( date('c') )
|
72 |
+
* ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )
|
73 |
+
* ->columnModificator( $modificator )->offset( $offset )->attributeValueSetters( $commands )
|
74 |
+
* ->build();
|
75 |
+
* </pre>
|
76 |
+
*
|
77 |
+
* The created trigger will fire one day before a recipients 50th birthday at 12:30 and will increase the Counter
|
78 |
+
* attribute. The trigger will be active from now on till the next year.
|
79 |
+
*
|
80 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createAnniversaryTriggerDescriptorBuilder()
|
81 |
+
* @since API 1.10.0
|
82 |
+
* @author chge, 16.07.2012
|
83 |
+
*/
|
84 |
+
interface Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder
|
85 |
+
extends Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
|
86 |
+
{
|
87 |
+
/**
|
88 |
+
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
|
89 |
+
* dispatch date and the date specified by the attribute. Be aware that the only legal offset type is WAS_AGO.
|
90 |
+
* For example: An anniversary trigger mailing can be sent out ten years after the date specified by the attribute.
|
91 |
+
* This setting is mandatory.
|
92 |
+
*
|
93 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator the <i>TimeTriggerOffset</i> used
|
94 |
+
* to define the time span between the dispatch date and the date specified by the attribute.
|
95 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder the builder.
|
96 |
+
* @throws Inx_Api_NullPointerException if the given offset is <i>null</i>.
|
97 |
+
* @throws Inx_Api_IllegalArgumentException if the offset type is not WAS_AGO.
|
98 |
+
*/
|
99 |
+
public function columnModificator( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $columnModificator );
|
100 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/AttributeTriggerDescriptorBuilder.php
CHANGED
@@ -1,109 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder</i> is used to easily create attribute
|
9 |
-
* driven time triggers. The following settings are mandatory:
|
10 |
-
* <p>
|
11 |
-
* <ul>
|
12 |
-
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
-
* <li><b>The sending time</b>: Defines the time at shich the trigger will be fired during each dispatch cycle.
|
14 |
-
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
|
15 |
-
* </ul>
|
16 |
-
* <p>
|
17 |
-
* Using only these settings the easiest possible attribute trigger descriptor can be built using the following
|
18 |
-
* statements:
|
19 |
-
*
|
20 |
-
* <pre>
|
21 |
-
* $rmd = $session->createRecipientContext()->getMetaData();
|
22 |
-
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
23 |
-
* $sendingTime = date('c', mktime(12, 30));
|
24 |
-
*
|
25 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
26 |
-
* $builder = $factory->createBirthdayTriggerDescriptorBuilder();
|
27 |
-
* $builder->startDate( date('c') );
|
28 |
-
* $builder->sendingTime( $sendingTime );
|
29 |
-
* $builder->attribute( $birthdayId );
|
30 |
-
* $descriptor = $builder->build();
|
31 |
-
* </pre>
|
32 |
-
* <p>
|
33 |
-
* There are also some optional settings which can be set:
|
34 |
-
* <p>
|
35 |
-
* <ul>
|
36 |
-
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
37 |
-
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
38 |
-
* trigger mailing shall be dispatched to a recipient.
|
39 |
-
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
40 |
-
* trigger mailing.
|
41 |
-
* </ul>
|
42 |
-
* <p>
|
43 |
-
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
44 |
-
*
|
45 |
-
* <pre>
|
46 |
-
* $rmd = $session->createRecipientContext()->getMetaData();
|
47 |
-
* $birthdayId = $rmd->getUserAttribute( "Geburtstag" )->getId();
|
48 |
-
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
49 |
-
*
|
50 |
-
* $endDate = date('c', strtotime('+1 year'));
|
51 |
-
* $sendingTime = date('c', mktime(12, 30));
|
52 |
-
*
|
53 |
-
* $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
54 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
55 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1 );
|
56 |
-
*
|
57 |
-
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
58 |
-
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
59 |
-
* $commands = array( $cmd );
|
60 |
-
*
|
61 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
62 |
-
* $descriptor = $factory->createBirthdayTriggerDescriptorBuilder()->startDate( date('c') )
|
63 |
-
* ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )->offset( $offset )
|
64 |
-
* ->attributeValueSetters( $commands )->build();
|
65 |
-
* </pre>
|
66 |
-
*
|
67 |
-
* The created trigger will fire one day before a recipients birthday at 12:30 and will increase the Counter attribute.
|
68 |
-
* The trigger will be active from now on till the next year.
|
69 |
-
*
|
70 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createBirthdayTriggerDescriptorBuilder()
|
71 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createFollowUpTriggerDescriptorBuilder()
|
72 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createReminderTriggerDescriptorBuilder()
|
73 |
-
* @since API 1.10.0
|
74 |
-
* @author chge, 16.07.2012
|
75 |
-
*/
|
76 |
-
interface Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
|
77 |
-
extends Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
78 |
-
{
|
79 |
-
/**
|
80 |
-
* Sets the ID of the recipient attribute used as basis of the trigger. This setting is mandatory.
|
81 |
-
*
|
82 |
-
* @param int $iAttributeId the ID of the recipient attribute used as basis of the trigger.
|
83 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder the builder.
|
84 |
-
*/
|
85 |
-
public function attribute( $iAttributeId );
|
86 |
-
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to alter the dispatch date specified
|
90 |
-
* by the attribute. For example: Normally, birthday trigger mailings are sent on the birthday of the recipient.
|
91 |
-
* Using a <i>TimeTriggerOffset</i> you can send your congratulations before or after that date. This setting is
|
92 |
-
* optional.
|
93 |
-
* <p>
|
94 |
-
* There are some restrictions regarding the permitted offset types and units:
|
95 |
-
* <ul>
|
96 |
-
* <li><b>Birthday trigger mailing</b>: Only the DAY unit is permitted.
|
97 |
-
* <li><b>Reminder trigger mailing</b>: Only the DAY unit and the IS_IN type are permitted.
|
98 |
-
* <li><b>Follow-up trigger mailing</b>: Only the DAY unit and the WAS_AGO type are permitted.
|
99 |
-
* <li><b>Anniversary trigger mailing</b>: Only the DAY unit is permitted.
|
100 |
-
* </ul>
|
101 |
-
*
|
102 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $offset the <i>TimeTriggerOffset</i> used to alter
|
103 |
-
* the dispatch date specified by the attribute.
|
104 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder the builder.
|
105 |
-
* @throws Inx_Api_IllegalArgumentException if the offset type or unit is illegal in combination with the trigger
|
106 |
-
* type at hand.
|
107 |
-
*/
|
108 |
-
public function offset( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $offset = null );
|
109 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder</i> is used to easily create attribute
|
9 |
+
* driven time triggers. The following settings are mandatory:
|
10 |
+
* <p>
|
11 |
+
* <ul>
|
12 |
+
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
+
* <li><b>The sending time</b>: Defines the time at shich the trigger will be fired during each dispatch cycle.
|
14 |
+
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients.
|
15 |
+
* </ul>
|
16 |
+
* <p>
|
17 |
+
* Using only these settings the easiest possible attribute trigger descriptor can be built using the following
|
18 |
+
* statements:
|
19 |
+
*
|
20 |
+
* <pre>
|
21 |
+
* $rmd = $session->createRecipientContext()->getMetaData();
|
22 |
+
* $birthdayId = $rmd->getUserAttribute( "Birthday" )->getId();
|
23 |
+
* $sendingTime = date('c', mktime(12, 30));
|
24 |
+
*
|
25 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
26 |
+
* $builder = $factory->createBirthdayTriggerDescriptorBuilder();
|
27 |
+
* $builder->startDate( date('c') );
|
28 |
+
* $builder->sendingTime( $sendingTime );
|
29 |
+
* $builder->attribute( $birthdayId );
|
30 |
+
* $descriptor = $builder->build();
|
31 |
+
* </pre>
|
32 |
+
* <p>
|
33 |
+
* There are also some optional settings which can be set:
|
34 |
+
* <p>
|
35 |
+
* <ul>
|
36 |
+
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
37 |
+
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
38 |
+
* trigger mailing shall be dispatched to a recipient.
|
39 |
+
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
40 |
+
* trigger mailing.
|
41 |
+
* </ul>
|
42 |
+
* <p>
|
43 |
+
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
44 |
+
*
|
45 |
+
* <pre>
|
46 |
+
* $rmd = $session->createRecipientContext()->getMetaData();
|
47 |
+
* $birthdayId = $rmd->getUserAttribute( "Geburtstag" )->getId();
|
48 |
+
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
49 |
+
*
|
50 |
+
* $endDate = date('c', strtotime('+1 year'));
|
51 |
+
* $sendingTime = date('c', mktime(12, 30));
|
52 |
+
*
|
53 |
+
* $offset = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
54 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
55 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1 );
|
56 |
+
*
|
57 |
+
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
58 |
+
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
59 |
+
* $commands = array( $cmd );
|
60 |
+
*
|
61 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
62 |
+
* $descriptor = $factory->createBirthdayTriggerDescriptorBuilder()->startDate( date('c') )
|
63 |
+
* ->sendingTime( $sendingTime )->endDate( $endDate )->attribute( $birthdayId )->offset( $offset )
|
64 |
+
* ->attributeValueSetters( $commands )->build();
|
65 |
+
* </pre>
|
66 |
+
*
|
67 |
+
* The created trigger will fire one day before a recipients birthday at 12:30 and will increase the Counter attribute.
|
68 |
+
* The trigger will be active from now on till the next year.
|
69 |
+
*
|
70 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createBirthdayTriggerDescriptorBuilder()
|
71 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createFollowUpTriggerDescriptorBuilder()
|
72 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createReminderTriggerDescriptorBuilder()
|
73 |
+
* @since API 1.10.0
|
74 |
+
* @author chge, 16.07.2012
|
75 |
+
*/
|
76 |
+
interface Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder
|
77 |
+
extends Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
78 |
+
{
|
79 |
+
/**
|
80 |
+
* Sets the ID of the recipient attribute used as basis of the trigger. This setting is mandatory.
|
81 |
+
*
|
82 |
+
* @param int $iAttributeId the ID of the recipient attribute used as basis of the trigger.
|
83 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder the builder.
|
84 |
+
*/
|
85 |
+
public function attribute( $iAttributeId );
|
86 |
+
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to alter the dispatch date specified
|
90 |
+
* by the attribute. For example: Normally, birthday trigger mailings are sent on the birthday of the recipient.
|
91 |
+
* Using a <i>TimeTriggerOffset</i> you can send your congratulations before or after that date. This setting is
|
92 |
+
* optional.
|
93 |
+
* <p>
|
94 |
+
* There are some restrictions regarding the permitted offset types and units:
|
95 |
+
* <ul>
|
96 |
+
* <li><b>Birthday trigger mailing</b>: Only the DAY unit is permitted.
|
97 |
+
* <li><b>Reminder trigger mailing</b>: Only the DAY unit and the IS_IN type are permitted.
|
98 |
+
* <li><b>Follow-up trigger mailing</b>: Only the DAY unit and the WAS_AGO type are permitted.
|
99 |
+
* <li><b>Anniversary trigger mailing</b>: Only the DAY unit is permitted.
|
100 |
+
* </ul>
|
101 |
+
*
|
102 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $offset the <i>TimeTriggerOffset</i> used to alter
|
103 |
+
* the dispatch date specified by the attribute.
|
104 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder the builder.
|
105 |
+
* @throws Inx_Api_IllegalArgumentException if the offset type or unit is illegal in combination with the trigger
|
106 |
+
* type at hand.
|
107 |
+
*/
|
108 |
+
public function offset( Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset $offset = null );
|
109 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/DailyTriggerIntervalBuilder.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder</i> is used to create a daily trigger interval.
|
9 |
-
* The only mandatory setting is the interval count. There are no optional settings.
|
10 |
-
* <p>
|
11 |
-
* The following snippet shows how to build a daily trigger interval which will fire the trigger every two days:
|
12 |
-
*
|
13 |
-
* <pre>
|
14 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
15 |
-
* $interval = $factory->getDailyIntervalBuilder()->intervalCount( 2 )->build();
|
16 |
-
* </pre>
|
17 |
-
*
|
18 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
19 |
-
* @since API 1.10.0
|
20 |
-
* @author chge, 17.07.2012
|
21 |
-
*/
|
22 |
-
interface Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder
|
23 |
-
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
24 |
-
{
|
25 |
-
|
26 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder</i> is used to create a daily trigger interval.
|
9 |
+
* The only mandatory setting is the interval count. There are no optional settings.
|
10 |
+
* <p>
|
11 |
+
* The following snippet shows how to build a daily trigger interval which will fire the trigger every two days:
|
12 |
+
*
|
13 |
+
* <pre>
|
14 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
15 |
+
* $interval = $factory->getDailyIntervalBuilder()->intervalCount( 2 )->build();
|
16 |
+
* </pre>
|
17 |
+
*
|
18 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
19 |
+
* @since API 1.10.0
|
20 |
+
* @author chge, 17.07.2012
|
21 |
+
*/
|
22 |
+
interface Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder
|
23 |
+
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
24 |
+
{
|
25 |
+
|
26 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/HourlyTriggerIntervalBuilder.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder</i> is used to create a hourly trigger interval.
|
9 |
-
* The only mandatory setting is the interval count. There are no optional settings.
|
10 |
-
* <p>
|
11 |
-
* The following snippet shows how to build a hourly trigger interval which will fire the trigger every five hours:
|
12 |
-
*
|
13 |
-
* <pre>
|
14 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
15 |
-
* $interval = $factory->getHourlyIntervalBuilder()->intervalCount( 5 )->build();
|
16 |
-
* </pre>
|
17 |
-
*
|
18 |
-
* @see Inx:_Api_TriggerMailing_Descriptor_TriggerInterval
|
19 |
-
* @since API 1.10.0
|
20 |
-
* @author chge, 17.07.2012
|
21 |
-
*/
|
22 |
-
interface Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder
|
23 |
-
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
24 |
-
{
|
25 |
-
|
26 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder</i> is used to create a hourly trigger interval.
|
9 |
+
* The only mandatory setting is the interval count. There are no optional settings.
|
10 |
+
* <p>
|
11 |
+
* The following snippet shows how to build a hourly trigger interval which will fire the trigger every five hours:
|
12 |
+
*
|
13 |
+
* <pre>
|
14 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
15 |
+
* $interval = $factory->getHourlyIntervalBuilder()->intervalCount( 5 )->build();
|
16 |
+
* </pre>
|
17 |
+
*
|
18 |
+
* @see Inx:_Api_TriggerMailing_Descriptor_TriggerInterval
|
19 |
+
* @since API 1.10.0
|
20 |
+
* @author chge, 17.07.2012
|
21 |
+
*/
|
22 |
+
interface Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder
|
23 |
+
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
24 |
+
{
|
25 |
+
|
26 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/IntervalTriggerDescriptorBuilder.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder</i> is used to easily create interval
|
9 |
-
* triggers. The following settings are mandatory:
|
10 |
-
* <p>
|
11 |
-
* <ul>
|
12 |
-
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
-
* <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
|
14 |
-
* <li><b>The interval</b>: Defines the interval at which the trigger will be fired.
|
15 |
-
* </ul>
|
16 |
-
* <p>
|
17 |
-
* Using only these settings the easiest possible interval trigger descriptor can be built using the following
|
18 |
-
* statements:
|
19 |
-
*
|
20 |
-
* <pre>
|
21 |
-
* $intFactory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
22 |
-
* $intBuilder = $intFactory->getDailyIntervalBuilder();
|
23 |
-
* $intBuilder->intervalCount( 1 );
|
24 |
-
* $interval = $intBuilder->build();
|
25 |
-
* $sendingTime = date('c', mktime(12, 30));
|
26 |
-
*
|
27 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
28 |
-
* $builder = $factory->createIntervalTriggerDescriptorBuilder();
|
29 |
-
* $builder->startDate( date('c') );
|
30 |
-
* $builder->sendingTime( $sendingTime );
|
31 |
-
* $builder->interval( $interval );
|
32 |
-
* $descriptor = $builder->build();
|
33 |
-
* </pre>
|
34 |
-
* <p>
|
35 |
-
* There are also some optional settings which can be set:
|
36 |
-
* <p>
|
37 |
-
* <ul>
|
38 |
-
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
39 |
-
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
40 |
-
* trigger mailing.
|
41 |
-
* </ul>
|
42 |
-
* <p>
|
43 |
-
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
44 |
-
*
|
45 |
-
* <pre>
|
46 |
-
* $intFactory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
47 |
-
* $interval = $intFactory->getWeeklyIntervalBuilder()->intervalCount( 2 )->dispatchIntervals(
|
48 |
-
* array(Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::MONDAY(),
|
49 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::FRIDAY() ) )->build();
|
50 |
-
*
|
51 |
-
* $rmd = $session->createRecipientContext()->getMetaData();
|
52 |
-
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
53 |
-
* $endDate = date('c', strtotime('+1 year'));
|
54 |
-
* $sendingTime = date('c', mktime(12, 30));
|
55 |
-
*
|
56 |
-
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
57 |
-
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
58 |
-
* $commands = array( $cmd );
|
59 |
-
*
|
60 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
61 |
-
* $descriptor = $factory->createIntervalTriggerDescriptorBuilder()->startDate( date('c') )
|
62 |
-
* ->sendingTime( $sendingTime )->endDate( $endDate )->interval( $interval )
|
63 |
-
* ->attributeValueSetters( $commands )->build();
|
64 |
-
* </pre>
|
65 |
-
*
|
66 |
-
* The created trigger will fire every two weeks on Monday and Friday at 12:30 and will increase the Counter attribute.
|
67 |
-
* The trigger will be active from now on till the next year.
|
68 |
-
*
|
69 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createIntervalTriggerDescriptorBuilder()
|
70 |
-
* @since API 1.10.0
|
71 |
-
* @author chge, 17.07.2012
|
72 |
-
*/
|
73 |
-
interface Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder
|
74 |
-
extends Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
75 |
-
{
|
76 |
-
/**
|
77 |
-
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> used to define the dispatch intervals of
|
78 |
-
* an interval trigger mailing. This setting is mandatory.
|
79 |
-
*
|
80 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TriggerInterval interval the <i>TriggerInterval</i> used to define
|
81 |
-
* the dispatch intervals of an interval trigger mailing.
|
82 |
-
* @return Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder the builder.
|
83 |
-
* @throws Inx_Api_NullPointerException if the given interval is <i>null</i>.
|
84 |
-
*/
|
85 |
-
public function interval( Inx_Api_TriggerMailing_Descriptor_TriggerInterval $interval = null );
|
86 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder</i> is used to easily create interval
|
9 |
+
* triggers. The following settings are mandatory:
|
10 |
+
* <p>
|
11 |
+
* <ul>
|
12 |
+
* <li><b>The start date</b>: Defines the date at which the trigger will be fired for the first time.
|
13 |
+
* <li><b>The sending time</b>: Defines the time at which the trigger will be fired during each dispatch cycle.
|
14 |
+
* <li><b>The interval</b>: Defines the interval at which the trigger will be fired.
|
15 |
+
* </ul>
|
16 |
+
* <p>
|
17 |
+
* Using only these settings the easiest possible interval trigger descriptor can be built using the following
|
18 |
+
* statements:
|
19 |
+
*
|
20 |
+
* <pre>
|
21 |
+
* $intFactory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
22 |
+
* $intBuilder = $intFactory->getDailyIntervalBuilder();
|
23 |
+
* $intBuilder->intervalCount( 1 );
|
24 |
+
* $interval = $intBuilder->build();
|
25 |
+
* $sendingTime = date('c', mktime(12, 30));
|
26 |
+
*
|
27 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
28 |
+
* $builder = $factory->createIntervalTriggerDescriptorBuilder();
|
29 |
+
* $builder->startDate( date('c') );
|
30 |
+
* $builder->sendingTime( $sendingTime );
|
31 |
+
* $builder->interval( $interval );
|
32 |
+
* $descriptor = $builder->build();
|
33 |
+
* </pre>
|
34 |
+
* <p>
|
35 |
+
* There are also some optional settings which can be set:
|
36 |
+
* <p>
|
37 |
+
* <ul>
|
38 |
+
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
39 |
+
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
40 |
+
* trigger mailing.
|
41 |
+
* </ul>
|
42 |
+
* <p>
|
43 |
+
* Using all of these settings, the trigger descriptor could be built with the following statements:
|
44 |
+
*
|
45 |
+
* <pre>
|
46 |
+
* $intFactory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
47 |
+
* $interval = $intFactory->getWeeklyIntervalBuilder()->intervalCount( 2 )->dispatchIntervals(
|
48 |
+
* array(Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::MONDAY(),
|
49 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::FRIDAY() ) )->build();
|
50 |
+
*
|
51 |
+
* $rmd = $session->createRecipientContext()->getMetaData();
|
52 |
+
* $counterId = $rmd->getUserAttribute( "Counter" )->getId();
|
53 |
+
* $endDate = date('c', strtotime('+1 year'));
|
54 |
+
* $sendingTime = date('c', mktime(12, 30));
|
55 |
+
*
|
56 |
+
* $cmdFactory = $session->getActionManager()->getCommandFactory();
|
57 |
+
* $cmd = $cmdFactory->createSetRelativeValueCmd( $counterId, "1" );
|
58 |
+
* $commands = array( $cmd );
|
59 |
+
*
|
60 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerDescriptorBuilderFactory();
|
61 |
+
* $descriptor = $factory->createIntervalTriggerDescriptorBuilder()->startDate( date('c') )
|
62 |
+
* ->sendingTime( $sendingTime )->endDate( $endDate )->interval( $interval )
|
63 |
+
* ->attributeValueSetters( $commands )->build();
|
64 |
+
* </pre>
|
65 |
+
*
|
66 |
+
* The created trigger will fire every two weeks on Monday and Friday at 12:30 and will increase the Counter attribute.
|
67 |
+
* The trigger will be active from now on till the next year.
|
68 |
+
*
|
69 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory::createIntervalTriggerDescriptorBuilder()
|
70 |
+
* @since API 1.10.0
|
71 |
+
* @author chge, 17.07.2012
|
72 |
+
*/
|
73 |
+
interface Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder
|
74 |
+
extends Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
75 |
+
{
|
76 |
+
/**
|
77 |
+
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> used to define the dispatch intervals of
|
78 |
+
* an interval trigger mailing. This setting is mandatory.
|
79 |
+
*
|
80 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TriggerInterval interval the <i>TriggerInterval</i> used to define
|
81 |
+
* the dispatch intervals of an interval trigger mailing.
|
82 |
+
* @return Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder the builder.
|
83 |
+
* @throws Inx_Api_NullPointerException if the given interval is <i>null</i>.
|
84 |
+
*/
|
85 |
+
public function interval( Inx_Api_TriggerMailing_Descriptor_TriggerInterval $interval = null );
|
86 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/MonthlyTriggerIntervalBuilder.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder</i> is used to create a monthly trigger interval.
|
9 |
-
* The following settings are mandatory:
|
10 |
-
* <p/>
|
11 |
-
* <ul>
|
12 |
-
* <li><b>The interval count</b>: Specifies how many times the trigger will be fired. The trigger will be fired every X
|
13 |
-
* months where X is the interval count. Do not confuse this setting with the day setting.</li>
|
14 |
-
* <li><b>The day</b>: Specifies the day, at which the trigger will be fired.</li>
|
15 |
-
* <li><b>The dispatch interval</b>: Specifies the basis for the day attribute. The following options are allowed:
|
16 |
-
* <ul>
|
17 |
-
* <li><i>LAST_DAY_OF_MONTH</i>: The trigger will be fired on the last day of the month. In this case, the day setting
|
18 |
-
* must be omitted or set to zero.</li>
|
19 |
-
* <li><i>SPECIFIC_DAY_OF_MONTH</i>: The trigger will be fired on the day of month specified by the day setting.</li>
|
20 |
-
* <li><i>SPECIFIC_DAY_BEFORE_END_OF_MONTH</i>: The trigger will be fired on the specified day before the end of the
|
21 |
-
* month. For example, using the value 2 for the day setting will cause the trigger to be fired to days before the end
|
22 |
-
* of the current month.</li>
|
23 |
-
* </ul>
|
24 |
-
* </li>
|
25 |
-
* </ul>
|
26 |
-
* The day setting is only optional when using the dispatch interval LAST_DAY_OF_MONTH. There are no other optional
|
27 |
-
* settings.
|
28 |
-
* <p/>
|
29 |
-
* The following snippet shows how to build a monthly trigger interval which will fire the trigger every two months,
|
30 |
-
* three days before the end of the month:
|
31 |
-
*
|
32 |
-
* <pre>
|
33 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
34 |
-
* $interval = $factory->getMonthlyIntervalBuilder()->intervalCount( 2 )->day( 3 )->dispatchInterval(
|
35 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::SPECIFIC_DAY_BEFORE_END_OF_MONTH())
|
36 |
-
* ->build();
|
37 |
-
* </pre>
|
38 |
-
*
|
39 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
40 |
-
* @since API 1.10.0
|
41 |
-
* @author chge, 17.07.2012
|
42 |
-
*/
|
43 |
-
interface Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder
|
44 |
-
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
45 |
-
{
|
46 |
-
/**
|
47 |
-
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i> which determines the dispatch interval.
|
48 |
-
* This setting is mandatory. The following options are legal:
|
49 |
-
* <p/>
|
50 |
-
* <ul>
|
51 |
-
* <li><i>LAST_DAY_OF_MONTH</i>: The trigger will be fired on the last day of the month. In this case, the day
|
52 |
-
* setting must be omitted or set to zero.
|
53 |
-
* <li><i>SPECIFIC_DAY_OF_MONTH</i>: The trigger will be fired on the day of month specified by the day setting.
|
54 |
-
* <li><i>SPECIFIC_DAY_BEFORE_END_OF_MONTH</i>: The trigger will be fired on the specified day before the end of the
|
55 |
-
* month. For example, using the value 2 for the day setting will cause the trigger to be fired to days before the
|
56 |
-
* end of the current month.
|
57 |
-
* </ul>
|
58 |
-
*
|
59 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval $dispatchInterval the
|
60 |
-
* <i>TimeTriggerDispatchInterval</i>s which determines the dispatch interval.
|
61 |
-
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder the builder.
|
62 |
-
* @throws Inx_Api_IllegalArgumentException if the dispatch interval is not one of the values listed above.
|
63 |
-
*/
|
64 |
-
public function dispatchInterval( Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval $dispatchInterval );
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Returns the day of the dispatch interval. This setting is only optional if the dispatch interval is
|
69 |
-
* LAST_DAY_OF_MONTH. In this case, the day setting must be omitted or set to zero. Do not confuse this setting with
|
70 |
-
* the interval count setting as they are used for different purposes. For example, to fire the trigger every two
|
71 |
-
* months on the first day of the month, you need the following settings:
|
72 |
-
* <p/>
|
73 |
-
* <ul>
|
74 |
-
* <li><b>Interval count</b>: 2
|
75 |
-
* <li><b>Dispatch interval</b>: SPECIFIC_DAY_OF_MONTH
|
76 |
-
* <li><b>Day</b>: 1
|
77 |
-
* </ul>
|
78 |
-
* <p/>
|
79 |
-
* Only values between 1 and 28 inclusively are legal.
|
80 |
-
*
|
81 |
-
* @param int $iDay the day of the dispatch interval.
|
82 |
-
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder the builder.
|
83 |
-
* @throws Inx_Api_IllegalArgumentException if the value is smaller than 1 or bigger than 28.
|
84 |
-
*/
|
85 |
-
public function day( $iDay );
|
86 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder</i> is used to create a monthly trigger interval.
|
9 |
+
* The following settings are mandatory:
|
10 |
+
* <p/>
|
11 |
+
* <ul>
|
12 |
+
* <li><b>The interval count</b>: Specifies how many times the trigger will be fired. The trigger will be fired every X
|
13 |
+
* months where X is the interval count. Do not confuse this setting with the day setting.</li>
|
14 |
+
* <li><b>The day</b>: Specifies the day, at which the trigger will be fired.</li>
|
15 |
+
* <li><b>The dispatch interval</b>: Specifies the basis for the day attribute. The following options are allowed:
|
16 |
+
* <ul>
|
17 |
+
* <li><i>LAST_DAY_OF_MONTH</i>: The trigger will be fired on the last day of the month. In this case, the day setting
|
18 |
+
* must be omitted or set to zero.</li>
|
19 |
+
* <li><i>SPECIFIC_DAY_OF_MONTH</i>: The trigger will be fired on the day of month specified by the day setting.</li>
|
20 |
+
* <li><i>SPECIFIC_DAY_BEFORE_END_OF_MONTH</i>: The trigger will be fired on the specified day before the end of the
|
21 |
+
* month. For example, using the value 2 for the day setting will cause the trigger to be fired to days before the end
|
22 |
+
* of the current month.</li>
|
23 |
+
* </ul>
|
24 |
+
* </li>
|
25 |
+
* </ul>
|
26 |
+
* The day setting is only optional when using the dispatch interval LAST_DAY_OF_MONTH. There are no other optional
|
27 |
+
* settings.
|
28 |
+
* <p/>
|
29 |
+
* The following snippet shows how to build a monthly trigger interval which will fire the trigger every two months,
|
30 |
+
* three days before the end of the month:
|
31 |
+
*
|
32 |
+
* <pre>
|
33 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
34 |
+
* $interval = $factory->getMonthlyIntervalBuilder()->intervalCount( 2 )->day( 3 )->dispatchInterval(
|
35 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::SPECIFIC_DAY_BEFORE_END_OF_MONTH())
|
36 |
+
* ->build();
|
37 |
+
* </pre>
|
38 |
+
*
|
39 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
40 |
+
* @since API 1.10.0
|
41 |
+
* @author chge, 17.07.2012
|
42 |
+
*/
|
43 |
+
interface Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder
|
44 |
+
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
45 |
+
{
|
46 |
+
/**
|
47 |
+
* Sets the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i> which determines the dispatch interval.
|
48 |
+
* This setting is mandatory. The following options are legal:
|
49 |
+
* <p/>
|
50 |
+
* <ul>
|
51 |
+
* <li><i>LAST_DAY_OF_MONTH</i>: The trigger will be fired on the last day of the month. In this case, the day
|
52 |
+
* setting must be omitted or set to zero.
|
53 |
+
* <li><i>SPECIFIC_DAY_OF_MONTH</i>: The trigger will be fired on the day of month specified by the day setting.
|
54 |
+
* <li><i>SPECIFIC_DAY_BEFORE_END_OF_MONTH</i>: The trigger will be fired on the specified day before the end of the
|
55 |
+
* month. For example, using the value 2 for the day setting will cause the trigger to be fired to days before the
|
56 |
+
* end of the current month.
|
57 |
+
* </ul>
|
58 |
+
*
|
59 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval $dispatchInterval the
|
60 |
+
* <i>TimeTriggerDispatchInterval</i>s which determines the dispatch interval.
|
61 |
+
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder the builder.
|
62 |
+
* @throws Inx_Api_IllegalArgumentException if the dispatch interval is not one of the values listed above.
|
63 |
+
*/
|
64 |
+
public function dispatchInterval( Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval $dispatchInterval );
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Returns the day of the dispatch interval. This setting is only optional if the dispatch interval is
|
69 |
+
* LAST_DAY_OF_MONTH. In this case, the day setting must be omitted or set to zero. Do not confuse this setting with
|
70 |
+
* the interval count setting as they are used for different purposes. For example, to fire the trigger every two
|
71 |
+
* months on the first day of the month, you need the following settings:
|
72 |
+
* <p/>
|
73 |
+
* <ul>
|
74 |
+
* <li><b>Interval count</b>: 2
|
75 |
+
* <li><b>Dispatch interval</b>: SPECIFIC_DAY_OF_MONTH
|
76 |
+
* <li><b>Day</b>: 1
|
77 |
+
* </ul>
|
78 |
+
* <p/>
|
79 |
+
* Only values between 1 and 28 inclusively are legal.
|
80 |
+
*
|
81 |
+
* @param int $iDay the day of the dispatch interval.
|
82 |
+
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder the builder.
|
83 |
+
* @throws Inx_Api_IllegalArgumentException if the value is smaller than 1 or bigger than 28.
|
84 |
+
*/
|
85 |
+
public function day( $iDay );
|
86 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerDescriptorBuilder.php
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder</i> builder is used to easily create time triggers.
|
9 |
-
* There are only two mandatory settings: the start date and the sending time which identify the date and time at which the
|
10 |
-
* trigger will be fired for the first time.
|
11 |
-
* <p>
|
12 |
-
* The following settings are optional:
|
13 |
-
* <p>
|
14 |
-
* <ul>
|
15 |
-
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
16 |
-
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
17 |
-
* trigger mailing.
|
18 |
-
* </ul>
|
19 |
-
*
|
20 |
-
* @since API 1.10.0
|
21 |
-
* @author chge, 16.07.2012
|
22 |
-
*/
|
23 |
-
interface Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
24 |
-
extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Sets the date at which the trigger will be fired for the first time. This setting is mandatory. Be aware that the
|
28 |
-
* time component of the date will be disregarded. The sending time is specified separately by the <i>sendingTime</i>
|
29 |
-
* method. The time component of the specified date will be overwritten accordingly. Also, the seconds and milliseconds
|
30 |
-
* will be set to zero.
|
31 |
-
* <p>
|
32 |
-
* For example, consider the following two dates for start date and sending time:
|
33 |
-
* <ul>
|
34 |
-
* <li><b>Start date</b>: <i>2013-01-01T13:57:04+01:00</i>
|
35 |
-
* <li><b>Sending time</b>: <i>2012-07-05T12:30:42+01:00</i>
|
36 |
-
* </ul>
|
37 |
-
* The resulting start date for the trigger will be: <i>2013-01-01T12:30:00+01:00</i>
|
38 |
-
*
|
39 |
-
* @param string $sStartDate the date at which the trigger will be fired for the first time. The date has to be specified
|
40 |
-
* as ISO-8601 formatted date or datetime string.
|
41 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
42 |
-
* @throws Inx_Api_NullPointerException if the given start date is <i>null</i>.
|
43 |
-
*/
|
44 |
-
public function startDate( $sStartDate );
|
45 |
-
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Sets the time at which the sending will be started during each dispatch cycle. This setting is mandatory. Be
|
49 |
-
* aware that the date component of the given date object will be disregarded. Also, the seconds and milliseconds
|
50 |
-
* will be set to zero. This setting will overwrite the time component of the start and end dates when the
|
51 |
-
* <i>TriggerDescriptor</i> is built.
|
52 |
-
*
|
53 |
-
* @param string $sSendingTime the time at which the sending will be started during each dispatch cycle. The date
|
54 |
-
* has to be specified as ISO-8601 formatted time or datetime string.
|
55 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
56 |
-
* @throws Inx_Api_NullPointerException if the given sending time is <i>null</i>.
|
57 |
-
*/
|
58 |
-
public function sendingTime( $sSendingTime );
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Sets the date at which the trigger will be fired for the last time. This setting is optional. Be aware that the
|
63 |
-
* time component of the date will be disregarded. The sending time is specified separately by the <i>sendingTime</i>
|
64 |
-
* method. The time component of the specified date will be overwritten accordingly. Also, the seconds and milliseconds
|
65 |
-
* will be set to zero.
|
66 |
-
* <p>
|
67 |
-
* For example, consider the following two dates for end date and sending time:
|
68 |
-
* <ul>
|
69 |
-
* <li><b>End date</b>: <i>2015-01-01T13:57:04+01:00</i>
|
70 |
-
* <li><b>Sending time</b>: <i>2012-07-05T12:30:42+01:00</i>
|
71 |
-
* </ul>
|
72 |
-
* The resulting end date for the trigger will be: <i>2015-01-01T12:30:00+01:00</i>
|
73 |
-
*
|
74 |
-
* @param string $sEndDate the date at which the trigger will be fired for the last time. The date has to be specified
|
75 |
-
* as ISO-8601 formatted date or datetime string.
|
76 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
77 |
-
*/
|
78 |
-
public function endDate( $sEndDate );
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Sets an array of <i>Inx_Api_Action_SetValueCommand</i>s which will be executed when dispatching the trigger
|
83 |
-
* mailings. Using this feature, it is possible to set the values of recipient attributes along with the dispatching
|
84 |
-
* of a trigger mailing to that same recipient. This setting is optional.
|
85 |
-
*
|
86 |
-
* @param array $commands an array of <i>Inx_Api_Action_SetValueCommand</i>s used to set recipient attributes during
|
87 |
-
* dispatch.
|
88 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
89 |
-
*/
|
90 |
-
public function attributeValueSetters( array $commands = null );
|
91 |
-
}
|
92 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder</i> builder is used to easily create time triggers.
|
9 |
+
* There are only two mandatory settings: the start date and the sending time which identify the date and time at which the
|
10 |
+
* trigger will be fired for the first time.
|
11 |
+
* <p>
|
12 |
+
* The following settings are optional:
|
13 |
+
* <p>
|
14 |
+
* <ul>
|
15 |
+
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched for the last time.
|
16 |
+
* <li><b>The attribute value setters</b>: Can be used to set recipient attribute values along with the dispatch of the
|
17 |
+
* trigger mailing.
|
18 |
+
* </ul>
|
19 |
+
*
|
20 |
+
* @since API 1.10.0
|
21 |
+
* @author chge, 16.07.2012
|
22 |
+
*/
|
23 |
+
interface Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder
|
24 |
+
extends Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* Sets the date at which the trigger will be fired for the first time. This setting is mandatory. Be aware that the
|
28 |
+
* time component of the date will be disregarded. The sending time is specified separately by the <i>sendingTime</i>
|
29 |
+
* method. The time component of the specified date will be overwritten accordingly. Also, the seconds and milliseconds
|
30 |
+
* will be set to zero.
|
31 |
+
* <p>
|
32 |
+
* For example, consider the following two dates for start date and sending time:
|
33 |
+
* <ul>
|
34 |
+
* <li><b>Start date</b>: <i>2013-01-01T13:57:04+01:00</i>
|
35 |
+
* <li><b>Sending time</b>: <i>2012-07-05T12:30:42+01:00</i>
|
36 |
+
* </ul>
|
37 |
+
* The resulting start date for the trigger will be: <i>2013-01-01T12:30:00+01:00</i>
|
38 |
+
*
|
39 |
+
* @param string $sStartDate the date at which the trigger will be fired for the first time. The date has to be specified
|
40 |
+
* as ISO-8601 formatted date or datetime string.
|
41 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
42 |
+
* @throws Inx_Api_NullPointerException if the given start date is <i>null</i>.
|
43 |
+
*/
|
44 |
+
public function startDate( $sStartDate );
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Sets the time at which the sending will be started during each dispatch cycle. This setting is mandatory. Be
|
49 |
+
* aware that the date component of the given date object will be disregarded. Also, the seconds and milliseconds
|
50 |
+
* will be set to zero. This setting will overwrite the time component of the start and end dates when the
|
51 |
+
* <i>TriggerDescriptor</i> is built.
|
52 |
+
*
|
53 |
+
* @param string $sSendingTime the time at which the sending will be started during each dispatch cycle. The date
|
54 |
+
* has to be specified as ISO-8601 formatted time or datetime string.
|
55 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
56 |
+
* @throws Inx_Api_NullPointerException if the given sending time is <i>null</i>.
|
57 |
+
*/
|
58 |
+
public function sendingTime( $sSendingTime );
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Sets the date at which the trigger will be fired for the last time. This setting is optional. Be aware that the
|
63 |
+
* time component of the date will be disregarded. The sending time is specified separately by the <i>sendingTime</i>
|
64 |
+
* method. The time component of the specified date will be overwritten accordingly. Also, the seconds and milliseconds
|
65 |
+
* will be set to zero.
|
66 |
+
* <p>
|
67 |
+
* For example, consider the following two dates for end date and sending time:
|
68 |
+
* <ul>
|
69 |
+
* <li><b>End date</b>: <i>2015-01-01T13:57:04+01:00</i>
|
70 |
+
* <li><b>Sending time</b>: <i>2012-07-05T12:30:42+01:00</i>
|
71 |
+
* </ul>
|
72 |
+
* The resulting end date for the trigger will be: <i>2015-01-01T12:30:00+01:00</i>
|
73 |
+
*
|
74 |
+
* @param string $sEndDate the date at which the trigger will be fired for the last time. The date has to be specified
|
75 |
+
* as ISO-8601 formatted date or datetime string.
|
76 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
77 |
+
*/
|
78 |
+
public function endDate( $sEndDate );
|
79 |
+
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Sets an array of <i>Inx_Api_Action_SetValueCommand</i>s which will be executed when dispatching the trigger
|
83 |
+
* mailings. Using this feature, it is possible to set the values of recipient attributes along with the dispatching
|
84 |
+
* of a trigger mailing to that same recipient. This setting is optional.
|
85 |
+
*
|
86 |
+
* @param array $commands an array of <i>Inx_Api_Action_SetValueCommand</i>s used to set recipient attributes during
|
87 |
+
* dispatch.
|
88 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDescriptorBuilder the builder.
|
89 |
+
*/
|
90 |
+
public function attributeValueSetters( array $commands = null );
|
91 |
+
}
|
92 |
+
|
lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerDispatchInterval.php
CHANGED
@@ -1,284 +1,284 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i> enumeration defines the possible
|
9 |
-
* interval types of interval trigger mailings.
|
10 |
-
* <p>
|
11 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
12 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
13 |
-
* purpose similar to integer constants.
|
14 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
15 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
16 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
17 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
18 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
19 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
20 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
21 |
-
*
|
22 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval::getDispatchIntervals()
|
23 |
-
* @since API 1.10.0
|
24 |
-
* @author chge, 16.07.2012
|
25 |
-
*/
|
26 |
-
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval
|
27 |
-
{
|
28 |
-
private static $LAST_DAY_OF_MONTH = null;
|
29 |
-
|
30 |
-
private static $SPECIFIC_DAY_OF_MONTH = null;
|
31 |
-
|
32 |
-
private static $SPECIFIC_DAY_BEFORE_END_OF_MONTH = null;
|
33 |
-
|
34 |
-
private static $MONDAY = null;
|
35 |
-
|
36 |
-
private static $TUESDAY = null;
|
37 |
-
|
38 |
-
private static $WEDNESDAY = null;
|
39 |
-
|
40 |
-
private static $THURSDAY = null;
|
41 |
-
|
42 |
-
private static $FRIDAY = null;
|
43 |
-
|
44 |
-
private static $SATURDAY = null;
|
45 |
-
|
46 |
-
private static $SUNDAY = null;
|
47 |
-
|
48 |
-
private static $DAILY = null;
|
49 |
-
|
50 |
-
private static $HOURLY = null;
|
51 |
-
|
52 |
-
private static $UNKNOWN = null;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Dispatch interval for time triggers which fire on the last day of each month.
|
56 |
-
*
|
57 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the last day of month
|
58 |
-
* <i>TimeTriggerDispatchInterval</i>.
|
59 |
-
*/
|
60 |
-
public static final function LAST_DAY_OF_MONTH()
|
61 |
-
{
|
62 |
-
if(null === self::$LAST_DAY_OF_MONTH)
|
63 |
-
self::$LAST_DAY_OF_MONTH =
|
64 |
-
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 1 );
|
65 |
-
|
66 |
-
return self::$LAST_DAY_OF_MONTH;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Dispatch interval for time triggers which fire on a specific day of each month.
|
71 |
-
*
|
72 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the specific day of month
|
73 |
-
* <i>TimeTriggerDispatchInterval</i>.
|
74 |
-
*/
|
75 |
-
public static final function SPECIFIC_DAY_OF_MONTH()
|
76 |
-
{
|
77 |
-
if(null === self::$SPECIFIC_DAY_OF_MONTH)
|
78 |
-
self::$SPECIFIC_DAY_OF_MONTH=
|
79 |
-
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 2 );
|
80 |
-
|
81 |
-
return self::$SPECIFIC_DAY_OF_MONTH;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Dispatch interval for time triggers which fire on a specific day before the end of each month.
|
86 |
-
*
|
87 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the specific day before end of month
|
88 |
-
* <i>TimeTriggerDispatchInterval</i>.
|
89 |
-
*/
|
90 |
-
public static final function SPECIFIC_DAY_BEFORE_END_OF_MONTH()
|
91 |
-
{
|
92 |
-
if(null === self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH)
|
93 |
-
self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH =
|
94 |
-
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 3 );
|
95 |
-
|
96 |
-
return self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Dispatch interval for time triggers which fire on every Monday.
|
101 |
-
*
|
102 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the monday <i>TimeTriggerDispatchInterval</i>.
|
103 |
-
*/
|
104 |
-
public static final function MONDAY()
|
105 |
-
{
|
106 |
-
if(null === self::$MONDAY)
|
107 |
-
self::$MONDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 4 );
|
108 |
-
|
109 |
-
return self::$MONDAY;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Dispatch interval for time triggers which fire on every Tuesday.
|
114 |
-
*
|
115 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the tuesday <i>TimeTriggerDispatchInterval</i>.
|
116 |
-
*/
|
117 |
-
public static final function TUESDAY()
|
118 |
-
{
|
119 |
-
if(null === self::$TUESDAY)
|
120 |
-
self::$TUESDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 5 );
|
121 |
-
|
122 |
-
return self::$TUESDAY;
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Dispatch interval for time triggers which fire on every Wednesday.
|
127 |
-
*
|
128 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the wednesday <i>TimeTriggerDispatchInterval</i>.
|
129 |
-
*/
|
130 |
-
public static final function WEDNESDAY()
|
131 |
-
{
|
132 |
-
if(null === self::$WEDNESDAY)
|
133 |
-
self::$WEDNESDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 6 );
|
134 |
-
|
135 |
-
return self::$WEDNESDAY;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Dispatch interval for time triggers which fire on every Thursday.
|
140 |
-
*
|
141 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the thursday <i>TimeTriggerDispatchInterval</i>.
|
142 |
-
*/
|
143 |
-
public static final function THURSDAY()
|
144 |
-
{
|
145 |
-
if(null === self::$THURSDAY)
|
146 |
-
self::$THURSDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 7 );
|
147 |
-
|
148 |
-
return self::$THURSDAY;
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Dispatch interval for time triggers which fire on every Friday.
|
153 |
-
*
|
154 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the friday <i>TimeTriggerDispatchInterval</i>.
|
155 |
-
*/
|
156 |
-
public static final function FRIDAY()
|
157 |
-
{
|
158 |
-
if(null === self::$FRIDAY)
|
159 |
-
self::$FRIDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 8 );
|
160 |
-
|
161 |
-
return self::$FRIDAY;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Dispatch interval for time triggers which fire on every Saturday.
|
166 |
-
*
|
167 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the saturday <i>TimeTriggerDispatchInterval</i>.
|
168 |
-
*/
|
169 |
-
public static final function SATURDAY()
|
170 |
-
{
|
171 |
-
if(null === self::$SATURDAY)
|
172 |
-
self::$SATURDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 9 );
|
173 |
-
|
174 |
-
return self::$SATURDAY;
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Dispatch interval for time triggers which fire on every Sunday.
|
179 |
-
*
|
180 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the sunday <i>TimeTriggerDispatchInterval</i>.
|
181 |
-
*/
|
182 |
-
public static final function SUNDAY()
|
183 |
-
{
|
184 |
-
if(null === self::$SUNDAY)
|
185 |
-
self::$SUNDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 10 );
|
186 |
-
|
187 |
-
return self::$SUNDAY;
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Dispatch interval for time triggers which fire on a daily basis.
|
192 |
-
*
|
193 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the daily <i>TimeTriggerDispatchInterval</i>.
|
194 |
-
*/
|
195 |
-
public static final function DAILY()
|
196 |
-
{
|
197 |
-
if(null === self::$DAILY)
|
198 |
-
self::$DAILY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 11 );
|
199 |
-
|
200 |
-
return self::$DAILY;
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Dispatch interval for time triggers which fire on a hourly basis.
|
205 |
-
*
|
206 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the hourly <i>TimeTriggerDispatchInterval</i>.
|
207 |
-
*/
|
208 |
-
public static final function HOURLY()
|
209 |
-
{
|
210 |
-
if(null === self::$HOURLY)
|
211 |
-
self::$HOURLY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 12 );
|
212 |
-
|
213 |
-
return self::$HOURLY;
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Unknown dispatch interval. Indicates a version mismatch between API and server.
|
218 |
-
*
|
219 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the unknown <i>TimeTriggerDispatchInterval</i>.
|
220 |
-
*/
|
221 |
-
public static final function UNKNOWN()
|
222 |
-
{
|
223 |
-
if(null === self::$UNKNOWN)
|
224 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( -1 );
|
225 |
-
|
226 |
-
return self::$UNKNOWN;
|
227 |
-
}
|
228 |
-
|
229 |
-
private $id;
|
230 |
-
|
231 |
-
|
232 |
-
private function __construct( $iId )
|
233 |
-
{
|
234 |
-
$this->id = $iId;
|
235 |
-
}
|
236 |
-
|
237 |
-
|
238 |
-
/**
|
239 |
-
* Returns the ID of the <i>TimeTriggerDispatchInterval</i>. The ID is used for transmission purposes and
|
240 |
-
* should not be used inside client code.
|
241 |
-
*
|
242 |
-
* @return int the ID of the <i>TimeTriggerDispatchInterval</i>.
|
243 |
-
*/
|
244 |
-
public function getId()
|
245 |
-
{
|
246 |
-
return $this->id;
|
247 |
-
}
|
248 |
-
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Returns the <i>TimeTriggerDispatchInterval</i> corresponding to the given ID. If the ID is unknown, the
|
252 |
-
* UNKNOWN interval will be used. The ID is used for transmission purposes and should not be used inside client
|
253 |
-
* code.
|
254 |
-
*
|
255 |
-
* @param int $iId the ID of the <i>TimeTriggerDispatchInterval</i> to retrieve.
|
256 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the <i>TimeTriggerDispatchInterval</i>
|
257 |
-
* corresponding to the given ID.
|
258 |
-
*/
|
259 |
-
public static function byId( $iId )
|
260 |
-
{
|
261 |
-
foreach( self::values() as $interval )
|
262 |
-
{
|
263 |
-
if( $interval->getId() == $iId )
|
264 |
-
{
|
265 |
-
return $interval;
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
return self::UNKNOWN();
|
270 |
-
}
|
271 |
-
|
272 |
-
/**
|
273 |
-
* Returns an array containing all available <i>TimeTriggerDispatchInterval</i>s including UNKNOWN.
|
274 |
-
*
|
275 |
-
* @return array an array containing all available <i>TimeTriggerDispatchInterval</i>s including UNKNOWN.
|
276 |
-
*/
|
277 |
-
public static function values()
|
278 |
-
{
|
279 |
-
return array(self::LAST_DAY_OF_MONTH(), self::SPECIFIC_DAY_OF_MONTH(), self::SPECIFIC_DAY_BEFORE_END_OF_MONTH(),
|
280 |
-
self::MONDAY(), self::TUESDAY(), self::WEDNESDAY(), self::THURSDAY(), self::FRIDAY(), self::SATURDAY(),
|
281 |
-
self::SUNDAY(), self::DAILY(), self::HOURLY(), self::UNKNOWN());
|
282 |
-
}
|
283 |
-
}
|
284 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i> enumeration defines the possible
|
9 |
+
* interval types of interval trigger mailings.
|
10 |
+
* <p>
|
11 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
12 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
13 |
+
* purpose similar to integer constants.
|
14 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
15 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
16 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
17 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
18 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
19 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
20 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
21 |
+
*
|
22 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval::getDispatchIntervals()
|
23 |
+
* @since API 1.10.0
|
24 |
+
* @author chge, 16.07.2012
|
25 |
+
*/
|
26 |
+
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval
|
27 |
+
{
|
28 |
+
private static $LAST_DAY_OF_MONTH = null;
|
29 |
+
|
30 |
+
private static $SPECIFIC_DAY_OF_MONTH = null;
|
31 |
+
|
32 |
+
private static $SPECIFIC_DAY_BEFORE_END_OF_MONTH = null;
|
33 |
+
|
34 |
+
private static $MONDAY = null;
|
35 |
+
|
36 |
+
private static $TUESDAY = null;
|
37 |
+
|
38 |
+
private static $WEDNESDAY = null;
|
39 |
+
|
40 |
+
private static $THURSDAY = null;
|
41 |
+
|
42 |
+
private static $FRIDAY = null;
|
43 |
+
|
44 |
+
private static $SATURDAY = null;
|
45 |
+
|
46 |
+
private static $SUNDAY = null;
|
47 |
+
|
48 |
+
private static $DAILY = null;
|
49 |
+
|
50 |
+
private static $HOURLY = null;
|
51 |
+
|
52 |
+
private static $UNKNOWN = null;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Dispatch interval for time triggers which fire on the last day of each month.
|
56 |
+
*
|
57 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the last day of month
|
58 |
+
* <i>TimeTriggerDispatchInterval</i>.
|
59 |
+
*/
|
60 |
+
public static final function LAST_DAY_OF_MONTH()
|
61 |
+
{
|
62 |
+
if(null === self::$LAST_DAY_OF_MONTH)
|
63 |
+
self::$LAST_DAY_OF_MONTH =
|
64 |
+
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 1 );
|
65 |
+
|
66 |
+
return self::$LAST_DAY_OF_MONTH;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Dispatch interval for time triggers which fire on a specific day of each month.
|
71 |
+
*
|
72 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the specific day of month
|
73 |
+
* <i>TimeTriggerDispatchInterval</i>.
|
74 |
+
*/
|
75 |
+
public static final function SPECIFIC_DAY_OF_MONTH()
|
76 |
+
{
|
77 |
+
if(null === self::$SPECIFIC_DAY_OF_MONTH)
|
78 |
+
self::$SPECIFIC_DAY_OF_MONTH=
|
79 |
+
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 2 );
|
80 |
+
|
81 |
+
return self::$SPECIFIC_DAY_OF_MONTH;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Dispatch interval for time triggers which fire on a specific day before the end of each month.
|
86 |
+
*
|
87 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the specific day before end of month
|
88 |
+
* <i>TimeTriggerDispatchInterval</i>.
|
89 |
+
*/
|
90 |
+
public static final function SPECIFIC_DAY_BEFORE_END_OF_MONTH()
|
91 |
+
{
|
92 |
+
if(null === self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH)
|
93 |
+
self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH =
|
94 |
+
new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 3 );
|
95 |
+
|
96 |
+
return self::$SPECIFIC_DAY_BEFORE_END_OF_MONTH;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Dispatch interval for time triggers which fire on every Monday.
|
101 |
+
*
|
102 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the monday <i>TimeTriggerDispatchInterval</i>.
|
103 |
+
*/
|
104 |
+
public static final function MONDAY()
|
105 |
+
{
|
106 |
+
if(null === self::$MONDAY)
|
107 |
+
self::$MONDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 4 );
|
108 |
+
|
109 |
+
return self::$MONDAY;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Dispatch interval for time triggers which fire on every Tuesday.
|
114 |
+
*
|
115 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the tuesday <i>TimeTriggerDispatchInterval</i>.
|
116 |
+
*/
|
117 |
+
public static final function TUESDAY()
|
118 |
+
{
|
119 |
+
if(null === self::$TUESDAY)
|
120 |
+
self::$TUESDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 5 );
|
121 |
+
|
122 |
+
return self::$TUESDAY;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Dispatch interval for time triggers which fire on every Wednesday.
|
127 |
+
*
|
128 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the wednesday <i>TimeTriggerDispatchInterval</i>.
|
129 |
+
*/
|
130 |
+
public static final function WEDNESDAY()
|
131 |
+
{
|
132 |
+
if(null === self::$WEDNESDAY)
|
133 |
+
self::$WEDNESDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 6 );
|
134 |
+
|
135 |
+
return self::$WEDNESDAY;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Dispatch interval for time triggers which fire on every Thursday.
|
140 |
+
*
|
141 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the thursday <i>TimeTriggerDispatchInterval</i>.
|
142 |
+
*/
|
143 |
+
public static final function THURSDAY()
|
144 |
+
{
|
145 |
+
if(null === self::$THURSDAY)
|
146 |
+
self::$THURSDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 7 );
|
147 |
+
|
148 |
+
return self::$THURSDAY;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Dispatch interval for time triggers which fire on every Friday.
|
153 |
+
*
|
154 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the friday <i>TimeTriggerDispatchInterval</i>.
|
155 |
+
*/
|
156 |
+
public static final function FRIDAY()
|
157 |
+
{
|
158 |
+
if(null === self::$FRIDAY)
|
159 |
+
self::$FRIDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 8 );
|
160 |
+
|
161 |
+
return self::$FRIDAY;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Dispatch interval for time triggers which fire on every Saturday.
|
166 |
+
*
|
167 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the saturday <i>TimeTriggerDispatchInterval</i>.
|
168 |
+
*/
|
169 |
+
public static final function SATURDAY()
|
170 |
+
{
|
171 |
+
if(null === self::$SATURDAY)
|
172 |
+
self::$SATURDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 9 );
|
173 |
+
|
174 |
+
return self::$SATURDAY;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Dispatch interval for time triggers which fire on every Sunday.
|
179 |
+
*
|
180 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the sunday <i>TimeTriggerDispatchInterval</i>.
|
181 |
+
*/
|
182 |
+
public static final function SUNDAY()
|
183 |
+
{
|
184 |
+
if(null === self::$SUNDAY)
|
185 |
+
self::$SUNDAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 10 );
|
186 |
+
|
187 |
+
return self::$SUNDAY;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Dispatch interval for time triggers which fire on a daily basis.
|
192 |
+
*
|
193 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the daily <i>TimeTriggerDispatchInterval</i>.
|
194 |
+
*/
|
195 |
+
public static final function DAILY()
|
196 |
+
{
|
197 |
+
if(null === self::$DAILY)
|
198 |
+
self::$DAILY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 11 );
|
199 |
+
|
200 |
+
return self::$DAILY;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Dispatch interval for time triggers which fire on a hourly basis.
|
205 |
+
*
|
206 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the hourly <i>TimeTriggerDispatchInterval</i>.
|
207 |
+
*/
|
208 |
+
public static final function HOURLY()
|
209 |
+
{
|
210 |
+
if(null === self::$HOURLY)
|
211 |
+
self::$HOURLY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( 12 );
|
212 |
+
|
213 |
+
return self::$HOURLY;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Unknown dispatch interval. Indicates a version mismatch between API and server.
|
218 |
+
*
|
219 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the unknown <i>TimeTriggerDispatchInterval</i>.
|
220 |
+
*/
|
221 |
+
public static final function UNKNOWN()
|
222 |
+
{
|
223 |
+
if(null === self::$UNKNOWN)
|
224 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval( -1 );
|
225 |
+
|
226 |
+
return self::$UNKNOWN;
|
227 |
+
}
|
228 |
+
|
229 |
+
private $id;
|
230 |
+
|
231 |
+
|
232 |
+
private function __construct( $iId )
|
233 |
+
{
|
234 |
+
$this->id = $iId;
|
235 |
+
}
|
236 |
+
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Returns the ID of the <i>TimeTriggerDispatchInterval</i>. The ID is used for transmission purposes and
|
240 |
+
* should not be used inside client code.
|
241 |
+
*
|
242 |
+
* @return int the ID of the <i>TimeTriggerDispatchInterval</i>.
|
243 |
+
*/
|
244 |
+
public function getId()
|
245 |
+
{
|
246 |
+
return $this->id;
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Returns the <i>TimeTriggerDispatchInterval</i> corresponding to the given ID. If the ID is unknown, the
|
252 |
+
* UNKNOWN interval will be used. The ID is used for transmission purposes and should not be used inside client
|
253 |
+
* code.
|
254 |
+
*
|
255 |
+
* @param int $iId the ID of the <i>TimeTriggerDispatchInterval</i> to retrieve.
|
256 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval the <i>TimeTriggerDispatchInterval</i>
|
257 |
+
* corresponding to the given ID.
|
258 |
+
*/
|
259 |
+
public static function byId( $iId )
|
260 |
+
{
|
261 |
+
foreach( self::values() as $interval )
|
262 |
+
{
|
263 |
+
if( $interval->getId() == $iId )
|
264 |
+
{
|
265 |
+
return $interval;
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
return self::UNKNOWN();
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Returns an array containing all available <i>TimeTriggerDispatchInterval</i>s including UNKNOWN.
|
274 |
+
*
|
275 |
+
* @return array an array containing all available <i>TimeTriggerDispatchInterval</i>s including UNKNOWN.
|
276 |
+
*/
|
277 |
+
public static function values()
|
278 |
+
{
|
279 |
+
return array(self::LAST_DAY_OF_MONTH(), self::SPECIFIC_DAY_OF_MONTH(), self::SPECIFIC_DAY_BEFORE_END_OF_MONTH(),
|
280 |
+
self::MONDAY(), self::TUESDAY(), self::WEDNESDAY(), self::THURSDAY(), self::FRIDAY(), self::SATURDAY(),
|
281 |
+
self::SUNDAY(), self::DAILY(), self::HOURLY(), self::UNKNOWN());
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerOffset.php
CHANGED
@@ -1,133 +1,133 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> is used to adjust the dispatch date of an
|
9 |
-
* attribute driven time trigger mailing. A <i>TimeTriggerOffset</i> consists of three parts:
|
10 |
-
* <ol>
|
11 |
-
* <li><b>The offset type</b>: Defines whether the offset is positive or negative.
|
12 |
-
* <li><b>The offset unit</b>: Defines the unit of the offset (e.g. day, week, month,...).
|
13 |
-
* <li><b>The offset value</b>: Defines the actual offset.
|
14 |
-
* </ol>
|
15 |
-
* <p>
|
16 |
-
* The following snippet shows how to create a tomorrow offset:
|
17 |
-
*
|
18 |
-
* <pre>
|
19 |
-
* $tomorrow = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
20 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
21 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1 );
|
22 |
-
* </pre>
|
23 |
-
*
|
24 |
-
* @since API 1.10.0
|
25 |
-
* @author chge, 16.07.2012
|
26 |
-
*/
|
27 |
-
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset
|
28 |
-
{
|
29 |
-
private $type;
|
30 |
-
|
31 |
-
private $unit;
|
32 |
-
|
33 |
-
private $value;
|
34 |
-
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Creates a new offset with the given type, unit and offset value. The value may not be negative.
|
38 |
-
* If all parameters are omitted, creates an offset which represents "now".
|
39 |
-
*
|
40 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType $type the offset type.
|
41 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit $unit the offset unit.
|
42 |
-
* @param int $iValue the actual offset value. May not be negative.
|
43 |
-
* @throws Inx_Api_IllegalArgumentException if the value is negative.
|
44 |
-
*/
|
45 |
-
public function __construct(Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType $type = null,
|
46 |
-
Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit $unit = null, $iValue = null)
|
47 |
-
{
|
48 |
-
if(null !== $iValue && $iValue < 0)
|
49 |
-
throw new Inx_Api_IllegalArgumentException( "value may not be negative" );
|
50 |
-
|
51 |
-
$this->type = (null === $type) ? Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN() : $type;
|
52 |
-
$this->unit = (null === $unit) ? Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY() : $unit;
|
53 |
-
$this->value = (null === $iValue) ? 0 : $iValue;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Returns the offset type.
|
59 |
-
*
|
60 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the offset type.
|
61 |
-
*/
|
62 |
-
public function getType()
|
63 |
-
{
|
64 |
-
return $this->type;
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Returns the offset unit.
|
70 |
-
*
|
71 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the offset unit.
|
72 |
-
*/
|
73 |
-
public function getUnit()
|
74 |
-
{
|
75 |
-
return $this->unit;
|
76 |
-
}
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Returns the actual offset value.
|
81 |
-
*
|
82 |
-
* @return int the offset value.
|
83 |
-
*/
|
84 |
-
public function getValue()
|
85 |
-
{
|
86 |
-
return $this->value;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Compares this <i>TimeTriggerOffset</i> and the given object for equality. The two objects are considered
|
92 |
-
* equal if they are the same or are both <i>TimeTriggerOffset</i>s of the same type with the same unit and
|
93 |
-
* value.
|
94 |
-
*
|
95 |
-
* @param mixed $obj the object to be compared to this <i>TimeTriggerOffset</i> for equality.
|
96 |
-
* @return bool <i>true</i> if the the given object is equal to this <i>TimeTriggerOffset</i>, <i>false</i>
|
97 |
-
* otherwise.
|
98 |
-
*/
|
99 |
-
public function equals( $obj )
|
100 |
-
{
|
101 |
-
if( $this === $obj )
|
102 |
-
{
|
103 |
-
return true;
|
104 |
-
}
|
105 |
-
|
106 |
-
if( null === $obj )
|
107 |
-
{
|
108 |
-
return false;
|
109 |
-
}
|
110 |
-
|
111 |
-
if(gettype($this) !== gettype($obj) )
|
112 |
-
{
|
113 |
-
return false;
|
114 |
-
}
|
115 |
-
|
116 |
-
if( $this->type !== $obj->getType() )
|
117 |
-
{
|
118 |
-
return false;
|
119 |
-
}
|
120 |
-
|
121 |
-
if( $this->unit !== $obj->getUnit() )
|
122 |
-
{
|
123 |
-
return false;
|
124 |
-
}
|
125 |
-
|
126 |
-
if( $this->value !== $obj->getValue() )
|
127 |
-
{
|
128 |
-
return false;
|
129 |
-
}
|
130 |
-
|
131 |
-
return true;
|
132 |
-
}
|
133 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> is used to adjust the dispatch date of an
|
9 |
+
* attribute driven time trigger mailing. A <i>TimeTriggerOffset</i> consists of three parts:
|
10 |
+
* <ol>
|
11 |
+
* <li><b>The offset type</b>: Defines whether the offset is positive or negative.
|
12 |
+
* <li><b>The offset unit</b>: Defines the unit of the offset (e.g. day, week, month,...).
|
13 |
+
* <li><b>The offset value</b>: Defines the actual offset.
|
14 |
+
* </ol>
|
15 |
+
* <p>
|
16 |
+
* The following snippet shows how to create a tomorrow offset:
|
17 |
+
*
|
18 |
+
* <pre>
|
19 |
+
* $tomorrow = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
20 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN(),
|
21 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY(), 1 );
|
22 |
+
* </pre>
|
23 |
+
*
|
24 |
+
* @since API 1.10.0
|
25 |
+
* @author chge, 16.07.2012
|
26 |
+
*/
|
27 |
+
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset
|
28 |
+
{
|
29 |
+
private $type;
|
30 |
+
|
31 |
+
private $unit;
|
32 |
+
|
33 |
+
private $value;
|
34 |
+
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Creates a new offset with the given type, unit and offset value. The value may not be negative.
|
38 |
+
* If all parameters are omitted, creates an offset which represents "now".
|
39 |
+
*
|
40 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType $type the offset type.
|
41 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit $unit the offset unit.
|
42 |
+
* @param int $iValue the actual offset value. May not be negative.
|
43 |
+
* @throws Inx_Api_IllegalArgumentException if the value is negative.
|
44 |
+
*/
|
45 |
+
public function __construct(Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType $type = null,
|
46 |
+
Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit $unit = null, $iValue = null)
|
47 |
+
{
|
48 |
+
if(null !== $iValue && $iValue < 0)
|
49 |
+
throw new Inx_Api_IllegalArgumentException( "value may not be negative" );
|
50 |
+
|
51 |
+
$this->type = (null === $type) ? Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::IS_IN() : $type;
|
52 |
+
$this->unit = (null === $unit) ? Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::DAY() : $unit;
|
53 |
+
$this->value = (null === $iValue) ? 0 : $iValue;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns the offset type.
|
59 |
+
*
|
60 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the offset type.
|
61 |
+
*/
|
62 |
+
public function getType()
|
63 |
+
{
|
64 |
+
return $this->type;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Returns the offset unit.
|
70 |
+
*
|
71 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the offset unit.
|
72 |
+
*/
|
73 |
+
public function getUnit()
|
74 |
+
{
|
75 |
+
return $this->unit;
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Returns the actual offset value.
|
81 |
+
*
|
82 |
+
* @return int the offset value.
|
83 |
+
*/
|
84 |
+
public function getValue()
|
85 |
+
{
|
86 |
+
return $this->value;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Compares this <i>TimeTriggerOffset</i> and the given object for equality. The two objects are considered
|
92 |
+
* equal if they are the same or are both <i>TimeTriggerOffset</i>s of the same type with the same unit and
|
93 |
+
* value.
|
94 |
+
*
|
95 |
+
* @param mixed $obj the object to be compared to this <i>TimeTriggerOffset</i> for equality.
|
96 |
+
* @return bool <i>true</i> if the the given object is equal to this <i>TimeTriggerOffset</i>, <i>false</i>
|
97 |
+
* otherwise.
|
98 |
+
*/
|
99 |
+
public function equals( $obj )
|
100 |
+
{
|
101 |
+
if( $this === $obj )
|
102 |
+
{
|
103 |
+
return true;
|
104 |
+
}
|
105 |
+
|
106 |
+
if( null === $obj )
|
107 |
+
{
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
|
111 |
+
if(gettype($this) !== gettype($obj) )
|
112 |
+
{
|
113 |
+
return false;
|
114 |
+
}
|
115 |
+
|
116 |
+
if( $this->type !== $obj->getType() )
|
117 |
+
{
|
118 |
+
return false;
|
119 |
+
}
|
120 |
+
|
121 |
+
if( $this->unit !== $obj->getUnit() )
|
122 |
+
{
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
if( $this->value !== $obj->getValue() )
|
127 |
+
{
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
return true;
|
132 |
+
}
|
133 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerOffsetType.php
CHANGED
@@ -1,119 +1,119 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType</i> defines the possible types of
|
4 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i>s.
|
5 |
-
* <p>
|
6 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
7 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
8 |
-
* purpose similar to integer constants.
|
9 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
10 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
11 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
12 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
13 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
14 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
15 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
16 |
-
*
|
17 |
-
* @since API 1.10.0
|
18 |
-
* @author chge, 16.07.2012
|
19 |
-
*/
|
20 |
-
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType
|
21 |
-
{
|
22 |
-
private static $IS_IN = null;
|
23 |
-
|
24 |
-
private static $WAS_AGO = null;
|
25 |
-
|
26 |
-
private static $UNKNOWN = null;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Constant for positive offsets.
|
30 |
-
*
|
31 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the is in <i>TimeTriggerOffsetType</i>.
|
32 |
-
*/
|
33 |
-
public static final function IS_IN()
|
34 |
-
{
|
35 |
-
if(null === self::$IS_IN)
|
36 |
-
self::$IS_IN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( 1 );
|
37 |
-
|
38 |
-
return self::$IS_IN;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Constant for negative offsets.
|
43 |
-
*
|
44 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the was ago <i>TimeTriggerOffsetType</i>.
|
45 |
-
*/
|
46 |
-
public static final function WAS_AGO()
|
47 |
-
{
|
48 |
-
if(null === self::$WAS_AGO)
|
49 |
-
self::$WAS_AGO = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( 2 );
|
50 |
-
|
51 |
-
return self::$WAS_AGO;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Constant for an unknown offset type. Indicates a version mismatch between API and server.
|
56 |
-
*
|
57 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the unknown <i>TimeTriggerOffsetType</i>.
|
58 |
-
*/
|
59 |
-
public static final function UNKNOWN()
|
60 |
-
{
|
61 |
-
if(null === self::$UNKNOWN)
|
62 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( -1 );
|
63 |
-
|
64 |
-
return self::$UNKNOWN;
|
65 |
-
}
|
66 |
-
|
67 |
-
private $id;
|
68 |
-
|
69 |
-
|
70 |
-
private function __construct( $iId )
|
71 |
-
{
|
72 |
-
$this->id = $iId;
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Returns the ID of the <i>TimeTriggerOffsetType</i>. The ID is used for transmission purposes and should
|
78 |
-
* not be used inside client code.
|
79 |
-
*
|
80 |
-
* @return int the ID of the <i>TimeTriggerOffsetType</i>.
|
81 |
-
*/
|
82 |
-
public function getId()
|
83 |
-
{
|
84 |
-
return $this->id;
|
85 |
-
}
|
86 |
-
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Returns the <i>TimeTriggerOffsetType</i> corresponding to the given ID. If the ID is unknown, the
|
90 |
-
* UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client
|
91 |
-
* code.
|
92 |
-
*
|
93 |
-
* @param int $iId the ID of the <i>TimeTriggerOffsetType</i> to retrieve.
|
94 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the <i>TimeTriggerOffsetType</i> corresponding
|
95 |
-
* to the given ID.
|
96 |
-
*/
|
97 |
-
public static function byId( $iId )
|
98 |
-
{
|
99 |
-
foreach( self::values() as $type )
|
100 |
-
{
|
101 |
-
if( $type->getId() == $iId )
|
102 |
-
{
|
103 |
-
return $type;
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
return self::UNKNOWN();
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Returns an array containing all available <i>TimeTriggerOffsetType</i>s including UNKNOWN.
|
112 |
-
*
|
113 |
-
* @return array an array containing all available <i>TimeTriggerOffsetType</i>s including UNKNOWN.
|
114 |
-
*/
|
115 |
-
public static function values()
|
116 |
-
{
|
117 |
-
return array(self::IS_IN(), self::WAS_AGO(), self::UNKNOWN());
|
118 |
-
}
|
119 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType</i> defines the possible types of
|
4 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i>s.
|
5 |
+
* <p>
|
6 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
7 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
8 |
+
* purpose similar to integer constants.
|
9 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
10 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
11 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
12 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
13 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
14 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
15 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
16 |
+
*
|
17 |
+
* @since API 1.10.0
|
18 |
+
* @author chge, 16.07.2012
|
19 |
+
*/
|
20 |
+
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType
|
21 |
+
{
|
22 |
+
private static $IS_IN = null;
|
23 |
+
|
24 |
+
private static $WAS_AGO = null;
|
25 |
+
|
26 |
+
private static $UNKNOWN = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constant for positive offsets.
|
30 |
+
*
|
31 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the is in <i>TimeTriggerOffsetType</i>.
|
32 |
+
*/
|
33 |
+
public static final function IS_IN()
|
34 |
+
{
|
35 |
+
if(null === self::$IS_IN)
|
36 |
+
self::$IS_IN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( 1 );
|
37 |
+
|
38 |
+
return self::$IS_IN;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Constant for negative offsets.
|
43 |
+
*
|
44 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the was ago <i>TimeTriggerOffsetType</i>.
|
45 |
+
*/
|
46 |
+
public static final function WAS_AGO()
|
47 |
+
{
|
48 |
+
if(null === self::$WAS_AGO)
|
49 |
+
self::$WAS_AGO = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( 2 );
|
50 |
+
|
51 |
+
return self::$WAS_AGO;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Constant for an unknown offset type. Indicates a version mismatch between API and server.
|
56 |
+
*
|
57 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the unknown <i>TimeTriggerOffsetType</i>.
|
58 |
+
*/
|
59 |
+
public static final function UNKNOWN()
|
60 |
+
{
|
61 |
+
if(null === self::$UNKNOWN)
|
62 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType( -1 );
|
63 |
+
|
64 |
+
return self::$UNKNOWN;
|
65 |
+
}
|
66 |
+
|
67 |
+
private $id;
|
68 |
+
|
69 |
+
|
70 |
+
private function __construct( $iId )
|
71 |
+
{
|
72 |
+
$this->id = $iId;
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Returns the ID of the <i>TimeTriggerOffsetType</i>. The ID is used for transmission purposes and should
|
78 |
+
* not be used inside client code.
|
79 |
+
*
|
80 |
+
* @return int the ID of the <i>TimeTriggerOffsetType</i>.
|
81 |
+
*/
|
82 |
+
public function getId()
|
83 |
+
{
|
84 |
+
return $this->id;
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Returns the <i>TimeTriggerOffsetType</i> corresponding to the given ID. If the ID is unknown, the
|
90 |
+
* UNKNOWN type will be used. The ID is used for transmission purposes and should not be used inside client
|
91 |
+
* code.
|
92 |
+
*
|
93 |
+
* @param int $iId the ID of the <i>TimeTriggerOffsetType</i> to retrieve.
|
94 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType the <i>TimeTriggerOffsetType</i> corresponding
|
95 |
+
* to the given ID.
|
96 |
+
*/
|
97 |
+
public static function byId( $iId )
|
98 |
+
{
|
99 |
+
foreach( self::values() as $type )
|
100 |
+
{
|
101 |
+
if( $type->getId() == $iId )
|
102 |
+
{
|
103 |
+
return $type;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
return self::UNKNOWN();
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Returns an array containing all available <i>TimeTriggerOffsetType</i>s including UNKNOWN.
|
112 |
+
*
|
113 |
+
* @return array an array containing all available <i>TimeTriggerOffsetType</i>s including UNKNOWN.
|
114 |
+
*/
|
115 |
+
public static function values()
|
116 |
+
{
|
117 |
+
return array(self::IS_IN(), self::WAS_AGO(), self::UNKNOWN());
|
118 |
+
}
|
119 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TimeTriggerUnit.php
CHANGED
@@ -1,199 +1,199 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit</i> enumeration defines the time units which can be used
|
9 |
-
* with time triggers, including the minimum and maximum values. The <i>TimeTriggerUnit</i> is used in various aspects
|
10 |
-
* of time triggers, for example in offsets and intervals.
|
11 |
-
* <p>
|
12 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
13 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
14 |
-
* purpose similar to integer constants.
|
15 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
16 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
17 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
18 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
19 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
20 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
21 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
22 |
-
*
|
23 |
-
* @since API 1.10.0
|
24 |
-
* @author chge, 16.07.2012
|
25 |
-
*/
|
26 |
-
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit
|
27 |
-
{
|
28 |
-
private static $DAY = null;
|
29 |
-
|
30 |
-
private static $MONTH = null;
|
31 |
-
|
32 |
-
private static $YEAR = null;
|
33 |
-
|
34 |
-
private static $WEEK = null;
|
35 |
-
|
36 |
-
private static $HOUR = null;
|
37 |
-
|
38 |
-
private static $UNKNOWN = null;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Time unit for daily fired time triggers and offsets. The values may range from 1 to 364 inclusively.
|
42 |
-
*
|
43 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the day <i>TimeTriggerUnit</i>.
|
44 |
-
*/
|
45 |
-
public static final function DAY()
|
46 |
-
{
|
47 |
-
if(null === self::$DAY)
|
48 |
-
self::$DAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 1, 1, 364 );
|
49 |
-
|
50 |
-
return self::$DAY;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Time unit for monthly fired time triggers and offsets. The values may range from 1 to 12 inclusively.
|
55 |
-
*
|
56 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the month <i>TimeTriggerUnit</i>.
|
57 |
-
*/
|
58 |
-
public static final function MONTH()
|
59 |
-
{
|
60 |
-
if(null === self::$MONTH)
|
61 |
-
self::$MONTH = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 2, 1, 12 );
|
62 |
-
|
63 |
-
return self::$MONTH;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Time unit for yearly fired time triggers and offsets. The values may range from 1 to 100 inclusively.
|
68 |
-
*
|
69 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the year <i>TimeTriggerUnit</i>.
|
70 |
-
*/
|
71 |
-
public static final function YEAR()
|
72 |
-
{
|
73 |
-
if(null === self::$YEAR)
|
74 |
-
self::$YEAR = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 3, 1, 100 );
|
75 |
-
|
76 |
-
return self::$YEAR;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Time unit for weekly fired time triggers and offsets. The values may range from 1 to 51 inclusively.
|
81 |
-
*
|
82 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the week <i>TimeTriggerUnit</i>.
|
83 |
-
*/
|
84 |
-
public static final function WEEK()
|
85 |
-
{
|
86 |
-
if(null === self::$WEEK)
|
87 |
-
self::$WEEK = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 4, 1, 51 );
|
88 |
-
|
89 |
-
return self::$WEEK;
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Time unit for hourly fired time triggers and offsets. The values may range from 1 to 23 inclusively.
|
94 |
-
*
|
95 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the hour <i>TimeTriggerUnit</i>.
|
96 |
-
*/
|
97 |
-
public static final function HOUR()
|
98 |
-
{
|
99 |
-
if(null === self::$HOUR)
|
100 |
-
self::$HOUR = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 5, 1, 23 );
|
101 |
-
|
102 |
-
return self::$HOUR;
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Unknown time unit. Indicates a version mismatch between API and server.
|
108 |
-
*
|
109 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the unknown <i>TimeTriggerUnit</i>.
|
110 |
-
*/
|
111 |
-
public static final function UNKNOWN()
|
112 |
-
{
|
113 |
-
if(null === self::$UNKNOWN)
|
114 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( -1, 0, 10000 );
|
115 |
-
|
116 |
-
return self::$UNKNOWN;
|
117 |
-
}
|
118 |
-
|
119 |
-
private $id;
|
120 |
-
|
121 |
-
private $minValue;
|
122 |
-
|
123 |
-
private $maxValue;
|
124 |
-
|
125 |
-
|
126 |
-
private function __construct( $iId, $iMinValue, $iMaxValue )
|
127 |
-
{
|
128 |
-
$this->id = $iId;
|
129 |
-
$this->minValue = $iMinValue;
|
130 |
-
$this->maxValue = $iMaxValue;
|
131 |
-
}
|
132 |
-
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Returns the ID of the <i>TimeTriggerUnit</i>. The ID is used for transmission purposes and should not be
|
136 |
-
* used inside client code.
|
137 |
-
*
|
138 |
-
* @return int the ID of the <i>TimeTriggerUnit</i>.
|
139 |
-
*/
|
140 |
-
public function getId()
|
141 |
-
{
|
142 |
-
return $this->id;
|
143 |
-
}
|
144 |
-
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Returns the minimum value for this <i>TimeTriggerUnit</i> inclusively.
|
148 |
-
*
|
149 |
-
* @return int the minimum value.
|
150 |
-
*/
|
151 |
-
public function getMinValue()
|
152 |
-
{
|
153 |
-
return $this->minValue;
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Returns the maximum value for this <i>TimeTriggerUnit</i> inclusively.
|
159 |
-
*
|
160 |
-
* @return int the maximum value.
|
161 |
-
*/
|
162 |
-
public function getMaxValue()
|
163 |
-
{
|
164 |
-
return $this->maxValue;
|
165 |
-
}
|
166 |
-
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Returns the <i>TimeTriggerUnit</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN unit
|
170 |
-
* will be used. The ID is used for transmission purposes and should not be used inside client code.
|
171 |
-
*
|
172 |
-
* @param int $iId the ID of the <i>TimeTriggerUniticode> to retrieve.
|
173 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the <i>TimeTriggerUnit</i> corresponding to the
|
174 |
-
* given ID.
|
175 |
-
*/
|
176 |
-
public static function byId( $iId )
|
177 |
-
{
|
178 |
-
foreach( self::values() as $unit )
|
179 |
-
{
|
180 |
-
if( $unit->getId() == $iId )
|
181 |
-
{
|
182 |
-
return $unit;
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
return self::UNKNOWN();
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Returns an array containing all available <i>TimeTriggerUnit</i>s including UNKNOWN.
|
191 |
-
*
|
192 |
-
* @return array an array containing all available <i>TimeTriggerUnit</i>s including UNKNOWN.
|
193 |
-
*/
|
194 |
-
public static function values()
|
195 |
-
{
|
196 |
-
return array(self::DAY(), self::MONTH(), self::YEAR(), self::WEEK(), self::HOUR(), self::UNKNOWN());
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit</i> enumeration defines the time units which can be used
|
9 |
+
* with time triggers, including the minimum and maximum values. The <i>TimeTriggerUnit</i> is used in various aspects
|
10 |
+
* of time triggers, for example in offsets and intervals.
|
11 |
+
* <p>
|
12 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
13 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
14 |
+
* purpose similar to integer constants.
|
15 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
16 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
17 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
18 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
19 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
20 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
21 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
22 |
+
*
|
23 |
+
* @since API 1.10.0
|
24 |
+
* @author chge, 16.07.2012
|
25 |
+
*/
|
26 |
+
final class Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit
|
27 |
+
{
|
28 |
+
private static $DAY = null;
|
29 |
+
|
30 |
+
private static $MONTH = null;
|
31 |
+
|
32 |
+
private static $YEAR = null;
|
33 |
+
|
34 |
+
private static $WEEK = null;
|
35 |
+
|
36 |
+
private static $HOUR = null;
|
37 |
+
|
38 |
+
private static $UNKNOWN = null;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Time unit for daily fired time triggers and offsets. The values may range from 1 to 364 inclusively.
|
42 |
+
*
|
43 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the day <i>TimeTriggerUnit</i>.
|
44 |
+
*/
|
45 |
+
public static final function DAY()
|
46 |
+
{
|
47 |
+
if(null === self::$DAY)
|
48 |
+
self::$DAY = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 1, 1, 364 );
|
49 |
+
|
50 |
+
return self::$DAY;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Time unit for monthly fired time triggers and offsets. The values may range from 1 to 12 inclusively.
|
55 |
+
*
|
56 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the month <i>TimeTriggerUnit</i>.
|
57 |
+
*/
|
58 |
+
public static final function MONTH()
|
59 |
+
{
|
60 |
+
if(null === self::$MONTH)
|
61 |
+
self::$MONTH = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 2, 1, 12 );
|
62 |
+
|
63 |
+
return self::$MONTH;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Time unit for yearly fired time triggers and offsets. The values may range from 1 to 100 inclusively.
|
68 |
+
*
|
69 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the year <i>TimeTriggerUnit</i>.
|
70 |
+
*/
|
71 |
+
public static final function YEAR()
|
72 |
+
{
|
73 |
+
if(null === self::$YEAR)
|
74 |
+
self::$YEAR = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 3, 1, 100 );
|
75 |
+
|
76 |
+
return self::$YEAR;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Time unit for weekly fired time triggers and offsets. The values may range from 1 to 51 inclusively.
|
81 |
+
*
|
82 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the week <i>TimeTriggerUnit</i>.
|
83 |
+
*/
|
84 |
+
public static final function WEEK()
|
85 |
+
{
|
86 |
+
if(null === self::$WEEK)
|
87 |
+
self::$WEEK = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 4, 1, 51 );
|
88 |
+
|
89 |
+
return self::$WEEK;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Time unit for hourly fired time triggers and offsets. The values may range from 1 to 23 inclusively.
|
94 |
+
*
|
95 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the hour <i>TimeTriggerUnit</i>.
|
96 |
+
*/
|
97 |
+
public static final function HOUR()
|
98 |
+
{
|
99 |
+
if(null === self::$HOUR)
|
100 |
+
self::$HOUR = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( 5, 1, 23 );
|
101 |
+
|
102 |
+
return self::$HOUR;
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Unknown time unit. Indicates a version mismatch between API and server.
|
108 |
+
*
|
109 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the unknown <i>TimeTriggerUnit</i>.
|
110 |
+
*/
|
111 |
+
public static final function UNKNOWN()
|
112 |
+
{
|
113 |
+
if(null === self::$UNKNOWN)
|
114 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit( -1, 0, 10000 );
|
115 |
+
|
116 |
+
return self::$UNKNOWN;
|
117 |
+
}
|
118 |
+
|
119 |
+
private $id;
|
120 |
+
|
121 |
+
private $minValue;
|
122 |
+
|
123 |
+
private $maxValue;
|
124 |
+
|
125 |
+
|
126 |
+
private function __construct( $iId, $iMinValue, $iMaxValue )
|
127 |
+
{
|
128 |
+
$this->id = $iId;
|
129 |
+
$this->minValue = $iMinValue;
|
130 |
+
$this->maxValue = $iMaxValue;
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Returns the ID of the <i>TimeTriggerUnit</i>. The ID is used for transmission purposes and should not be
|
136 |
+
* used inside client code.
|
137 |
+
*
|
138 |
+
* @return int the ID of the <i>TimeTriggerUnit</i>.
|
139 |
+
*/
|
140 |
+
public function getId()
|
141 |
+
{
|
142 |
+
return $this->id;
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Returns the minimum value for this <i>TimeTriggerUnit</i> inclusively.
|
148 |
+
*
|
149 |
+
* @return int the minimum value.
|
150 |
+
*/
|
151 |
+
public function getMinValue()
|
152 |
+
{
|
153 |
+
return $this->minValue;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Returns the maximum value for this <i>TimeTriggerUnit</i> inclusively.
|
159 |
+
*
|
160 |
+
* @return int the maximum value.
|
161 |
+
*/
|
162 |
+
public function getMaxValue()
|
163 |
+
{
|
164 |
+
return $this->maxValue;
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Returns the <i>TimeTriggerUnit</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN unit
|
170 |
+
* will be used. The ID is used for transmission purposes and should not be used inside client code.
|
171 |
+
*
|
172 |
+
* @param int $iId the ID of the <i>TimeTriggerUniticode> to retrieve.
|
173 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the <i>TimeTriggerUnit</i> corresponding to the
|
174 |
+
* given ID.
|
175 |
+
*/
|
176 |
+
public static function byId( $iId )
|
177 |
+
{
|
178 |
+
foreach( self::values() as $unit )
|
179 |
+
{
|
180 |
+
if( $unit->getId() == $iId )
|
181 |
+
{
|
182 |
+
return $unit;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
return self::UNKNOWN();
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Returns an array containing all available <i>TimeTriggerUnit</i>s including UNKNOWN.
|
191 |
+
*
|
192 |
+
* @return array an array containing all available <i>TimeTriggerUnit</i>s including UNKNOWN.
|
193 |
+
*/
|
194 |
+
public static function values()
|
195 |
+
{
|
196 |
+
return array(self::DAY(), self::MONTH(), self::YEAR(), self::WEEK(), self::HOUR(), self::UNKNOWN());
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptor.php
CHANGED
@@ -1,137 +1,137 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* An <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i> describes the trigger of an
|
4 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailing</i>. The trigger defines when a <i>TriggerMailing</i> will be sent and
|
5 |
-
* which recipients will receive it. It therefore is the most important part of a <i>TriggerMailing</i>, controlling
|
6 |
-
* the whole dispatch process.
|
7 |
-
* <p>
|
8 |
-
* A <i>TriggerDescriptor</i> consists of a number of settings - some of which are optional depending on the
|
9 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerType</i>. The following settings are supported:
|
10 |
-
* <ul>
|
11 |
-
* <li><b>The <i>TriggerType</i>:</b> Defines what kind of trigger will be used (strictly mandatory).
|
12 |
-
* <li><b>The start date</b>: Defines the date at which the trigger mailing will be dispatched first (only optional for
|
13 |
-
* action triggers).
|
14 |
-
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched last (generally optional).
|
15 |
-
* <li><b>The sending time</b>: Defines at which time the trigger mailing will be sent during each dispatch cycle (only
|
16 |
-
* optional for action triggers).
|
17 |
-
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients (mandatory for all
|
18 |
-
* attribute driven triggers).
|
19 |
-
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
20 |
-
* trigger mailing shall be dispatched to a recipient (generally optional).
|
21 |
-
* <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired (only
|
22 |
-
* mandatory for anniversary triggers).
|
23 |
-
* <li><b>An array of <i>SetValueCommand</i></b>s: Can be used to set recipient attribute values along with the
|
24 |
-
* dispatch of the trigger mailing (generally optional).
|
25 |
-
* <li><b>The <i>TriggerInterval</i></b>: Defines when the trigger mailing will be dispatched (only relevant for
|
26 |
-
* interval triggers).
|
27 |
-
* </ul>
|
28 |
-
* <p>
|
29 |
-
* It's rarely advisable to create a <i>TriggerDescriptor</i> directly as the state space is complex and can be
|
30 |
-
* confusing. Generally, it's reasonable to use an <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder</i> for
|
31 |
-
* this task which will guide you through the process of creating a <i>TriggerDescriptor</i> and complain about any missing
|
32 |
-
* settings and broken invariants.
|
33 |
-
* <p>
|
34 |
-
* For an example on how to create a <i>TriggerDescriptor</i> using a builder, see the
|
35 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailingManager</i> documentation.
|
36 |
-
*
|
37 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getTriggerDescriptor()
|
38 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
39 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager
|
40 |
-
* @since API 1.10.0
|
41 |
-
* @author chge, 16.07.2012
|
42 |
-
*/
|
43 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor
|
44 |
-
{
|
45 |
-
/**
|
46 |
-
* Returns the type of the trigger described by this <i>TriggerDescriptor</i>. This setting is strictly
|
47 |
-
* mandatory.
|
48 |
-
*
|
49 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the type of the trigger.
|
50 |
-
*/
|
51 |
-
public function getType();
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Returns the date when the trigger described by this <i>TriggerDescriptor</i> will be fired for the first
|
56 |
-
* time. This setting is mandatory for all time triggers. That is, it's mandatory for all but action triggers.
|
57 |
-
*
|
58 |
-
* @return string the date when the trigger will be fired for the first time. The date is formatted as
|
59 |
-
* ISO-8601 datetime string.
|
60 |
-
*/
|
61 |
-
public function getStartDate();
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Returns the time when the trigger described by this <i>TriggerDescriptor</i> will be fired during each
|
66 |
-
* dispatch cycle. This setting is mandatory for all time triggers. That is, it's mandatory for all but action
|
67 |
-
* triggers.
|
68 |
-
*
|
69 |
-
* @return string the time when the trigger will be fired during each dispatch cylce. The time is formatted as
|
70 |
-
* ISO-8601 datetime string.
|
71 |
-
*/
|
72 |
-
public function getSendingTime();
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Returns the date when the trigger described by this <i>TriggerDescriptor</i> will be fired for the last
|
77 |
-
* time. This setting is generally optional and only relevant for time trigger mailings.
|
78 |
-
*
|
79 |
-
* @return string the date when the trigger will be fired for the last time. The date is formatted as
|
80 |
-
* ISO-8601 datetime string.
|
81 |
-
*/
|
82 |
-
public function getEndDate();
|
83 |
-
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Returns an array of <i>Inx_Api_Action_SetValueCommand</i>s which will be executed when dispatching the trigger
|
87 |
-
* mailings. Using this feature, it is possible to set the values of recipient attributes along with the dispatching
|
88 |
-
* of a trigger mailing to that same recipient. This setting is generally optional and only relevant for time
|
89 |
-
* trigger mailings.
|
90 |
-
*
|
91 |
-
* @return array an array of <i>Inx_Api_Action_SetValueCommand</i>s used to set recipient attributes during dispatch.
|
92 |
-
*/
|
93 |
-
public function getAttributeValueSetters();
|
94 |
-
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Returns the ID of the recipient attribute used as basis of the trigger described by this <i>TriggerDescriptor</i>.
|
98 |
-
* This setting is only mandatory and relevant for all attribute driven triggers.
|
99 |
-
*
|
100 |
-
* @return int the ID of the recipient attribute used as basis of the trigger.
|
101 |
-
*/
|
102 |
-
public function getAttributeId();
|
103 |
-
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to alter the dispatch date specified
|
107 |
-
* by the attribute. For example: Normally, birthday trigger mailings are sent on the birthday of the recipient.
|
108 |
-
* Using a <i>TimeTriggerOffset</i> you can send your congratulations before or after that date. This setting is
|
109 |
-
* generally optional and only relevant for time trigger mailings.
|
110 |
-
*
|
111 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset the <i>TimeTriggerOffset</i> used to alter the
|
112 |
-
* dispatch date specified by the attribute.
|
113 |
-
*/
|
114 |
-
public function getOffset();
|
115 |
-
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
|
119 |
-
* dispatch date and the date specified by the attribute. For example: An anniversary trigger mailing can be sent
|
120 |
-
* out ten years after the date specified by the attribute. This setting is only mandatory and relevant for
|
121 |
-
* anniversary triggers.
|
122 |
-
*
|
123 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset the <i>TimeTriggerOffset</i> used to define the time
|
124 |
-
* span between the dispatch date and the date specified by the attribute.
|
125 |
-
*/
|
126 |
-
public function getColumnModificator();
|
127 |
-
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> used to define the dispatch intervals of an
|
131 |
-
* interval trigger mailing. This setting is only mandatory and relevant for interval triggers.
|
132 |
-
*
|
133 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerInterval the <i>TriggerInterval</i> used to define the dispatch
|
134 |
-
* intervals of an interval trigger mailing.
|
135 |
-
*/
|
136 |
-
public function getInterval();
|
137 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* An <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i> describes the trigger of an
|
4 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailing</i>. The trigger defines when a <i>TriggerMailing</i> will be sent and
|
5 |
+
* which recipients will receive it. It therefore is the most important part of a <i>TriggerMailing</i>, controlling
|
6 |
+
* the whole dispatch process.
|
7 |
+
* <p>
|
8 |
+
* A <i>TriggerDescriptor</i> consists of a number of settings - some of which are optional depending on the
|
9 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerType</i>. The following settings are supported:
|
10 |
+
* <ul>
|
11 |
+
* <li><b>The <i>TriggerType</i>:</b> Defines what kind of trigger will be used (strictly mandatory).
|
12 |
+
* <li><b>The start date</b>: Defines the date at which the trigger mailing will be dispatched first (only optional for
|
13 |
+
* action triggers).
|
14 |
+
* <li><b>The end date</b>: Defines the date at which the trigger mailing will be dispatched last (generally optional).
|
15 |
+
* <li><b>The sending time</b>: Defines at which time the trigger mailing will be sent during each dispatch cycle (only
|
16 |
+
* optional for action triggers).
|
17 |
+
* <li><b>The attribute ID</b>: Defines the attribute used to determine the relevant recipients (mandatory for all
|
18 |
+
* attribute driven triggers).
|
19 |
+
* <li><b>The offset</b>: Defines the offset of the attribute. For example, how many days after a specific date the
|
20 |
+
* trigger mailing shall be dispatched to a recipient (generally optional).
|
21 |
+
* <li><b>The column modificator</b>: Defines how long after or before a specific date the trigger shall be fired (only
|
22 |
+
* mandatory for anniversary triggers).
|
23 |
+
* <li><b>An array of <i>SetValueCommand</i></b>s: Can be used to set recipient attribute values along with the
|
24 |
+
* dispatch of the trigger mailing (generally optional).
|
25 |
+
* <li><b>The <i>TriggerInterval</i></b>: Defines when the trigger mailing will be dispatched (only relevant for
|
26 |
+
* interval triggers).
|
27 |
+
* </ul>
|
28 |
+
* <p>
|
29 |
+
* It's rarely advisable to create a <i>TriggerDescriptor</i> directly as the state space is complex and can be
|
30 |
+
* confusing. Generally, it's reasonable to use an <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder</i> for
|
31 |
+
* this task which will guide you through the process of creating a <i>TriggerDescriptor</i> and complain about any missing
|
32 |
+
* settings and broken invariants.
|
33 |
+
* <p>
|
34 |
+
* For an example on how to create a <i>TriggerDescriptor</i> using a builder, see the
|
35 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailingManager</i> documentation.
|
36 |
+
*
|
37 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getTriggerDescriptor()
|
38 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
39 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager
|
40 |
+
* @since API 1.10.0
|
41 |
+
* @author chge, 16.07.2012
|
42 |
+
*/
|
43 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor
|
44 |
+
{
|
45 |
+
/**
|
46 |
+
* Returns the type of the trigger described by this <i>TriggerDescriptor</i>. This setting is strictly
|
47 |
+
* mandatory.
|
48 |
+
*
|
49 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the type of the trigger.
|
50 |
+
*/
|
51 |
+
public function getType();
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Returns the date when the trigger described by this <i>TriggerDescriptor</i> will be fired for the first
|
56 |
+
* time. This setting is mandatory for all time triggers. That is, it's mandatory for all but action triggers.
|
57 |
+
*
|
58 |
+
* @return string the date when the trigger will be fired for the first time. The date is formatted as
|
59 |
+
* ISO-8601 datetime string.
|
60 |
+
*/
|
61 |
+
public function getStartDate();
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns the time when the trigger described by this <i>TriggerDescriptor</i> will be fired during each
|
66 |
+
* dispatch cycle. This setting is mandatory for all time triggers. That is, it's mandatory for all but action
|
67 |
+
* triggers.
|
68 |
+
*
|
69 |
+
* @return string the time when the trigger will be fired during each dispatch cylce. The time is formatted as
|
70 |
+
* ISO-8601 datetime string.
|
71 |
+
*/
|
72 |
+
public function getSendingTime();
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Returns the date when the trigger described by this <i>TriggerDescriptor</i> will be fired for the last
|
77 |
+
* time. This setting is generally optional and only relevant for time trigger mailings.
|
78 |
+
*
|
79 |
+
* @return string the date when the trigger will be fired for the last time. The date is formatted as
|
80 |
+
* ISO-8601 datetime string.
|
81 |
+
*/
|
82 |
+
public function getEndDate();
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Returns an array of <i>Inx_Api_Action_SetValueCommand</i>s which will be executed when dispatching the trigger
|
87 |
+
* mailings. Using this feature, it is possible to set the values of recipient attributes along with the dispatching
|
88 |
+
* of a trigger mailing to that same recipient. This setting is generally optional and only relevant for time
|
89 |
+
* trigger mailings.
|
90 |
+
*
|
91 |
+
* @return array an array of <i>Inx_Api_Action_SetValueCommand</i>s used to set recipient attributes during dispatch.
|
92 |
+
*/
|
93 |
+
public function getAttributeValueSetters();
|
94 |
+
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Returns the ID of the recipient attribute used as basis of the trigger described by this <i>TriggerDescriptor</i>.
|
98 |
+
* This setting is only mandatory and relevant for all attribute driven triggers.
|
99 |
+
*
|
100 |
+
* @return int the ID of the recipient attribute used as basis of the trigger.
|
101 |
+
*/
|
102 |
+
public function getAttributeId();
|
103 |
+
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to alter the dispatch date specified
|
107 |
+
* by the attribute. For example: Normally, birthday trigger mailings are sent on the birthday of the recipient.
|
108 |
+
* Using a <i>TimeTriggerOffset</i> you can send your congratulations before or after that date. This setting is
|
109 |
+
* generally optional and only relevant for time trigger mailings.
|
110 |
+
*
|
111 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset the <i>TimeTriggerOffset</i> used to alter the
|
112 |
+
* dispatch date specified by the attribute.
|
113 |
+
*/
|
114 |
+
public function getOffset();
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset</i> used to define the time span between the
|
119 |
+
* dispatch date and the date specified by the attribute. For example: An anniversary trigger mailing can be sent
|
120 |
+
* out ten years after the date specified by the attribute. This setting is only mandatory and relevant for
|
121 |
+
* anniversary triggers.
|
122 |
+
*
|
123 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset the <i>TimeTriggerOffset</i> used to define the time
|
124 |
+
* span between the dispatch date and the date specified by the attribute.
|
125 |
+
*/
|
126 |
+
public function getColumnModificator();
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> used to define the dispatch intervals of an
|
131 |
+
* interval trigger mailing. This setting is only mandatory and relevant for interval triggers.
|
132 |
+
*
|
133 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerInterval the <i>TriggerInterval</i> used to define the dispatch
|
134 |
+
* intervals of an interval trigger mailing.
|
135 |
+
*/
|
136 |
+
public function getInterval();
|
137 |
+
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptorBuilder.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder</i>s are used to easily create
|
9 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i>s. They provide some guidance and will complain about
|
10 |
-
* any missing settings and broken invariants. The different builders are created using the
|
11 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i>.
|
12 |
-
*
|
13 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory
|
14 |
-
* @since API 1.10.0
|
15 |
-
* @author chge, 16.07.2012
|
16 |
-
*/
|
17 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* Creates the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i> according to the settings. Before creating
|
21 |
-
* the descriptor, the <i>validate()</i> method will be called to check the settings for correctness.
|
22 |
-
*
|
23 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor the <i>TriggerDescriptor</i> as defined by the settings.
|
24 |
-
*/
|
25 |
-
public function build();
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Validates the settings for correctness. Any missing settings and broken invariants will trigger a certain kind of
|
30 |
-
* <i>Exception</i> like:
|
31 |
-
* <ul>
|
32 |
-
* <li><i>Inx_Api_NullPointerException</i>: A mandatory setting was configured with <i>null</i>.
|
33 |
-
* <li><i>Inx_Api_IllegalArgumentException</i>: A setting was configured with an illegal value.
|
34 |
-
* <li><i>Inx_Api_IllegalStateException</i>: An invariant was broken or a mandatory setting is missing.
|
35 |
-
* </ul>
|
36 |
-
*
|
37 |
-
* @throws Exception if the settings are incorrect.
|
38 |
-
*/
|
39 |
-
public function validate();
|
40 |
-
}
|
41 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder</i>s are used to easily create
|
9 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i>s. They provide some guidance and will complain about
|
10 |
+
* any missing settings and broken invariants. The different builders are created using the
|
11 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i>.
|
12 |
+
*
|
13 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory
|
14 |
+
* @since API 1.10.0
|
15 |
+
* @author chge, 16.07.2012
|
16 |
+
*/
|
17 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Creates the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor</i> according to the settings. Before creating
|
21 |
+
* the descriptor, the <i>validate()</i> method will be called to check the settings for correctness.
|
22 |
+
*
|
23 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor the <i>TriggerDescriptor</i> as defined by the settings.
|
24 |
+
*/
|
25 |
+
public function build();
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Validates the settings for correctness. Any missing settings and broken invariants will trigger a certain kind of
|
30 |
+
* <i>Exception</i> like:
|
31 |
+
* <ul>
|
32 |
+
* <li><i>Inx_Api_NullPointerException</i>: A mandatory setting was configured with <i>null</i>.
|
33 |
+
* <li><i>Inx_Api_IllegalArgumentException</i>: A setting was configured with an illegal value.
|
34 |
+
* <li><i>Inx_Api_IllegalStateException</i>: An invariant was broken or a mandatory setting is missing.
|
35 |
+
* </ul>
|
36 |
+
*
|
37 |
+
* @throws Exception if the settings are incorrect.
|
38 |
+
*/
|
39 |
+
public function validate();
|
40 |
+
}
|
41 |
+
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerDescriptorBuilderFactory.php
CHANGED
@@ -1,71 +1,71 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i> is used to create the builders for the
|
9 |
-
* various trigger types. The trigger types differ in their mandatory and optional settings, including the allowed state
|
10 |
-
* space. The builders are designed to guide you through the process of creating trigger descriptors as easy as possible.
|
11 |
-
*
|
12 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
13 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor
|
14 |
-
* @since API 1.10.0
|
15 |
-
* @author chge, 17.07.2012
|
16 |
-
*/
|
17 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* Creates a builder which can be used to create action trigger descriptors.
|
21 |
-
*
|
22 |
-
* @return Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder a builder which can be used to create
|
23 |
-
* action trigger descriptors.
|
24 |
-
*/
|
25 |
-
public function createActionTriggerDescriptorBuilder();
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Creates a builder which can be used to create interval trigger descriptors.
|
30 |
-
*
|
31 |
-
* @return Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder a builder which can be used to create
|
32 |
-
* interval trigger descriptors.
|
33 |
-
*/
|
34 |
-
public function createIntervalTriggerDescriptorBuilder();
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Creates a builder which can be used to create birthday trigger descriptors.
|
39 |
-
*
|
40 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
41 |
-
* birthday trigger descriptors.
|
42 |
-
*/
|
43 |
-
public function createBirthdayTriggerDescriptorBuilder();
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Creates a builder which can be used to create anniversary trigger descriptors.
|
48 |
-
*
|
49 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder a builder which can be used to create
|
50 |
-
* anniversary trigger descriptors.
|
51 |
-
*/
|
52 |
-
public function createAnniversaryTriggerDescriptorBuilder();
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Creates a builder which can be used to create reminder trigger descriptors.
|
57 |
-
*
|
58 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
59 |
-
* reminder trigger descriptors.
|
60 |
-
*/
|
61 |
-
public function createReminderTriggerDescriptorBuilder();
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Creates a builder which can be used to create follow-up trigger descriptors.
|
66 |
-
*
|
67 |
-
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
68 |
-
* follow-up trigger descriptors.
|
69 |
-
*/
|
70 |
-
public function createFollowUpTriggerDescriptorBuilder();
|
71 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i> is used to create the builders for the
|
9 |
+
* various trigger types. The trigger types differ in their mandatory and optional settings, including the allowed state
|
10 |
+
* space. The builders are designed to guide you through the process of creating trigger descriptors as easy as possible.
|
11 |
+
*
|
12 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilder
|
13 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor
|
14 |
+
* @since API 1.10.0
|
15 |
+
* @author chge, 17.07.2012
|
16 |
+
*/
|
17 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Creates a builder which can be used to create action trigger descriptors.
|
21 |
+
*
|
22 |
+
* @return Inx_Api_TriggerMailing_Descriptor_ActionTriggerDescriptorBuilder a builder which can be used to create
|
23 |
+
* action trigger descriptors.
|
24 |
+
*/
|
25 |
+
public function createActionTriggerDescriptorBuilder();
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Creates a builder which can be used to create interval trigger descriptors.
|
30 |
+
*
|
31 |
+
* @return Inx_Api_TriggerMailing_Descriptor_IntervalTriggerDescriptorBuilder a builder which can be used to create
|
32 |
+
* interval trigger descriptors.
|
33 |
+
*/
|
34 |
+
public function createIntervalTriggerDescriptorBuilder();
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Creates a builder which can be used to create birthday trigger descriptors.
|
39 |
+
*
|
40 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
41 |
+
* birthday trigger descriptors.
|
42 |
+
*/
|
43 |
+
public function createBirthdayTriggerDescriptorBuilder();
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Creates a builder which can be used to create anniversary trigger descriptors.
|
48 |
+
*
|
49 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AnniversaryTriggerDescriptorBuilder a builder which can be used to create
|
50 |
+
* anniversary trigger descriptors.
|
51 |
+
*/
|
52 |
+
public function createAnniversaryTriggerDescriptorBuilder();
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Creates a builder which can be used to create reminder trigger descriptors.
|
57 |
+
*
|
58 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
59 |
+
* reminder trigger descriptors.
|
60 |
+
*/
|
61 |
+
public function createReminderTriggerDescriptorBuilder();
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Creates a builder which can be used to create follow-up trigger descriptors.
|
66 |
+
*
|
67 |
+
* @return Inx_Api_TriggerMailing_Descriptor_AttributeTriggerDescriptorBuilder a builder which can be used to create
|
68 |
+
* follow-up trigger descriptors.
|
69 |
+
*/
|
70 |
+
public function createFollowUpTriggerDescriptorBuilder();
|
71 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerInterval.php
CHANGED
@@ -1,83 +1,83 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> is the integral part of the interval trigger. It
|
9 |
-
* describes when the trigger will be fired using a combination of the following settings:
|
10 |
-
* <ul>
|
11 |
-
* <li><b>The interval unit</b>: Defines the unit of the interval (e.g. day, week, month,...).
|
12 |
-
* <li><b>The interval count</b>: Defines the how many times the trigger shall be fired (e.g. every X months).
|
13 |
-
* <li><b>The dispatch intervals</b>: Defines the dispatch intervals (e.g. daily, hourly, day in month,...).
|
14 |
-
* <li><b>The day</b>: Defines the day on which the trigger shall be fired. Only used in combination with monthly
|
15 |
-
* dispatch intervals.
|
16 |
-
* </ul>
|
17 |
-
* <p>
|
18 |
-
* It's rarely advisable to create a <i>TriggerInterval</i> directly as the state space is complex and can be
|
19 |
-
* confusing. Generally, it's reasonable to use an <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i>
|
20 |
-
* for this task which will guide you through the process of creating a <i>TriggerInterval</i> and complain about
|
21 |
-
* any missing settings and broken invariants.
|
22 |
-
* <p>
|
23 |
-
* For an example on how to create a <i>TriggerInterval</i> using a builder, see the
|
24 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i> documentation.
|
25 |
-
*
|
26 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor::getInterval()
|
27 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
28 |
-
* @since API 1.10.0
|
29 |
-
* @author chge, 16.07.2012
|
30 |
-
*/
|
31 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
32 |
-
{
|
33 |
-
/**
|
34 |
-
* Returns the interval unit.
|
35 |
-
*
|
36 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the interval unit.
|
37 |
-
*/
|
38 |
-
public function getIntervalUnit();
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Returns the interval count. Do not confuse this setting with the day setting as they are used for different
|
43 |
-
* purposes. For example, to fire the trigger every two months on the first day of the month, you need the following
|
44 |
-
* settings:
|
45 |
-
* <ul>
|
46 |
-
* <li><b>Unit</b>: Month
|
47 |
-
* <li><b>Count</b>: 2
|
48 |
-
* <li><b>Dispatch intervals</b>: [SPECIFIC_DAY_OF_MONTH]
|
49 |
-
* <li><b>Day</b>: 1
|
50 |
-
* </ul>
|
51 |
-
*
|
52 |
-
* @return int the interval count.
|
53 |
-
*/
|
54 |
-
public function getIntervalCount();
|
55 |
-
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Returns the <i>set</i> (implemented as array) of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
59 |
-
* which determines the dispatch intervals. Which dispatch intervals are legal depends on the type of trigger interval you
|
60 |
-
* use. The builders clearly point out which combinations are legal.
|
61 |
-
*
|
62 |
-
* @return array the <i>set</i> of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s which determines
|
63 |
-
* the dispatch intervals.
|
64 |
-
*/
|
65 |
-
public function getDispatchIntervals();
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Returns the day of the dispatch interval. Do not confuse this setting with the interval count setting as they are
|
70 |
-
* used for different purposes. For example, to fire the trigger every two months on the first day of the month, you
|
71 |
-
* need the following settings:
|
72 |
-
* <ul>
|
73 |
-
* <li><b>Unit</b>: Month
|
74 |
-
* <li><b>Count</b>: 2
|
75 |
-
* <li><b>Dispatch intervals</b>: [SPECIFIC_DAY_OF_MONTH]
|
76 |
-
* <li><b>Day</b>: 1
|
77 |
-
* </ul>
|
78 |
-
*
|
79 |
-
* @return int the day of the dispatch interval.
|
80 |
-
*/
|
81 |
-
public function getDayInterval();
|
82 |
-
}
|
83 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> is the integral part of the interval trigger. It
|
9 |
+
* describes when the trigger will be fired using a combination of the following settings:
|
10 |
+
* <ul>
|
11 |
+
* <li><b>The interval unit</b>: Defines the unit of the interval (e.g. day, week, month,...).
|
12 |
+
* <li><b>The interval count</b>: Defines the how many times the trigger shall be fired (e.g. every X months).
|
13 |
+
* <li><b>The dispatch intervals</b>: Defines the dispatch intervals (e.g. daily, hourly, day in month,...).
|
14 |
+
* <li><b>The day</b>: Defines the day on which the trigger shall be fired. Only used in combination with monthly
|
15 |
+
* dispatch intervals.
|
16 |
+
* </ul>
|
17 |
+
* <p>
|
18 |
+
* It's rarely advisable to create a <i>TriggerInterval</i> directly as the state space is complex and can be
|
19 |
+
* confusing. Generally, it's reasonable to use an <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i>
|
20 |
+
* for this task which will guide you through the process of creating a <i>TriggerInterval</i> and complain about
|
21 |
+
* any missing settings and broken invariants.
|
22 |
+
* <p>
|
23 |
+
* For an example on how to create a <i>TriggerInterval</i> using a builder, see the
|
24 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i> documentation.
|
25 |
+
*
|
26 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor::getInterval()
|
27 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
28 |
+
* @since API 1.10.0
|
29 |
+
* @author chge, 16.07.2012
|
30 |
+
*/
|
31 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
32 |
+
{
|
33 |
+
/**
|
34 |
+
* Returns the interval unit.
|
35 |
+
*
|
36 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit the interval unit.
|
37 |
+
*/
|
38 |
+
public function getIntervalUnit();
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Returns the interval count. Do not confuse this setting with the day setting as they are used for different
|
43 |
+
* purposes. For example, to fire the trigger every two months on the first day of the month, you need the following
|
44 |
+
* settings:
|
45 |
+
* <ul>
|
46 |
+
* <li><b>Unit</b>: Month
|
47 |
+
* <li><b>Count</b>: 2
|
48 |
+
* <li><b>Dispatch intervals</b>: [SPECIFIC_DAY_OF_MONTH]
|
49 |
+
* <li><b>Day</b>: 1
|
50 |
+
* </ul>
|
51 |
+
*
|
52 |
+
* @return int the interval count.
|
53 |
+
*/
|
54 |
+
public function getIntervalCount();
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns the <i>set</i> (implemented as array) of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
59 |
+
* which determines the dispatch intervals. Which dispatch intervals are legal depends on the type of trigger interval you
|
60 |
+
* use. The builders clearly point out which combinations are legal.
|
61 |
+
*
|
62 |
+
* @return array the <i>set</i> of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s which determines
|
63 |
+
* the dispatch intervals.
|
64 |
+
*/
|
65 |
+
public function getDispatchIntervals();
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Returns the day of the dispatch interval. Do not confuse this setting with the interval count setting as they are
|
70 |
+
* used for different purposes. For example, to fire the trigger every two months on the first day of the month, you
|
71 |
+
* need the following settings:
|
72 |
+
* <ul>
|
73 |
+
* <li><b>Unit</b>: Month
|
74 |
+
* <li><b>Count</b>: 2
|
75 |
+
* <li><b>Dispatch intervals</b>: [SPECIFIC_DAY_OF_MONTH]
|
76 |
+
* <li><b>Day</b>: 1
|
77 |
+
* </ul>
|
78 |
+
*
|
79 |
+
* @return int the day of the dispatch interval.
|
80 |
+
*/
|
81 |
+
public function getDayInterval();
|
82 |
+
}
|
83 |
+
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerIntervalBuilder.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i>s are used to easily create
|
9 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i>s. They provide some guidance and will complain about any missing
|
10 |
-
* settings and broken invariants. The different builders are created using the
|
11 |
-
* </i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i>.
|
12 |
-
*
|
13 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory
|
14 |
-
* @since API 1.10.0
|
15 |
-
* @author chge, 17.07.2012
|
16 |
-
*/
|
17 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* Creates the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> according to the settings. Any missing
|
21 |
-
* settings and broken invariants will trigger a certain kind of <i>Exception</i> like:
|
22 |
-
* <ul>
|
23 |
-
* <li><i>Inx_Api_NullPointerException</i>: A mandatory setting was configured with <i>null</i>.
|
24 |
-
* <li><i>Inx_Api_IllegalArgumentException</i>: A setting was configured with an illegal value.
|
25 |
-
* <li><i>Inx_Api_IllegalStateException</i>: An invariant was broken or a mandatory setting is missing.
|
26 |
-
* </ul>
|
27 |
-
*
|
28 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerInterval the icode>TriggerInterval</i> as defined by
|
29 |
-
* the settings.
|
30 |
-
* @throws Exception if the settings are incorrect.
|
31 |
-
*/
|
32 |
-
public function build();
|
33 |
-
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Sets the interval count. The interval count is used to specify how many times the trigger will be fired. For
|
37 |
-
* example, when using a daily interval, the trigger is fired every X days where X is the interval count. This
|
38 |
-
* setting is mandatory for all builders.
|
39 |
-
* <p>
|
40 |
-
* The legal values for the interval count vary between the different interval types. They are defined by
|
41 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::getMinValue()</i> and
|
42 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::getMaxValue()</i>.
|
43 |
-
*
|
44 |
-
* @param int $iCount the interval count.
|
45 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder the builder.
|
46 |
-
* @throws Inx_Api_IllegalArgumentException if the interval count is out of legal bounds.
|
47 |
-
*/
|
48 |
-
public function intervalCount( $iCount );
|
49 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder</i>s are used to easily create
|
9 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i>s. They provide some guidance and will complain about any missing
|
10 |
+
* settings and broken invariants. The different builders are created using the
|
11 |
+
* </i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i>.
|
12 |
+
*
|
13 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory
|
14 |
+
* @since API 1.10.0
|
15 |
+
* @author chge, 17.07.2012
|
16 |
+
*/
|
17 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Creates the <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> according to the settings. Any missing
|
21 |
+
* settings and broken invariants will trigger a certain kind of <i>Exception</i> like:
|
22 |
+
* <ul>
|
23 |
+
* <li><i>Inx_Api_NullPointerException</i>: A mandatory setting was configured with <i>null</i>.
|
24 |
+
* <li><i>Inx_Api_IllegalArgumentException</i>: A setting was configured with an illegal value.
|
25 |
+
* <li><i>Inx_Api_IllegalStateException</i>: An invariant was broken or a mandatory setting is missing.
|
26 |
+
* </ul>
|
27 |
+
*
|
28 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerInterval the icode>TriggerInterval</i> as defined by
|
29 |
+
* the settings.
|
30 |
+
* @throws Exception if the settings are incorrect.
|
31 |
+
*/
|
32 |
+
public function build();
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets the interval count. The interval count is used to specify how many times the trigger will be fired. For
|
37 |
+
* example, when using a daily interval, the trigger is fired every X days where X is the interval count. This
|
38 |
+
* setting is mandatory for all builders.
|
39 |
+
* <p>
|
40 |
+
* The legal values for the interval count vary between the different interval types. They are defined by
|
41 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::getMinValue()</i> and
|
42 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::getMaxValue()</i>.
|
43 |
+
*
|
44 |
+
* @param int $iCount the interval count.
|
45 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder the builder.
|
46 |
+
* @throws Inx_Api_IllegalArgumentException if the interval count is out of legal bounds.
|
47 |
+
*/
|
48 |
+
public function intervalCount( $iCount );
|
49 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerIntervalBuilderFactory.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i> is used to create the builders for the
|
9 |
-
* various interval types. The interval types differ in their mandatory settings, including the allowed state space.
|
10 |
-
* The builders are designed to guide you through the process of creating trigger intervals as easy as possible.
|
11 |
-
*
|
12 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
13 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
14 |
-
* @since API 1.10.0
|
15 |
-
* @author chge, 17.07.2012
|
16 |
-
*/
|
17 |
-
interface Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* Creates a builder which can be used to create daily trigger intervals.
|
21 |
-
*
|
22 |
-
* @return Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder a builder which can be used to create
|
23 |
-
* daily trigger intervals.
|
24 |
-
*/
|
25 |
-
public function getDailyIntervalBuilder();
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Creates a builder which can be used to create weekly trigger intervals.
|
30 |
-
*
|
31 |
-
* @return Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder a builder which can be used to create
|
32 |
-
* weekly trigger intervals.
|
33 |
-
*/
|
34 |
-
public function getWeeklyIntervalBuilder();
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Creates a builder which can be used to create monthly trigger intervals.
|
39 |
-
*
|
40 |
-
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder a builder which can be used to create
|
41 |
-
* monthly trigger intervals.
|
42 |
-
*/
|
43 |
-
public function getMonthlyIntervalBuilder();
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Creates a builder which can be used to create hourly trigger intervals.
|
48 |
-
*
|
49 |
-
* @return Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder a builder which can be used to
|
50 |
-
* create hourly trigger intervals.
|
51 |
-
*/
|
52 |
-
public function getHourlyIntervalBuilder();
|
53 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i> is used to create the builders for the
|
9 |
+
* various interval types. The interval types differ in their mandatory settings, including the allowed state space.
|
10 |
+
* The builders are designed to guide you through the process of creating trigger intervals as easy as possible.
|
11 |
+
*
|
12 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
13 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
14 |
+
* @since API 1.10.0
|
15 |
+
* @author chge, 17.07.2012
|
16 |
+
*/
|
17 |
+
interface Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Creates a builder which can be used to create daily trigger intervals.
|
21 |
+
*
|
22 |
+
* @return Inx_Api_TriggerMailing_Descriptor_DailyTriggerIntervalBuilder a builder which can be used to create
|
23 |
+
* daily trigger intervals.
|
24 |
+
*/
|
25 |
+
public function getDailyIntervalBuilder();
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Creates a builder which can be used to create weekly trigger intervals.
|
30 |
+
*
|
31 |
+
* @return Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder a builder which can be used to create
|
32 |
+
* weekly trigger intervals.
|
33 |
+
*/
|
34 |
+
public function getWeeklyIntervalBuilder();
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Creates a builder which can be used to create monthly trigger intervals.
|
39 |
+
*
|
40 |
+
* @return Inx_Api_TriggerMailing_Descriptor_MonthlyTriggerIntervalBuilder a builder which can be used to create
|
41 |
+
* monthly trigger intervals.
|
42 |
+
*/
|
43 |
+
public function getMonthlyIntervalBuilder();
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Creates a builder which can be used to create hourly trigger intervals.
|
48 |
+
*
|
49 |
+
* @return Inx_Api_TriggerMailing_Descriptor_HourlyTriggerIntervalBuilder a builder which can be used to
|
50 |
+
* create hourly trigger intervals.
|
51 |
+
*/
|
52 |
+
public function getHourlyIntervalBuilder();
|
53 |
}
|
lib/Inx/Api/TriggerMailing/Descriptor/TriggerType.php
CHANGED
@@ -1,253 +1,253 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerType</i> enumeration defines the different types of triggers. The
|
9 |
-
* trigger types can be divided into two categories:
|
10 |
-
* <p>
|
11 |
-
* <ol>
|
12 |
-
* <li><b>Time triggers</b>: Used for time controlled dispatch of trigger mailings.
|
13 |
-
* <li><b>Action triggers</b>: Used for action controlled dispatch of trigger mailings.
|
14 |
-
* </ol>
|
15 |
-
* Time trigger mailings are sent out on a regular basis. The following time triggers are available:
|
16 |
-
* <p>
|
17 |
-
* <ul>
|
18 |
-
* <li><b>Birthday</b>: A mailing of this type is sent to recipients on the annual recurrence of a specific date. A
|
19 |
-
* datetime attribute of the recipient acts as a baseline and the mailing is sent every year after this baseline. An
|
20 |
-
* offset can be specified to send the mailing some time before or after the annual recurrence. The condition is checked
|
21 |
-
* once a day. The birthday trigger is an attribute driven time trigger.
|
22 |
-
* <li><b>Anniversary</b>: A mailing of this type is sent to recipients on the recurrence of a specific date. A datetime
|
23 |
-
* attribute of the recipient acts as baseline and the mailing is sent after a user defined period of time (years,
|
24 |
-
* months or days) after this baseline. An offset can be specified to send the mailing some time before or after the
|
25 |
-
* recurrence. The condition is checked once a day. The anniversary trigger is an attribute driven time trigger.
|
26 |
-
* <li><b>Reminder</b>: A mailing of this type is sent to recipients on a specific date. A datetime attribute of the
|
27 |
-
* recipient defines that date. An offset can be specified to send the mailing some time before the date. The condition
|
28 |
-
* is checked once a day. The reminder trigger is an attribute driven time trigger.
|
29 |
-
* <li><b>Follow up</b>: A mailing of this type is sent to recipients on a specific date. A datetime attribute of the
|
30 |
-
* recipient defines that date. An offset can be specified to send the mailing some time after the date. The condition
|
31 |
-
* is checked once a day. The follow up trigger is an attribute driven time trigger.
|
32 |
-
* <li><b>Interval</b>: A mailing of this type is sent to all recipients of the associated list at a freely definable
|
33 |
-
* interval (i.e. hourly, daily, weekly,...). The interval is described by an
|
34 |
-
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> object. The interval trigger is a time trigger which is not
|
35 |
-
* related to a specific attribute.
|
36 |
-
* </ul>
|
37 |
-
* <p>
|
38 |
-
* Action trigger mailings, on the other hand, are only sent if the associated action is executed. Be aware that the
|
39 |
-
* action cannot be defined by the trigger descriptor. Instead, the action contains a command (an
|
40 |
-
* <i>Inx_Api_Action_SendMailCommand</i>) which will send the mailing.
|
41 |
-
* <p>
|
42 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
43 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
44 |
-
* purpose similar to integer constants.
|
45 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
46 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
47 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
48 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
49 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
50 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
51 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
52 |
-
*
|
53 |
-
* @since API 1.10.0
|
54 |
-
* @author chge, 16.07.2012
|
55 |
-
*/
|
56 |
-
final class Inx_Api_TriggerMailing_Descriptor_TriggerType
|
57 |
-
{
|
58 |
-
private static $ACTION_MAILING = null;
|
59 |
-
|
60 |
-
private static $TIME_TRIGGER_INTERVAL_MAILING = null;
|
61 |
-
|
62 |
-
private static $TIME_TRIGGER_BIRTHDAY_MAILING = null;
|
63 |
-
|
64 |
-
private static $TIME_TRIGGER_ANNIVERSARY_MAILING = null;
|
65 |
-
|
66 |
-
private static $TIME_TRIGGER_REMINDER_MAILING = null;
|
67 |
-
|
68 |
-
private static $TIME_TRIGGER_FOLLOW_UP_MAILING = null;
|
69 |
-
|
70 |
-
private static $UNKNOWN = null;
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Type constant for action mailings. An action mailing is sent by the associated action using an
|
74 |
-
* <i>Inx_Api_Action_SendMailCommand</i>.
|
75 |
-
*
|
76 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the action <i>TriggerType</i>.
|
77 |
-
* @see Inx_Api_Action_SendMailCommand
|
78 |
-
*/
|
79 |
-
public static final function ACTION_MAILING()
|
80 |
-
{
|
81 |
-
if(null === self::$ACTION_MAILING)
|
82 |
-
self::$ACTION_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 1 );
|
83 |
-
|
84 |
-
return self::$ACTION_MAILING;
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Type constant for interval trigger mailings. An interval trigger mailing is sent to all recipients in the
|
89 |
-
* associated list at a freely definable interval (e.g. hourly, daily, weekly,...). The interval is described by a
|
90 |
-
* {@link TriggerInterval}. The interval trigger is a time trigger but no attribute driven trigger.
|
91 |
-
*
|
92 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the interval <i>TriggerType</i>.
|
93 |
-
* @see com.inxmail.xpro.api.triggermailing.descriptor.TriggerInterval
|
94 |
-
*/
|
95 |
-
public static final function TIME_TRIGGER_INTERVAL_MAILING()
|
96 |
-
{
|
97 |
-
if(null === self::$TIME_TRIGGER_INTERVAL_MAILING)
|
98 |
-
self::$TIME_TRIGGER_INTERVAL_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 2 );
|
99 |
-
|
100 |
-
return self::$TIME_TRIGGER_INTERVAL_MAILING;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Type constant for birthday trigger mailings. A birthday trigger mailing is sent every day to recipients for which
|
105 |
-
* the day of the attribute matches the current day. The birthday trigger is an attribute driven time trigger.
|
106 |
-
*
|
107 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the birthday <i>TriggerType</i>.
|
108 |
-
*/
|
109 |
-
public static final function TIME_TRIGGER_BIRTHDAY_MAILING()
|
110 |
-
{
|
111 |
-
if(null === self::$TIME_TRIGGER_BIRTHDAY_MAILING)
|
112 |
-
self::$TIME_TRIGGER_BIRTHDAY_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 3 );
|
113 |
-
|
114 |
-
return self::$TIME_TRIGGER_BIRTHDAY_MAILING;
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Type constant for anniversary trigger mailings. An anniversary trigger mailing is sent every day to recipients
|
119 |
-
* for which the day of the attribute matches the current day and was a fixed number of years, months or days ago.
|
120 |
-
* The anniversary trigger is an attribute driven time trigger.
|
121 |
-
*
|
122 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the anniversary <i>TriggerType</i>.
|
123 |
-
*/
|
124 |
-
public static final function TIME_TRIGGER_ANNIVERSARY_MAILING()
|
125 |
-
{
|
126 |
-
if(null === self::$TIME_TRIGGER_ANNIVERSARY_MAILING)
|
127 |
-
self::$TIME_TRIGGER_ANNIVERSARY_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 4 );
|
128 |
-
|
129 |
-
return self::$TIME_TRIGGER_ANNIVERSARY_MAILING;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Type constant for reminder trigger mailings. A reminder trigger mailing is sent every day to recipients for which
|
134 |
-
* the date in the attribute matches the current date (only positive offset). The reminder trigger is an attribute
|
135 |
-
* driven time trigger.
|
136 |
-
*
|
137 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the reminder <i>TriggerType</i>.
|
138 |
-
*/
|
139 |
-
public static final function TIME_TRIGGER_REMINDER_MAILING()
|
140 |
-
{
|
141 |
-
if(null === self::$TIME_TRIGGER_REMINDER_MAILING)
|
142 |
-
self::$TIME_TRIGGER_REMINDER_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 5 );
|
143 |
-
|
144 |
-
return self::$TIME_TRIGGER_REMINDER_MAILING;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Type constant for follow up trigger mailing. A follow up trigger mailing is sent every day to recipients for
|
149 |
-
* which the date in the attribute matches the current date (only negative offset). the follow up trigger is an
|
150 |
-
* attribute driven time trigger.
|
151 |
-
*
|
152 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the follow-up <i>TriggerType</i>.
|
153 |
-
*/
|
154 |
-
public static final function TIME_TRIGGER_FOLLOW_UP_MAILING()
|
155 |
-
{
|
156 |
-
if(null === self::$TIME_TRIGGER_FOLLOW_UP_MAILING)
|
157 |
-
self::$TIME_TRIGGER_FOLLOW_UP_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 6 );;
|
158 |
-
|
159 |
-
return self::$TIME_TRIGGER_FOLLOW_UP_MAILING;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Type constant for an unknown trigger type. Indicates a version mismatch between API and server.
|
164 |
-
*
|
165 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the unknown <i>TriggerType</i>.
|
166 |
-
*/
|
167 |
-
public static final function UNKNOWN()
|
168 |
-
{
|
169 |
-
if(null === self::$UNKNOWN)
|
170 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 7 );
|
171 |
-
|
172 |
-
return self::$UNKNOWN;
|
173 |
-
}
|
174 |
-
|
175 |
-
private $id;
|
176 |
-
|
177 |
-
|
178 |
-
private function __construct( $iId )
|
179 |
-
{
|
180 |
-
$this->id = $iId;
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Returns the ID of the <i>TriggerType</i>. The ID is used for transmission purposes and should not be used
|
186 |
-
* inside client code.
|
187 |
-
*
|
188 |
-
* @return int the ID of the <i>TriggerType</i>.
|
189 |
-
*/
|
190 |
-
public function getTypeId()
|
191 |
-
{
|
192 |
-
return $this->id;
|
193 |
-
}
|
194 |
-
|
195 |
-
|
196 |
-
/**
|
197 |
-
* Returns a <i>bool</i> indicating whether the <i>TriggerType</i> is a time trigger type.
|
198 |
-
*
|
199 |
-
* @return <i>true</i> if the <i>TriggerType</i> is a time trigger type, <i>false</i> otherwise.
|
200 |
-
*/
|
201 |
-
public function isTimeTriggerType()
|
202 |
-
{
|
203 |
-
return $this === self::TIME_TRIGGER_ANNIVERSARY_MAILING() || $this === self::TIME_TRIGGER_BIRTHDAY_MAILING()
|
204 |
-
|| $this === self::TIME_TRIGGER_FOLLOW_UP_MAILING() || $this === self::TIME_TRIGGER_INTERVAL_MAILING()
|
205 |
-
|| $this === self::TIME_TRIGGER_REMINDER_MAILING();
|
206 |
-
}
|
207 |
-
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Returns a <i>bool</i> indicating whether the <i>TriggerType</i> is an attribute driven trigger type.
|
211 |
-
*
|
212 |
-
* @return <i>true</i> if the <i>TriggerType</i> is an attribute driven trigger type, icode>false</i>
|
213 |
-
* otherwise.
|
214 |
-
*/
|
215 |
-
public function isAttributeTriggerType()
|
216 |
-
{
|
217 |
-
return $this === self::TIME_TRIGGER_ANNIVERSARY_MAILING() || $this === self::TIME_TRIGGER_BIRTHDAY_MAILING()
|
218 |
-
|| $this === self::TIME_TRIGGER_FOLLOW_UP_MAILING() || $this === self::TIME_TRIGGER_REMINDER_MAILING();
|
219 |
-
}
|
220 |
-
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Returns the <i>TriggerType</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN type will
|
224 |
-
* be used. The ID is used for transmission purposes and should not be used inside client code.
|
225 |
-
*
|
226 |
-
* @param int $iId the ID of the <i>TriggerType</i> to retrieve.
|
227 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the <i>TriggerType</i> corresponding to the given ID.
|
228 |
-
*/
|
229 |
-
public static function byTypeId( $iId )
|
230 |
-
{
|
231 |
-
foreach( self::values() as $type )
|
232 |
-
{
|
233 |
-
if( $type->getTypeId() == $iId )
|
234 |
-
{
|
235 |
-
return $type;
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
return self::UNKNOWN();
|
240 |
-
}
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Returns an array containing all available <i>TriggerType</i>s including UNKNOWN.
|
244 |
-
*
|
245 |
-
* @return array an array containing all available <i>TriggerType</i>s including UNKNOWN.
|
246 |
-
*/
|
247 |
-
public static function values()
|
248 |
-
{
|
249 |
-
return array(self::ACTION_MAILING(), self::TIME_TRIGGER_INTERVAL_MAILING(), self::TIME_TRIGGER_BIRTHDAY_MAILING(),
|
250 |
-
self::TIME_TRIGGER_ANNIVERSARY_MAILING(), self::TIME_TRIGGER_REMINDER_MAILING(),
|
251 |
-
self::TIME_TRIGGER_FOLLOW_UP_MAILING(), self::UNKNOWN());
|
252 |
-
}
|
253 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_TriggerType</i> enumeration defines the different types of triggers. The
|
9 |
+
* trigger types can be divided into two categories:
|
10 |
+
* <p>
|
11 |
+
* <ol>
|
12 |
+
* <li><b>Time triggers</b>: Used for time controlled dispatch of trigger mailings.
|
13 |
+
* <li><b>Action triggers</b>: Used for action controlled dispatch of trigger mailings.
|
14 |
+
* </ol>
|
15 |
+
* Time trigger mailings are sent out on a regular basis. The following time triggers are available:
|
16 |
+
* <p>
|
17 |
+
* <ul>
|
18 |
+
* <li><b>Birthday</b>: A mailing of this type is sent to recipients on the annual recurrence of a specific date. A
|
19 |
+
* datetime attribute of the recipient acts as a baseline and the mailing is sent every year after this baseline. An
|
20 |
+
* offset can be specified to send the mailing some time before or after the annual recurrence. The condition is checked
|
21 |
+
* once a day. The birthday trigger is an attribute driven time trigger.
|
22 |
+
* <li><b>Anniversary</b>: A mailing of this type is sent to recipients on the recurrence of a specific date. A datetime
|
23 |
+
* attribute of the recipient acts as baseline and the mailing is sent after a user defined period of time (years,
|
24 |
+
* months or days) after this baseline. An offset can be specified to send the mailing some time before or after the
|
25 |
+
* recurrence. The condition is checked once a day. The anniversary trigger is an attribute driven time trigger.
|
26 |
+
* <li><b>Reminder</b>: A mailing of this type is sent to recipients on a specific date. A datetime attribute of the
|
27 |
+
* recipient defines that date. An offset can be specified to send the mailing some time before the date. The condition
|
28 |
+
* is checked once a day. The reminder trigger is an attribute driven time trigger.
|
29 |
+
* <li><b>Follow up</b>: A mailing of this type is sent to recipients on a specific date. A datetime attribute of the
|
30 |
+
* recipient defines that date. An offset can be specified to send the mailing some time after the date. The condition
|
31 |
+
* is checked once a day. The follow up trigger is an attribute driven time trigger.
|
32 |
+
* <li><b>Interval</b>: A mailing of this type is sent to all recipients of the associated list at a freely definable
|
33 |
+
* interval (i.e. hourly, daily, weekly,...). The interval is described by an
|
34 |
+
* <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> object. The interval trigger is a time trigger which is not
|
35 |
+
* related to a specific attribute.
|
36 |
+
* </ul>
|
37 |
+
* <p>
|
38 |
+
* Action trigger mailings, on the other hand, are only sent if the associated action is executed. Be aware that the
|
39 |
+
* action cannot be defined by the trigger descriptor. Instead, the action contains a command (an
|
40 |
+
* <i>Inx_Api_Action_SendMailCommand</i>) which will send the mailing.
|
41 |
+
* <p>
|
42 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
43 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
44 |
+
* purpose similar to integer constants.
|
45 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
46 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
47 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
48 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
49 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
50 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
51 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
52 |
+
*
|
53 |
+
* @since API 1.10.0
|
54 |
+
* @author chge, 16.07.2012
|
55 |
+
*/
|
56 |
+
final class Inx_Api_TriggerMailing_Descriptor_TriggerType
|
57 |
+
{
|
58 |
+
private static $ACTION_MAILING = null;
|
59 |
+
|
60 |
+
private static $TIME_TRIGGER_INTERVAL_MAILING = null;
|
61 |
+
|
62 |
+
private static $TIME_TRIGGER_BIRTHDAY_MAILING = null;
|
63 |
+
|
64 |
+
private static $TIME_TRIGGER_ANNIVERSARY_MAILING = null;
|
65 |
+
|
66 |
+
private static $TIME_TRIGGER_REMINDER_MAILING = null;
|
67 |
+
|
68 |
+
private static $TIME_TRIGGER_FOLLOW_UP_MAILING = null;
|
69 |
+
|
70 |
+
private static $UNKNOWN = null;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Type constant for action mailings. An action mailing is sent by the associated action using an
|
74 |
+
* <i>Inx_Api_Action_SendMailCommand</i>.
|
75 |
+
*
|
76 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the action <i>TriggerType</i>.
|
77 |
+
* @see Inx_Api_Action_SendMailCommand
|
78 |
+
*/
|
79 |
+
public static final function ACTION_MAILING()
|
80 |
+
{
|
81 |
+
if(null === self::$ACTION_MAILING)
|
82 |
+
self::$ACTION_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 1 );
|
83 |
+
|
84 |
+
return self::$ACTION_MAILING;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Type constant for interval trigger mailings. An interval trigger mailing is sent to all recipients in the
|
89 |
+
* associated list at a freely definable interval (e.g. hourly, daily, weekly,...). The interval is described by a
|
90 |
+
* {@link TriggerInterval}. The interval trigger is a time trigger but no attribute driven trigger.
|
91 |
+
*
|
92 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the interval <i>TriggerType</i>.
|
93 |
+
* @see com.inxmail.xpro.api.triggermailing.descriptor.TriggerInterval
|
94 |
+
*/
|
95 |
+
public static final function TIME_TRIGGER_INTERVAL_MAILING()
|
96 |
+
{
|
97 |
+
if(null === self::$TIME_TRIGGER_INTERVAL_MAILING)
|
98 |
+
self::$TIME_TRIGGER_INTERVAL_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 2 );
|
99 |
+
|
100 |
+
return self::$TIME_TRIGGER_INTERVAL_MAILING;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Type constant for birthday trigger mailings. A birthday trigger mailing is sent every day to recipients for which
|
105 |
+
* the day of the attribute matches the current day. The birthday trigger is an attribute driven time trigger.
|
106 |
+
*
|
107 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the birthday <i>TriggerType</i>.
|
108 |
+
*/
|
109 |
+
public static final function TIME_TRIGGER_BIRTHDAY_MAILING()
|
110 |
+
{
|
111 |
+
if(null === self::$TIME_TRIGGER_BIRTHDAY_MAILING)
|
112 |
+
self::$TIME_TRIGGER_BIRTHDAY_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 3 );
|
113 |
+
|
114 |
+
return self::$TIME_TRIGGER_BIRTHDAY_MAILING;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Type constant for anniversary trigger mailings. An anniversary trigger mailing is sent every day to recipients
|
119 |
+
* for which the day of the attribute matches the current day and was a fixed number of years, months or days ago.
|
120 |
+
* The anniversary trigger is an attribute driven time trigger.
|
121 |
+
*
|
122 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the anniversary <i>TriggerType</i>.
|
123 |
+
*/
|
124 |
+
public static final function TIME_TRIGGER_ANNIVERSARY_MAILING()
|
125 |
+
{
|
126 |
+
if(null === self::$TIME_TRIGGER_ANNIVERSARY_MAILING)
|
127 |
+
self::$TIME_TRIGGER_ANNIVERSARY_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 4 );
|
128 |
+
|
129 |
+
return self::$TIME_TRIGGER_ANNIVERSARY_MAILING;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Type constant for reminder trigger mailings. A reminder trigger mailing is sent every day to recipients for which
|
134 |
+
* the date in the attribute matches the current date (only positive offset). The reminder trigger is an attribute
|
135 |
+
* driven time trigger.
|
136 |
+
*
|
137 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the reminder <i>TriggerType</i>.
|
138 |
+
*/
|
139 |
+
public static final function TIME_TRIGGER_REMINDER_MAILING()
|
140 |
+
{
|
141 |
+
if(null === self::$TIME_TRIGGER_REMINDER_MAILING)
|
142 |
+
self::$TIME_TRIGGER_REMINDER_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 5 );
|
143 |
+
|
144 |
+
return self::$TIME_TRIGGER_REMINDER_MAILING;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Type constant for follow up trigger mailing. A follow up trigger mailing is sent every day to recipients for
|
149 |
+
* which the date in the attribute matches the current date (only negative offset). the follow up trigger is an
|
150 |
+
* attribute driven time trigger.
|
151 |
+
*
|
152 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the follow-up <i>TriggerType</i>.
|
153 |
+
*/
|
154 |
+
public static final function TIME_TRIGGER_FOLLOW_UP_MAILING()
|
155 |
+
{
|
156 |
+
if(null === self::$TIME_TRIGGER_FOLLOW_UP_MAILING)
|
157 |
+
self::$TIME_TRIGGER_FOLLOW_UP_MAILING = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 6 );;
|
158 |
+
|
159 |
+
return self::$TIME_TRIGGER_FOLLOW_UP_MAILING;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Type constant for an unknown trigger type. Indicates a version mismatch between API and server.
|
164 |
+
*
|
165 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the unknown <i>TriggerType</i>.
|
166 |
+
*/
|
167 |
+
public static final function UNKNOWN()
|
168 |
+
{
|
169 |
+
if(null === self::$UNKNOWN)
|
170 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_Descriptor_TriggerType( 7 );
|
171 |
+
|
172 |
+
return self::$UNKNOWN;
|
173 |
+
}
|
174 |
+
|
175 |
+
private $id;
|
176 |
+
|
177 |
+
|
178 |
+
private function __construct( $iId )
|
179 |
+
{
|
180 |
+
$this->id = $iId;
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Returns the ID of the <i>TriggerType</i>. The ID is used for transmission purposes and should not be used
|
186 |
+
* inside client code.
|
187 |
+
*
|
188 |
+
* @return int the ID of the <i>TriggerType</i>.
|
189 |
+
*/
|
190 |
+
public function getTypeId()
|
191 |
+
{
|
192 |
+
return $this->id;
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Returns a <i>bool</i> indicating whether the <i>TriggerType</i> is a time trigger type.
|
198 |
+
*
|
199 |
+
* @return <i>true</i> if the <i>TriggerType</i> is a time trigger type, <i>false</i> otherwise.
|
200 |
+
*/
|
201 |
+
public function isTimeTriggerType()
|
202 |
+
{
|
203 |
+
return $this === self::TIME_TRIGGER_ANNIVERSARY_MAILING() || $this === self::TIME_TRIGGER_BIRTHDAY_MAILING()
|
204 |
+
|| $this === self::TIME_TRIGGER_FOLLOW_UP_MAILING() || $this === self::TIME_TRIGGER_INTERVAL_MAILING()
|
205 |
+
|| $this === self::TIME_TRIGGER_REMINDER_MAILING();
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Returns a <i>bool</i> indicating whether the <i>TriggerType</i> is an attribute driven trigger type.
|
211 |
+
*
|
212 |
+
* @return <i>true</i> if the <i>TriggerType</i> is an attribute driven trigger type, icode>false</i>
|
213 |
+
* otherwise.
|
214 |
+
*/
|
215 |
+
public function isAttributeTriggerType()
|
216 |
+
{
|
217 |
+
return $this === self::TIME_TRIGGER_ANNIVERSARY_MAILING() || $this === self::TIME_TRIGGER_BIRTHDAY_MAILING()
|
218 |
+
|| $this === self::TIME_TRIGGER_FOLLOW_UP_MAILING() || $this === self::TIME_TRIGGER_REMINDER_MAILING();
|
219 |
+
}
|
220 |
+
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Returns the <i>TriggerType</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN type will
|
224 |
+
* be used. The ID is used for transmission purposes and should not be used inside client code.
|
225 |
+
*
|
226 |
+
* @param int $iId the ID of the <i>TriggerType</i> to retrieve.
|
227 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerType the <i>TriggerType</i> corresponding to the given ID.
|
228 |
+
*/
|
229 |
+
public static function byTypeId( $iId )
|
230 |
+
{
|
231 |
+
foreach( self::values() as $type )
|
232 |
+
{
|
233 |
+
if( $type->getTypeId() == $iId )
|
234 |
+
{
|
235 |
+
return $type;
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
return self::UNKNOWN();
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Returns an array containing all available <i>TriggerType</i>s including UNKNOWN.
|
244 |
+
*
|
245 |
+
* @return array an array containing all available <i>TriggerType</i>s including UNKNOWN.
|
246 |
+
*/
|
247 |
+
public static function values()
|
248 |
+
{
|
249 |
+
return array(self::ACTION_MAILING(), self::TIME_TRIGGER_INTERVAL_MAILING(), self::TIME_TRIGGER_BIRTHDAY_MAILING(),
|
250 |
+
self::TIME_TRIGGER_ANNIVERSARY_MAILING(), self::TIME_TRIGGER_REMINDER_MAILING(),
|
251 |
+
self::TIME_TRIGGER_FOLLOW_UP_MAILING(), self::UNKNOWN());
|
252 |
+
}
|
253 |
+
}
|
lib/Inx/Api/TriggerMailing/Descriptor/WeeklyTriggerIntervalBuilder.php
CHANGED
@@ -1,68 +1,68 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing_Descriptor
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder</i> is used to create a weekly trigger interval.
|
9 |
-
* The following settings are mandatory:
|
10 |
-
* <p/>
|
11 |
-
* <ul>
|
12 |
-
* <li><b>The interval count</b>: Specifies how many times the trigger will be fired. The trigger will be fired every X
|
13 |
-
* weeks where X is the interval count.</li>
|
14 |
-
* <li><b>The dispatch intervals</b>: Specifies the days on which the trigger will be fired. The following options are
|
15 |
-
* allowed:
|
16 |
-
* <ul>
|
17 |
-
* <li><i>MONDAY</i>: The trigger will be fired on Mondays.</li>
|
18 |
-
* <li><i>TUESDAY</i>: The trigger will be fired on Tuesdays.</li>
|
19 |
-
* <li><i>WEDNESDAY</i>: The trigger will be fired on Wednesday.</li>
|
20 |
-
* <li><i>THURSDAY</i>: The trigger will be fired on Thursdays.</li>
|
21 |
-
* <li><i>FRIDAY</i>: The trigger will be fired on Fridays.</li>
|
22 |
-
* <li><i>SATURDAY</i>: The trigger will be fired on Saturdays.</li>
|
23 |
-
* <li><i>SUNDAY</i>: The trigger will be fired on Sundays.</li>
|
24 |
-
* </ul>
|
25 |
-
* </li>
|
26 |
-
* </ul>
|
27 |
-
* There are no optional settings.
|
28 |
-
* <p/>
|
29 |
-
* The following snippet shows how to build a weekly trigger interval which will fire the trigger every two weeks on
|
30 |
-
* Mondays and Fridays:
|
31 |
-
*
|
32 |
-
* <pre>
|
33 |
-
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
34 |
-
* $interval = $factory->getWeeklyIntervalBuilder()->intervalCount( 2 )->dispatchIntervals(
|
35 |
-
* array( Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::MONDAY(),
|
36 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::FRIDAY() ) )->build();
|
37 |
-
* </pre>
|
38 |
-
*
|
39 |
-
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
40 |
-
* @since API 1.10.0
|
41 |
-
* @author chge, 17.07.2012
|
42 |
-
*/
|
43 |
-
interface Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder
|
44 |
-
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
45 |
-
{
|
46 |
-
/**
|
47 |
-
* Sets the <i>set</i> (implemented as array) of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
48 |
-
* which determines the dispatch intervals. This setting is mandatory. The following options are legal:
|
49 |
-
* <p/>
|
50 |
-
* <ul>
|
51 |
-
* <li><i>MONDAY</i>: The trigger will be fired on Mondays.
|
52 |
-
* <li><i>TUESDAY</i>: The trigger will be fired on Tuesdays.
|
53 |
-
* <li><i>WEDNESDAY</i>: The trigger will be fired on Wednesday.
|
54 |
-
* <li><i>THURSDAY</i>: The trigger will be fired on Thursdays.
|
55 |
-
* <li><i>FRIDAY</i>: The trigger will be fired on Fridays.
|
56 |
-
* <li><i>SATURDAY</i>: The trigger will be fired on Saturdays.
|
57 |
-
* <li><i>SUNDAY</i>: The trigger will be fired on Sundays.
|
58 |
-
* </ul>
|
59 |
-
* <p/>
|
60 |
-
* The dispatch interval set can be easily created using the array function.
|
61 |
-
*
|
62 |
-
* @param array $dispatchIntervals the <i>set</i> of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
63 |
-
* which determines the dispatch intervals.
|
64 |
-
* @return Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder the builder.
|
65 |
-
* @throws Inx_Api_IllegalArgumentException if the dispatch intervals contain a value not listed above.
|
66 |
-
*/
|
67 |
-
public function dispatchIntervals( array $dispatchIntervals );
|
68 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing_Descriptor
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder</i> is used to create a weekly trigger interval.
|
9 |
+
* The following settings are mandatory:
|
10 |
+
* <p/>
|
11 |
+
* <ul>
|
12 |
+
* <li><b>The interval count</b>: Specifies how many times the trigger will be fired. The trigger will be fired every X
|
13 |
+
* weeks where X is the interval count.</li>
|
14 |
+
* <li><b>The dispatch intervals</b>: Specifies the days on which the trigger will be fired. The following options are
|
15 |
+
* allowed:
|
16 |
+
* <ul>
|
17 |
+
* <li><i>MONDAY</i>: The trigger will be fired on Mondays.</li>
|
18 |
+
* <li><i>TUESDAY</i>: The trigger will be fired on Tuesdays.</li>
|
19 |
+
* <li><i>WEDNESDAY</i>: The trigger will be fired on Wednesday.</li>
|
20 |
+
* <li><i>THURSDAY</i>: The trigger will be fired on Thursdays.</li>
|
21 |
+
* <li><i>FRIDAY</i>: The trigger will be fired on Fridays.</li>
|
22 |
+
* <li><i>SATURDAY</i>: The trigger will be fired on Saturdays.</li>
|
23 |
+
* <li><i>SUNDAY</i>: The trigger will be fired on Sundays.</li>
|
24 |
+
* </ul>
|
25 |
+
* </li>
|
26 |
+
* </ul>
|
27 |
+
* There are no optional settings.
|
28 |
+
* <p/>
|
29 |
+
* The following snippet shows how to build a weekly trigger interval which will fire the trigger every two weeks on
|
30 |
+
* Mondays and Fridays:
|
31 |
+
*
|
32 |
+
* <pre>
|
33 |
+
* $factory = $session->getTriggerMailingManager()->getTriggerIntervalBuilderFactory();
|
34 |
+
* $interval = $factory->getWeeklyIntervalBuilder()->intervalCount( 2 )->dispatchIntervals(
|
35 |
+
* array( Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::MONDAY(),
|
36 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval::FRIDAY() ) )->build();
|
37 |
+
* </pre>
|
38 |
+
*
|
39 |
+
* @see Inx_Api_TriggerMailing_Descriptor_TriggerInterval
|
40 |
+
* @since API 1.10.0
|
41 |
+
* @author chge, 17.07.2012
|
42 |
+
*/
|
43 |
+
interface Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder
|
44 |
+
extends Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilder
|
45 |
+
{
|
46 |
+
/**
|
47 |
+
* Sets the <i>set</i> (implemented as array) of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
48 |
+
* which determines the dispatch intervals. This setting is mandatory. The following options are legal:
|
49 |
+
* <p/>
|
50 |
+
* <ul>
|
51 |
+
* <li><i>MONDAY</i>: The trigger will be fired on Mondays.
|
52 |
+
* <li><i>TUESDAY</i>: The trigger will be fired on Tuesdays.
|
53 |
+
* <li><i>WEDNESDAY</i>: The trigger will be fired on Wednesday.
|
54 |
+
* <li><i>THURSDAY</i>: The trigger will be fired on Thursdays.
|
55 |
+
* <li><i>FRIDAY</i>: The trigger will be fired on Fridays.
|
56 |
+
* <li><i>SATURDAY</i>: The trigger will be fired on Saturdays.
|
57 |
+
* <li><i>SUNDAY</i>: The trigger will be fired on Sundays.
|
58 |
+
* </ul>
|
59 |
+
* <p/>
|
60 |
+
* The dispatch interval set can be easily created using the array function.
|
61 |
+
*
|
62 |
+
* @param array $dispatchIntervals the <i>set</i> of <i>Inx_Api_TriggerMailing_Descriptor_TimeTriggerDispatchInterval</i>s
|
63 |
+
* which determines the dispatch intervals.
|
64 |
+
* @return Inx_Api_TriggerMailing_Descriptor_WeeklyTriggerIntervalBuilder the builder.
|
65 |
+
* @throws Inx_Api_IllegalArgumentException if the dispatch intervals contain a value not listed above.
|
66 |
+
*/
|
67 |
+
public function dispatchIntervals( array $dispatchIntervals );
|
68 |
}
|
lib/Inx/Api/TriggerMailing/FilterConcatenationType.php
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_FilterConcatenationType</i> enumeration defines the different ways in
|
9 |
-
* which filters (target groups) can be combined.
|
10 |
-
* <p>
|
11 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
12 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
13 |
-
* purpose similar to integer constants.
|
14 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
15 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
16 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
17 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
18 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
19 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
20 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
21 |
-
*
|
22 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
23 |
-
* @since API 1.10.0
|
24 |
-
* @author chge, 16.07.2012
|
25 |
-
*/
|
26 |
-
final class Inx_Api_TriggerMailing_FilterConcatenationType
|
27 |
-
{
|
28 |
-
private static $FILTER_AND = null;
|
29 |
-
|
30 |
-
private static $FILTER_OR = null;
|
31 |
-
|
32 |
-
private static $FILTER_NOT_IN = null;
|
33 |
-
|
34 |
-
private static $UNKNOWN = null;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Filter constant for the AND operator. The AND operator requires a recipient to be a member of all filters (target
|
38 |
-
* groups) defined by <i>TriggerMailing::getFilderIds()</i>.
|
39 |
-
*
|
40 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
41 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
42 |
-
*/
|
43 |
-
public static final function FILTER_AND()
|
44 |
-
{
|
45 |
-
if(null === self::$FILTER_AND)
|
46 |
-
self::$FILTER_AND = new Inx_Api_TriggerMailing_FilterConcatenationType( 1 );
|
47 |
-
|
48 |
-
return self::$FILTER_AND;
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Filter constant for the OR operator. The OR operator requires a recipient to be a member of a least one filter
|
53 |
-
* (target group) defined by <i>TriggerMailing::getFilderIds()</i>.
|
54 |
-
*
|
55 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
56 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
57 |
-
*/
|
58 |
-
public static final function FILTER_OR()
|
59 |
-
{
|
60 |
-
if(null === self::$FILTER_OR)
|
61 |
-
self::$FILTER_OR = new Inx_Api_TriggerMailing_FilterConcatenationType( 2 );
|
62 |
-
|
63 |
-
return self::$FILTER_OR;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Filter constant for the NOT IN operator. The NOT IN operator requires a recipient to not be a member of all
|
68 |
-
* filters (target groups) defined by <i>TriggerMailing::getFilderIds()</i>.
|
69 |
-
*
|
70 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
71 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
72 |
-
*/
|
73 |
-
public static final function FILTER_NOT_IN()
|
74 |
-
{
|
75 |
-
if(null === self::$FILTER_NOT_IN)
|
76 |
-
self::$FILTER_NOT_IN = new Inx_Api_TriggerMailing_FilterConcatenationType( 3 );
|
77 |
-
|
78 |
-
return self::$FILTER_NOT_IN;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Filter constant for an unknown filter concatenation type. This type indicates a version mismatch between API and
|
83 |
-
* server.
|
84 |
-
*
|
85 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
86 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
87 |
-
*/
|
88 |
-
public static final function UNKNOWN()
|
89 |
-
{
|
90 |
-
if(null === self::$UNKNOWN)
|
91 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_FilterConcatenationType( -1 );
|
92 |
-
|
93 |
-
return self::$UNKNOWN;
|
94 |
-
}
|
95 |
-
|
96 |
-
private $id;
|
97 |
-
|
98 |
-
|
99 |
-
private function __construct( $iId )
|
100 |
-
{
|
101 |
-
$this->id = $iId;
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Returns the ID of the <i>FilterConcatenationTypeicode>. The ID is used for transmission purposes and should
|
107 |
-
* not be used inside client code.
|
108 |
-
*
|
109 |
-
* @return int the ID of the <i>FilterConcatenationType</i>.
|
110 |
-
*/
|
111 |
-
public function getId()
|
112 |
-
{
|
113 |
-
return $this->id;
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Returns the <i>FilterConcatenationType</i> corresponding to the given id. If the id is unknown, the
|
119 |
-
* <i>UNKNOWN</i> type will be returned. The ID is used for transmission purposes and should not be used
|
120 |
-
* inside client code.
|
121 |
-
*
|
122 |
-
* @param int $iId the ID of the <i>FilterConcatenationType</i> to retrieve.
|
123 |
-
* @return Inx_Api_TriggerMailing_FilterConcatenationType the <i>FilterConcatenationType</i> corresponding
|
124 |
-
* to the given ID.
|
125 |
-
*/
|
126 |
-
public static function byId( $iId )
|
127 |
-
{
|
128 |
-
foreach( self::values() as $type )
|
129 |
-
{
|
130 |
-
if( $type->getId() == $iId )
|
131 |
-
{
|
132 |
-
return $type;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
return self::UNKNOWN();
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Returns an array containing all available <i>FilterConcatenationType</i>s including UNKNOWN.
|
141 |
-
*
|
142 |
-
* @return array an array containing all available <i>FilterConcatenationType</i>s including UNKNOWN.
|
143 |
-
*/
|
144 |
-
public static function values()
|
145 |
-
{
|
146 |
-
return array(self::FILTER_AND(), self::FILTER_OR(), self::FILTER_NOT_IN(), self::UNKNOWN());
|
147 |
-
}
|
148 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_FilterConcatenationType</i> enumeration defines the different ways in
|
9 |
+
* which filters (target groups) can be combined.
|
10 |
+
* <p>
|
11 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
12 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
13 |
+
* purpose similar to integer constants.
|
14 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
15 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
16 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
17 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
18 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
19 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
20 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
21 |
+
*
|
22 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
23 |
+
* @since API 1.10.0
|
24 |
+
* @author chge, 16.07.2012
|
25 |
+
*/
|
26 |
+
final class Inx_Api_TriggerMailing_FilterConcatenationType
|
27 |
+
{
|
28 |
+
private static $FILTER_AND = null;
|
29 |
+
|
30 |
+
private static $FILTER_OR = null;
|
31 |
+
|
32 |
+
private static $FILTER_NOT_IN = null;
|
33 |
+
|
34 |
+
private static $UNKNOWN = null;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Filter constant for the AND operator. The AND operator requires a recipient to be a member of all filters (target
|
38 |
+
* groups) defined by <i>TriggerMailing::getFilderIds()</i>.
|
39 |
+
*
|
40 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
41 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
42 |
+
*/
|
43 |
+
public static final function FILTER_AND()
|
44 |
+
{
|
45 |
+
if(null === self::$FILTER_AND)
|
46 |
+
self::$FILTER_AND = new Inx_Api_TriggerMailing_FilterConcatenationType( 1 );
|
47 |
+
|
48 |
+
return self::$FILTER_AND;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Filter constant for the OR operator. The OR operator requires a recipient to be a member of a least one filter
|
53 |
+
* (target group) defined by <i>TriggerMailing::getFilderIds()</i>.
|
54 |
+
*
|
55 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
56 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
57 |
+
*/
|
58 |
+
public static final function FILTER_OR()
|
59 |
+
{
|
60 |
+
if(null === self::$FILTER_OR)
|
61 |
+
self::$FILTER_OR = new Inx_Api_TriggerMailing_FilterConcatenationType( 2 );
|
62 |
+
|
63 |
+
return self::$FILTER_OR;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Filter constant for the NOT IN operator. The NOT IN operator requires a recipient to not be a member of all
|
68 |
+
* filters (target groups) defined by <i>TriggerMailing::getFilderIds()</i>.
|
69 |
+
*
|
70 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
71 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
72 |
+
*/
|
73 |
+
public static final function FILTER_NOT_IN()
|
74 |
+
{
|
75 |
+
if(null === self::$FILTER_NOT_IN)
|
76 |
+
self::$FILTER_NOT_IN = new Inx_Api_TriggerMailing_FilterConcatenationType( 3 );
|
77 |
+
|
78 |
+
return self::$FILTER_NOT_IN;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Filter constant for an unknown filter concatenation type. This type indicates a version mismatch between API and
|
83 |
+
* server.
|
84 |
+
*
|
85 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilderIds()
|
86 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing::getFilterConcatinationType()
|
87 |
+
*/
|
88 |
+
public static final function UNKNOWN()
|
89 |
+
{
|
90 |
+
if(null === self::$UNKNOWN)
|
91 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_FilterConcatenationType( -1 );
|
92 |
+
|
93 |
+
return self::$UNKNOWN;
|
94 |
+
}
|
95 |
+
|
96 |
+
private $id;
|
97 |
+
|
98 |
+
|
99 |
+
private function __construct( $iId )
|
100 |
+
{
|
101 |
+
$this->id = $iId;
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Returns the ID of the <i>FilterConcatenationTypeicode>. The ID is used for transmission purposes and should
|
107 |
+
* not be used inside client code.
|
108 |
+
*
|
109 |
+
* @return int the ID of the <i>FilterConcatenationType</i>.
|
110 |
+
*/
|
111 |
+
public function getId()
|
112 |
+
{
|
113 |
+
return $this->id;
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Returns the <i>FilterConcatenationType</i> corresponding to the given id. If the id is unknown, the
|
119 |
+
* <i>UNKNOWN</i> type will be returned. The ID is used for transmission purposes and should not be used
|
120 |
+
* inside client code.
|
121 |
+
*
|
122 |
+
* @param int $iId the ID of the <i>FilterConcatenationType</i> to retrieve.
|
123 |
+
* @return Inx_Api_TriggerMailing_FilterConcatenationType the <i>FilterConcatenationType</i> corresponding
|
124 |
+
* to the given ID.
|
125 |
+
*/
|
126 |
+
public static function byId( $iId )
|
127 |
+
{
|
128 |
+
foreach( self::values() as $type )
|
129 |
+
{
|
130 |
+
if( $type->getId() == $iId )
|
131 |
+
{
|
132 |
+
return $type;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
return self::UNKNOWN();
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Returns an array containing all available <i>FilterConcatenationType</i>s including UNKNOWN.
|
141 |
+
*
|
142 |
+
* @return array an array containing all available <i>FilterConcatenationType</i>s including UNKNOWN.
|
143 |
+
*/
|
144 |
+
public static function values()
|
145 |
+
{
|
146 |
+
return array(self::FILTER_AND(), self::FILTER_OR(), self::FILTER_NOT_IN(), self::UNKNOWN());
|
147 |
+
}
|
148 |
+
}
|
lib/Inx/Api/TriggerMailing/SendException.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_TriggerMailing_SendException</i> is thrown when an error occurs while sending
|
9 |
-
* a trigger mailing.
|
10 |
-
*
|
11 |
-
* @since API 1.10.0
|
12 |
-
* @author chge, 16.07.2012
|
13 |
-
*/
|
14 |
-
class Inx_Api_TriggerMailing_SendException extends Exception
|
15 |
-
{
|
16 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_TriggerMailing_SendException</i> is thrown when an error occurs while sending
|
9 |
+
* a trigger mailing.
|
10 |
+
*
|
11 |
+
* @since API 1.10.0
|
12 |
+
* @author chge, 16.07.2012
|
13 |
+
*/
|
14 |
+
class Inx_Api_TriggerMailing_SendException extends Exception
|
15 |
+
{
|
16 |
+
}
|
lib/Inx/Api/TriggerMailing/StateFilter.php
CHANGED
@@ -1,79 +1,79 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_TriggerMailing_StateFilter</i> is used to retrieve trigger mailings according to their state.
|
9 |
-
* The <i>StateFilter</i> combines two different state types:
|
10 |
-
* <ul>
|
11 |
-
* <li><b>The mailing state:</b> Used to retrieve mailings in one or more states.
|
12 |
-
* <li><b>The trigger state:</b> Used to retrieve mailings whose trigger is in a particular state.
|
13 |
-
* </ul>
|
14 |
-
* Neither type is mandatory to be set. It is possible to create a <i>StateFilter</i> that matches all mailing
|
15 |
-
* states and/or all trigger states. Omitting both states will result in an all matching <i>StateFilter</i>. This
|
16 |
-
* special filter is used to retrieve all trigger mailings of a specific list, disregarding their state, and can be
|
17 |
-
* obtained using the <i>TriggerMailingManager::createAllMatchingStateFilter()</i> method which will return a singleton.
|
18 |
-
* <p>
|
19 |
-
* For an example on how to use <i>StateFilter</i>s, see the <i>TriggerMailingManager</i> documentation.
|
20 |
-
*
|
21 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
22 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
23 |
-
* $iOrderType = null, $sFilter = null )
|
24 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::createStateFilter( array $mailingStateFilter = null,
|
25 |
-
Inx_Api_TriggerMailing_TriggerState $triggerStateFilter = null )
|
26 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingState
|
27 |
-
* @see Inx_Api_TriggerMailing_TriggerState
|
28 |
-
* @since API 1.10.0
|
29 |
-
* @author chge, 16.07.2012
|
30 |
-
*/
|
31 |
-
interface Inx_Api_TriggerMailing_StateFilter
|
32 |
-
{
|
33 |
-
/**
|
34 |
-
* Returns the <i>Inx_Api_TriggerMailing_TriggerMailingState</i>s this <i>StateFilter</i> matches. May be <i>null</i>,
|
35 |
-
* indicating that this <i>StateFilter</i> matches any <i>TriggerMailingState</i>.
|
36 |
-
*
|
37 |
-
* @return array the <i>TriggerMailingState</i>s this <i>StateFilter</i> matches, or <i>null</i> if it
|
38 |
-
* matches any <i>TriggerMailingState</i>.
|
39 |
-
*/
|
40 |
-
public function getMailingStateFilter();
|
41 |
-
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Returns the <i>Inx_Api_TriggerMailing_TriggerState</i> this <i>StateFilter</i> matches. May be <i>nullitt>,
|
45 |
-
* indicating that this <i>StateFilter</i> matches any <i>TriggerState</i>.
|
46 |
-
*
|
47 |
-
* @return Inx_Api_TriggerMailing_TriggerState the <i>TriggerState</i> this <i>StateFilter</i> matches, or <i>null</i>
|
48 |
-
* if it matches any <i>TriggerState</i>.
|
49 |
-
*/
|
50 |
-
public function getTriggerStateFilter();
|
51 |
-
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any mailing and trigger
|
55 |
-
* state. If it does, it is equivalent to the all matching <i>StateFilter</i> provided by
|
56 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailingManager::createAllMatchingStateFilter()</i>.
|
57 |
-
*
|
58 |
-
* @return bool <i>true</i> if this <i>StateFilter</i> matches any state, <i>false</i> otherwise.
|
59 |
-
*/
|
60 |
-
public function matchesAllStates();
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any <i>TriggerMailingState</i>.
|
65 |
-
*
|
66 |
-
* @return bool <i>true</i> if this <i>StateFilter</i> matches any <i>TriggerMailingState</i> state,
|
67 |
-
* <i>false</i> otherwise.
|
68 |
-
*/
|
69 |
-
public function matchesAllMailingStates();
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any <i>TriggerState</i>.
|
74 |
-
*
|
75 |
-
* @return bool <i>true</i> if this <i>StateFilter</i> matches any <i>TriggerState</i> state,
|
76 |
-
* <i>false</i> otherwise.
|
77 |
-
*/
|
78 |
-
public function matchesAllTriggerStates();
|
79 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_TriggerMailing_StateFilter</i> is used to retrieve trigger mailings according to their state.
|
9 |
+
* The <i>StateFilter</i> combines two different state types:
|
10 |
+
* <ul>
|
11 |
+
* <li><b>The mailing state:</b> Used to retrieve mailings in one or more states.
|
12 |
+
* <li><b>The trigger state:</b> Used to retrieve mailings whose trigger is in a particular state.
|
13 |
+
* </ul>
|
14 |
+
* Neither type is mandatory to be set. It is possible to create a <i>StateFilter</i> that matches all mailing
|
15 |
+
* states and/or all trigger states. Omitting both states will result in an all matching <i>StateFilter</i>. This
|
16 |
+
* special filter is used to retrieve all trigger mailings of a specific list, disregarding their state, and can be
|
17 |
+
* obtained using the <i>TriggerMailingManager::createAllMatchingStateFilter()</i> method which will return a singleton.
|
18 |
+
* <p>
|
19 |
+
* For an example on how to use <i>StateFilter</i>s, see the <i>TriggerMailingManager</i> documentation.
|
20 |
+
*
|
21 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
22 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
23 |
+
* $iOrderType = null, $sFilter = null )
|
24 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::createStateFilter( array $mailingStateFilter = null,
|
25 |
+
Inx_Api_TriggerMailing_TriggerState $triggerStateFilter = null )
|
26 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingState
|
27 |
+
* @see Inx_Api_TriggerMailing_TriggerState
|
28 |
+
* @since API 1.10.0
|
29 |
+
* @author chge, 16.07.2012
|
30 |
+
*/
|
31 |
+
interface Inx_Api_TriggerMailing_StateFilter
|
32 |
+
{
|
33 |
+
/**
|
34 |
+
* Returns the <i>Inx_Api_TriggerMailing_TriggerMailingState</i>s this <i>StateFilter</i> matches. May be <i>null</i>,
|
35 |
+
* indicating that this <i>StateFilter</i> matches any <i>TriggerMailingState</i>.
|
36 |
+
*
|
37 |
+
* @return array the <i>TriggerMailingState</i>s this <i>StateFilter</i> matches, or <i>null</i> if it
|
38 |
+
* matches any <i>TriggerMailingState</i>.
|
39 |
+
*/
|
40 |
+
public function getMailingStateFilter();
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Returns the <i>Inx_Api_TriggerMailing_TriggerState</i> this <i>StateFilter</i> matches. May be <i>nullitt>,
|
45 |
+
* indicating that this <i>StateFilter</i> matches any <i>TriggerState</i>.
|
46 |
+
*
|
47 |
+
* @return Inx_Api_TriggerMailing_TriggerState the <i>TriggerState</i> this <i>StateFilter</i> matches, or <i>null</i>
|
48 |
+
* if it matches any <i>TriggerState</i>.
|
49 |
+
*/
|
50 |
+
public function getTriggerStateFilter();
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any mailing and trigger
|
55 |
+
* state. If it does, it is equivalent to the all matching <i>StateFilter</i> provided by
|
56 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailingManager::createAllMatchingStateFilter()</i>.
|
57 |
+
*
|
58 |
+
* @return bool <i>true</i> if this <i>StateFilter</i> matches any state, <i>false</i> otherwise.
|
59 |
+
*/
|
60 |
+
public function matchesAllStates();
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any <i>TriggerMailingState</i>.
|
65 |
+
*
|
66 |
+
* @return bool <i>true</i> if this <i>StateFilter</i> matches any <i>TriggerMailingState</i> state,
|
67 |
+
* <i>false</i> otherwise.
|
68 |
+
*/
|
69 |
+
public function matchesAllMailingStates();
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns a <i>bool</i> indicating whether this <i>StateFilter</i> matches any <i>TriggerState</i>.
|
74 |
+
*
|
75 |
+
* @return bool <i>true</i> if this <i>StateFilter</i> matches any <i>TriggerState</i> state,
|
76 |
+
* <i>false</i> otherwise.
|
77 |
+
*/
|
78 |
+
public function matchesAllTriggerStates();
|
79 |
+
}
|
lib/Inx/Api/TriggerMailing/TriggerMailingAttribute.php
CHANGED
@@ -1,476 +1,476 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>TriggerMailingAttribute</i> enumeration defines the attributes of trigger mailings which are used for
|
9 |
-
* the ordering of result sets and to identify the error source of an <i>Inx_Api_UpdateException</i>.
|
10 |
-
* <p>
|
11 |
-
* To find out if an attribute may be used for ordering, call the <i>isOrderAttribute()</i> method.
|
12 |
-
*<p>
|
13 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
14 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
15 |
-
* purpose similar to integer constants.
|
16 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
17 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
18 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
19 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
20 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
21 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
22 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
23 |
-
*
|
24 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
25 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
26 |
-
* $iOrderType = null, $sFilter = null )
|
27 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
28 |
-
* @since API 1.10.0
|
29 |
-
* @author chge, 13.07.2012
|
30 |
-
*/
|
31 |
-
final class Inx_Api_TriggerMailing_TriggerMailingAttribute
|
32 |
-
{
|
33 |
-
private static $INTERNAL_MAILING_LIST_ID = null;
|
34 |
-
|
35 |
-
private static $INTERNAL_MAILING_FEATURE_ID = null;
|
36 |
-
|
37 |
-
private static $INTERNAL_MAILING_CONTENT_MAIL_TYPE = null;
|
38 |
-
|
39 |
-
private static $SUBJECT = null;
|
40 |
-
|
41 |
-
private static $PLAIN_TEXT = null;
|
42 |
-
|
43 |
-
private static $HTML_TEXT = null;
|
44 |
-
|
45 |
-
private static $XML_CONTENT = null;
|
46 |
-
|
47 |
-
private static $PLAIN_TEXT_XSL = null;
|
48 |
-
|
49 |
-
private static $HTML_TEXT_XSL = null;
|
50 |
-
|
51 |
-
private static $FILTER_ID = null;
|
52 |
-
|
53 |
-
private static $SENDER_ADDRESS = null;
|
54 |
-
|
55 |
-
private static $RECIPIENT_ADDRESS = null;
|
56 |
-
|
57 |
-
private static $REPLY_TO_ADDRESS = null;
|
58 |
-
|
59 |
-
private static $PRIORITY = null;
|
60 |
-
|
61 |
-
private static $MODIFICATION_DATETIME = null;
|
62 |
-
|
63 |
-
private static $STYLE = null;
|
64 |
-
|
65 |
-
private static $ACTIVATION_DATETIME = null;
|
66 |
-
|
67 |
-
private static $SINGLE_SEND_COUNT = null;
|
68 |
-
|
69 |
-
private static $NAME = null;
|
70 |
-
|
71 |
-
private static $DESCRIPTOR = null;
|
72 |
-
|
73 |
-
private static $DEFAULT_ATTRIBUTE = null;
|
74 |
-
|
75 |
-
private static $UNKNOWN = null;
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Constant for the mailing list id attribute. This constant is used internally only.
|
79 |
-
*
|
80 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing list id attribute.
|
81 |
-
*/
|
82 |
-
public static final function INTERNAL_MAILING_LIST_ID()
|
83 |
-
{
|
84 |
-
if(null === self::$INTERNAL_MAILING_LIST_ID)
|
85 |
-
self::$INTERNAL_MAILING_LIST_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 0, false );
|
86 |
-
|
87 |
-
return self::$INTERNAL_MAILING_LIST_ID;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Constant for the mailing content (MIME) type attribute. This constant is used internally only.
|
92 |
-
*
|
93 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing content type attribute.
|
94 |
-
*/
|
95 |
-
public static final function INTERNAL_MAILING_CONTENT_MAIL_TYPE()
|
96 |
-
{
|
97 |
-
if(null === self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE)
|
98 |
-
self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 1, false );
|
99 |
-
|
100 |
-
return self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Constant for the mailing feature id. This constant is used internally only.
|
105 |
-
*
|
106 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing feature id attribute.
|
107 |
-
*/
|
108 |
-
public static final function INTERNAL_MAILING_FEATURE_ID()
|
109 |
-
{
|
110 |
-
if(null === self::$INTERNAL_MAILING_FEATURE_ID)
|
111 |
-
self::$INTERNAL_MAILING_FEATURE_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 2, false );
|
112 |
-
|
113 |
-
return self::$INTERNAL_MAILING_FEATURE_ID;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Constant for the subject attribute. Used for ordering by the <i>TriggerMailingManager</i>.
|
118 |
-
*
|
119 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the subject attribute.
|
120 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
121 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
122 |
-
* $iOrderType = null, $sFilter = null )
|
123 |
-
*/
|
124 |
-
public static final function SUBJECT()
|
125 |
-
{
|
126 |
-
if(null === self::$SUBJECT)
|
127 |
-
self::$SUBJECT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 3, true );
|
128 |
-
|
129 |
-
return self::$SUBJECT;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Constant for the plain text attribute.
|
134 |
-
*
|
135 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the plain text attribute.
|
136 |
-
*/
|
137 |
-
public static final function PLAIN_TEXT()
|
138 |
-
{
|
139 |
-
if(null === self::$PLAIN_TEXT)
|
140 |
-
self::$PLAIN_TEXT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 4, false );
|
141 |
-
|
142 |
-
return self::$PLAIN_TEXT;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Constant for the HTML text attribute.
|
147 |
-
*
|
148 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the HTML text attribute.
|
149 |
-
*/
|
150 |
-
public static final function HTML_TEXT()
|
151 |
-
{
|
152 |
-
if(null === self::$HTML_TEXT)
|
153 |
-
self::$HTML_TEXT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 5, false );;
|
154 |
-
|
155 |
-
return self::$HTML_TEXT;
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Constant for the XML content attribute.
|
160 |
-
*
|
161 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the XML content attribute.
|
162 |
-
*/
|
163 |
-
public static final function XML_CONTENT()
|
164 |
-
{
|
165 |
-
if(null === self::$XML_CONTENT)
|
166 |
-
self::$XML_CONTENT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 6, false );
|
167 |
-
|
168 |
-
return self::$XML_CONTENT;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Constant for the plain text style XML content attribute.
|
173 |
-
*
|
174 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the plain text style XML content attribute.
|
175 |
-
*/
|
176 |
-
public static final function PLAIN_TEXT_XSL()
|
177 |
-
{
|
178 |
-
if(null === self::$PLAIN_TEXT_XSL)
|
179 |
-
self::$PLAIN_TEXT_XSL = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 7, false );
|
180 |
-
|
181 |
-
return self::$PLAIN_TEXT_XSL;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Constant for the HTML text style XML content attribute.
|
186 |
-
*
|
187 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the HTML text style XML content attribute.
|
188 |
-
*/
|
189 |
-
public static final function HTML_TEXT_XSL()
|
190 |
-
{
|
191 |
-
if(null === self::$HTML_TEXT_XSL)
|
192 |
-
self::$HTML_TEXT_XSL = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 8, false );
|
193 |
-
|
194 |
-
return self::$HTML_TEXT_XSL;
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Constant for the filter id attribute.
|
199 |
-
*
|
200 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the filter id attribute.
|
201 |
-
*/
|
202 |
-
public static final function FILTER_ID()
|
203 |
-
{
|
204 |
-
if(null === self::$FILTER_ID)
|
205 |
-
self::$FILTER_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 9, false );
|
206 |
-
|
207 |
-
return self::$FILTER_ID;
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Constant for the sender address attribute.
|
212 |
-
*
|
213 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the sender address attribute.
|
214 |
-
*/
|
215 |
-
public static final function SENDER_ADDRESS()
|
216 |
-
{
|
217 |
-
if(null === self::$SENDER_ADDRESS)
|
218 |
-
self::$SENDER_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 10, false );
|
219 |
-
|
220 |
-
return self::$SENDER_ADDRESS;
|
221 |
-
}
|
222 |
-
|
223 |
-
/**
|
224 |
-
* Constant for the recipient address attribute.
|
225 |
-
*
|
226 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the recipient address attribute.
|
227 |
-
*/
|
228 |
-
public static final function RECIPIENT_ADDRESS()
|
229 |
-
{
|
230 |
-
if(null === self::$RECIPIENT_ADDRESS)
|
231 |
-
self::$RECIPIENT_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 11, false );
|
232 |
-
|
233 |
-
return self::$RECIPIENT_ADDRESS;
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Constant for the reply address attribute.
|
238 |
-
*
|
239 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the reply address attribute.
|
240 |
-
*/
|
241 |
-
public static final function REPLY_TO_ADDRESS()
|
242 |
-
{
|
243 |
-
if(null === self::$REPLY_TO_ADDRESS)
|
244 |
-
self::$REPLY_TO_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 12, false );
|
245 |
-
|
246 |
-
return self::$REPLY_TO_ADDRESS;
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Constant for the priority attribute.
|
251 |
-
*
|
252 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the priority attribute.
|
253 |
-
*/
|
254 |
-
public static final function PRIORITY()
|
255 |
-
{
|
256 |
-
if(null === self::$PRIORITY)
|
257 |
-
self::$PRIORITY = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 13, false );
|
258 |
-
|
259 |
-
return self::$PRIORITY;
|
260 |
-
}
|
261 |
-
|
262 |
-
/**
|
263 |
-
* Constant for the modification datetime attribute. Used for ordering by the <i>TriggerMailingManager</i>.
|
264 |
-
*
|
265 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the modification datetime attribute.
|
266 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
267 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
268 |
-
* $iOrderType = null, $sFilter = null )
|
269 |
-
*/
|
270 |
-
public static final function MODIFICATION_DATETIME()
|
271 |
-
{
|
272 |
-
if(null === self::$MODIFICATION_DATETIME)
|
273 |
-
self::$MODIFICATION_DATETIME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 14, true );
|
274 |
-
|
275 |
-
return self::$MODIFICATION_DATETIME;
|
276 |
-
}
|
277 |
-
|
278 |
-
/**
|
279 |
-
* Constant for the style attribute. Used by the <i>UpdateException</i> to identify the error source.
|
280 |
-
*
|
281 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the style attribute.
|
282 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
283 |
-
*/
|
284 |
-
public static final function STYLE()
|
285 |
-
{
|
286 |
-
if(null === self::$STYLE)
|
287 |
-
self::$STYLE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 15, false );
|
288 |
-
|
289 |
-
return self::$STYLE;
|
290 |
-
}
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Constant for the activation datetime attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
294 |
-
*
|
295 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the activation datetime attribute.
|
296 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
297 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
298 |
-
* $iOrderType = null, $sFilter = null )
|
299 |
-
*/
|
300 |
-
public static final function ACTIVATION_DATETIME()
|
301 |
-
{
|
302 |
-
if(null === self::$ACTIVATION_DATETIME)
|
303 |
-
self::$ACTIVATION_DATETIME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 16, true );
|
304 |
-
|
305 |
-
return self::$ACTIVATION_DATETIME;
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Constant for the single send count attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
310 |
-
*
|
311 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the single send count attribute.
|
312 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
313 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
314 |
-
* $iOrderType = null, $sFilter = null )
|
315 |
-
*/
|
316 |
-
public static final function SINGLE_SEND_COUNT()
|
317 |
-
{
|
318 |
-
if(null === self::$SINGLE_SEND_COUNT)
|
319 |
-
self::$SINGLE_SEND_COUNT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 17, true );
|
320 |
-
|
321 |
-
return self::$SINGLE_SEND_COUNT;
|
322 |
-
}
|
323 |
-
|
324 |
-
/**
|
325 |
-
* Constant for the name attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
326 |
-
*
|
327 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the name attribute.
|
328 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
329 |
-
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
330 |
-
* $iOrderType = null, $sFilter = null )
|
331 |
-
*/
|
332 |
-
public static final function NAME()
|
333 |
-
{
|
334 |
-
if(null === self::$NAME)
|
335 |
-
self::$NAME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 18, true );
|
336 |
-
|
337 |
-
return self::$NAME;
|
338 |
-
}
|
339 |
-
|
340 |
-
/**
|
341 |
-
* Constant for the trigger descriptor attribute. Used by the <i>UpdateException</i> to identify the error
|
342 |
-
* source.
|
343 |
-
*
|
344 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the descriptor attribute.
|
345 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
346 |
-
*/
|
347 |
-
public static final function DESCRIPTOR()
|
348 |
-
{
|
349 |
-
if(null === self::$DESCRIPTOR)
|
350 |
-
self::$DESCRIPTOR = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 19, false );
|
351 |
-
|
352 |
-
return self::$DESCRIPTOR;
|
353 |
-
}
|
354 |
-
|
355 |
-
/**
|
356 |
-
* The default attribute used for ordering and as error source if no specific attribute is known or given.
|
357 |
-
*
|
358 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the default attribute.
|
359 |
-
*/
|
360 |
-
public static final function DEFAULT_ATTRIBUTE()
|
361 |
-
{
|
362 |
-
if(null === self::$DEFAULT_ATTRIBUTE)
|
363 |
-
self::$DEFAULT_ATTRIBUTE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( -1, true );
|
364 |
-
|
365 |
-
return self::$DEFAULT_ATTRIBUTE;
|
366 |
-
}
|
367 |
-
|
368 |
-
/**
|
369 |
-
* Constant for an unknown attribute. This attribute indicates a version mismatch between API and server. It might
|
370 |
-
* be used by the <i>UpdateException</i> to identify the error source.
|
371 |
-
*
|
372 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the unknown attribute.
|
373 |
-
* @see Inx_Api_UpdateException::getErrorSource()
|
374 |
-
*/
|
375 |
-
public static final function UNKNOWN()
|
376 |
-
{
|
377 |
-
if(null === self::$UNKNOWN)
|
378 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerMailingAttribute( -2, false );
|
379 |
-
|
380 |
-
return self::$UNKNOWN;
|
381 |
-
}
|
382 |
-
|
383 |
-
private $id;
|
384 |
-
|
385 |
-
private $isOrderAttribute;
|
386 |
-
|
387 |
-
|
388 |
-
private function __construct( $iId, $blIsOrderAttribute )
|
389 |
-
{
|
390 |
-
$this->id = $iId;
|
391 |
-
$this->isOrderAttribute = $blIsOrderAttribute;
|
392 |
-
}
|
393 |
-
|
394 |
-
|
395 |
-
/**
|
396 |
-
* Returns the ID of the <i>TriggerMailingAttribute</i>. The ID is used for transmission purposes and should
|
397 |
-
* not be used inside client code.
|
398 |
-
*
|
399 |
-
* @return int the ID of the <i>TriggerMailingAttribute</i>.
|
400 |
-
*/
|
401 |
-
public function getId()
|
402 |
-
{
|
403 |
-
return $this->id;
|
404 |
-
}
|
405 |
-
|
406 |
-
|
407 |
-
/**
|
408 |
-
* Returns a <i>bool</i> indicating if this <i>TriggerMailingAttribute</i> can be used for ordering
|
409 |
-
* of result sets.
|
410 |
-
*
|
411 |
-
* @return bool <i>true</i> if this attribute can be used for ordering, <i>false</i> otherwise.
|
412 |
-
*/
|
413 |
-
public function isOrderAttribute()
|
414 |
-
{
|
415 |
-
return $this->isOrderAttribute;
|
416 |
-
}
|
417 |
-
|
418 |
-
|
419 |
-
/**
|
420 |
-
* Returns the <i>TriggerMailingAttribute</i> corresponding to the given id. If the id is unknown, the
|
421 |
-
* <i>UNKNOWN</i> attribute will be returned. The ID is used for transmission purposes and should not be used
|
422 |
-
* inside client code.
|
423 |
-
*
|
424 |
-
* @param int $iId the ID of the <i>TriggerMailingAttribute</i> to retrieve.
|
425 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the <i>TriggerMailingAttribute</i> corresponding to
|
426 |
-
* the given ID.
|
427 |
-
*/
|
428 |
-
public static function byId( $iId )
|
429 |
-
{
|
430 |
-
foreach( self::values() as $attribute )
|
431 |
-
{
|
432 |
-
if( $attribute->getId() == $iId )
|
433 |
-
{
|
434 |
-
return $attribute;
|
435 |
-
}
|
436 |
-
}
|
437 |
-
|
438 |
-
return self::UNKNOWN();
|
439 |
-
}
|
440 |
-
|
441 |
-
|
442 |
-
/**
|
443 |
-
* Returns an array of the <i>TriggerMailingAttribute</i>s which can be used for ordering.
|
444 |
-
*
|
445 |
-
* @return array an array of the <i>TriggerMailingAttribute</i>s which can be used for ordering.
|
446 |
-
*/
|
447 |
-
public static function getOrderAttributes()
|
448 |
-
{
|
449 |
-
$result = array();
|
450 |
-
|
451 |
-
foreach( self::values() as $attribute )
|
452 |
-
{
|
453 |
-
if( $attribute->isOrderAttribute() )
|
454 |
-
{
|
455 |
-
$result[] = $attribute;
|
456 |
-
}
|
457 |
-
}
|
458 |
-
|
459 |
-
return $result;
|
460 |
-
}
|
461 |
-
|
462 |
-
/**
|
463 |
-
* Returns an array containing all available <i>TriggerMailingAttribute</i>s including UNKNOWN.
|
464 |
-
*
|
465 |
-
* @return array an array containing all available <i>TriggerMailingAttribute</i>s including UNKNOWN.
|
466 |
-
*/
|
467 |
-
public static function values()
|
468 |
-
{
|
469 |
-
return array(self::INTERNAL_MAILING_LIST_ID(), self::INTERNAL_MAILING_CONTENT_MAIL_TYPE(),
|
470 |
-
self::INTERNAL_MAILING_FEATURE_ID(), self:: SUBJECT(), self::PLAIN_TEXT(), self::HTML_TEXT(),
|
471 |
-
self::XML_CONTENT(), self::PLAIN_TEXT_XSL(), self::HTML_TEXT_XSL(), self::FILTER_ID(),
|
472 |
-
self::SENDER_ADDRESS(), self::RECIPIENT_ADDRESS(), self::REPLY_TO_ADDRESS(), self::PRIORITY(),
|
473 |
-
self::MODIFICATION_DATETIME(), self::STYLE(), self::ACTIVATION_DATETIME(), self::SINGLE_SEND_COUNT(),
|
474 |
-
self::NAME(), self::DESCRIPTOR(), self::DEFAULT_ATTRIBUTE(), self::UNKNOWN());
|
475 |
-
}
|
476 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>TriggerMailingAttribute</i> enumeration defines the attributes of trigger mailings which are used for
|
9 |
+
* the ordering of result sets and to identify the error source of an <i>Inx_Api_UpdateException</i>.
|
10 |
+
* <p>
|
11 |
+
* To find out if an attribute may be used for ordering, call the <i>isOrderAttribute()</i> method.
|
12 |
+
*<p>
|
13 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
14 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
15 |
+
* purpose similar to integer constants.
|
16 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
17 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
18 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
19 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
20 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
21 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
22 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
23 |
+
*
|
24 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
25 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
26 |
+
* $iOrderType = null, $sFilter = null )
|
27 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
28 |
+
* @since API 1.10.0
|
29 |
+
* @author chge, 13.07.2012
|
30 |
+
*/
|
31 |
+
final class Inx_Api_TriggerMailing_TriggerMailingAttribute
|
32 |
+
{
|
33 |
+
private static $INTERNAL_MAILING_LIST_ID = null;
|
34 |
+
|
35 |
+
private static $INTERNAL_MAILING_FEATURE_ID = null;
|
36 |
+
|
37 |
+
private static $INTERNAL_MAILING_CONTENT_MAIL_TYPE = null;
|
38 |
+
|
39 |
+
private static $SUBJECT = null;
|
40 |
+
|
41 |
+
private static $PLAIN_TEXT = null;
|
42 |
+
|
43 |
+
private static $HTML_TEXT = null;
|
44 |
+
|
45 |
+
private static $XML_CONTENT = null;
|
46 |
+
|
47 |
+
private static $PLAIN_TEXT_XSL = null;
|
48 |
+
|
49 |
+
private static $HTML_TEXT_XSL = null;
|
50 |
+
|
51 |
+
private static $FILTER_ID = null;
|
52 |
+
|
53 |
+
private static $SENDER_ADDRESS = null;
|
54 |
+
|
55 |
+
private static $RECIPIENT_ADDRESS = null;
|
56 |
+
|
57 |
+
private static $REPLY_TO_ADDRESS = null;
|
58 |
+
|
59 |
+
private static $PRIORITY = null;
|
60 |
+
|
61 |
+
private static $MODIFICATION_DATETIME = null;
|
62 |
+
|
63 |
+
private static $STYLE = null;
|
64 |
+
|
65 |
+
private static $ACTIVATION_DATETIME = null;
|
66 |
+
|
67 |
+
private static $SINGLE_SEND_COUNT = null;
|
68 |
+
|
69 |
+
private static $NAME = null;
|
70 |
+
|
71 |
+
private static $DESCRIPTOR = null;
|
72 |
+
|
73 |
+
private static $DEFAULT_ATTRIBUTE = null;
|
74 |
+
|
75 |
+
private static $UNKNOWN = null;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Constant for the mailing list id attribute. This constant is used internally only.
|
79 |
+
*
|
80 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing list id attribute.
|
81 |
+
*/
|
82 |
+
public static final function INTERNAL_MAILING_LIST_ID()
|
83 |
+
{
|
84 |
+
if(null === self::$INTERNAL_MAILING_LIST_ID)
|
85 |
+
self::$INTERNAL_MAILING_LIST_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 0, false );
|
86 |
+
|
87 |
+
return self::$INTERNAL_MAILING_LIST_ID;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Constant for the mailing content (MIME) type attribute. This constant is used internally only.
|
92 |
+
*
|
93 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing content type attribute.
|
94 |
+
*/
|
95 |
+
public static final function INTERNAL_MAILING_CONTENT_MAIL_TYPE()
|
96 |
+
{
|
97 |
+
if(null === self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE)
|
98 |
+
self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 1, false );
|
99 |
+
|
100 |
+
return self::$INTERNAL_MAILING_CONTENT_MAIL_TYPE;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Constant for the mailing feature id. This constant is used internally only.
|
105 |
+
*
|
106 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the mailing feature id attribute.
|
107 |
+
*/
|
108 |
+
public static final function INTERNAL_MAILING_FEATURE_ID()
|
109 |
+
{
|
110 |
+
if(null === self::$INTERNAL_MAILING_FEATURE_ID)
|
111 |
+
self::$INTERNAL_MAILING_FEATURE_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 2, false );
|
112 |
+
|
113 |
+
return self::$INTERNAL_MAILING_FEATURE_ID;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Constant for the subject attribute. Used for ordering by the <i>TriggerMailingManager</i>.
|
118 |
+
*
|
119 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the subject attribute.
|
120 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
121 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
122 |
+
* $iOrderType = null, $sFilter = null )
|
123 |
+
*/
|
124 |
+
public static final function SUBJECT()
|
125 |
+
{
|
126 |
+
if(null === self::$SUBJECT)
|
127 |
+
self::$SUBJECT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 3, true );
|
128 |
+
|
129 |
+
return self::$SUBJECT;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Constant for the plain text attribute.
|
134 |
+
*
|
135 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the plain text attribute.
|
136 |
+
*/
|
137 |
+
public static final function PLAIN_TEXT()
|
138 |
+
{
|
139 |
+
if(null === self::$PLAIN_TEXT)
|
140 |
+
self::$PLAIN_TEXT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 4, false );
|
141 |
+
|
142 |
+
return self::$PLAIN_TEXT;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Constant for the HTML text attribute.
|
147 |
+
*
|
148 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the HTML text attribute.
|
149 |
+
*/
|
150 |
+
public static final function HTML_TEXT()
|
151 |
+
{
|
152 |
+
if(null === self::$HTML_TEXT)
|
153 |
+
self::$HTML_TEXT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 5, false );;
|
154 |
+
|
155 |
+
return self::$HTML_TEXT;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Constant for the XML content attribute.
|
160 |
+
*
|
161 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the XML content attribute.
|
162 |
+
*/
|
163 |
+
public static final function XML_CONTENT()
|
164 |
+
{
|
165 |
+
if(null === self::$XML_CONTENT)
|
166 |
+
self::$XML_CONTENT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 6, false );
|
167 |
+
|
168 |
+
return self::$XML_CONTENT;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Constant for the plain text style XML content attribute.
|
173 |
+
*
|
174 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the plain text style XML content attribute.
|
175 |
+
*/
|
176 |
+
public static final function PLAIN_TEXT_XSL()
|
177 |
+
{
|
178 |
+
if(null === self::$PLAIN_TEXT_XSL)
|
179 |
+
self::$PLAIN_TEXT_XSL = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 7, false );
|
180 |
+
|
181 |
+
return self::$PLAIN_TEXT_XSL;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Constant for the HTML text style XML content attribute.
|
186 |
+
*
|
187 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the HTML text style XML content attribute.
|
188 |
+
*/
|
189 |
+
public static final function HTML_TEXT_XSL()
|
190 |
+
{
|
191 |
+
if(null === self::$HTML_TEXT_XSL)
|
192 |
+
self::$HTML_TEXT_XSL = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 8, false );
|
193 |
+
|
194 |
+
return self::$HTML_TEXT_XSL;
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Constant for the filter id attribute.
|
199 |
+
*
|
200 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the filter id attribute.
|
201 |
+
*/
|
202 |
+
public static final function FILTER_ID()
|
203 |
+
{
|
204 |
+
if(null === self::$FILTER_ID)
|
205 |
+
self::$FILTER_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 9, false );
|
206 |
+
|
207 |
+
return self::$FILTER_ID;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Constant for the sender address attribute.
|
212 |
+
*
|
213 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the sender address attribute.
|
214 |
+
*/
|
215 |
+
public static final function SENDER_ADDRESS()
|
216 |
+
{
|
217 |
+
if(null === self::$SENDER_ADDRESS)
|
218 |
+
self::$SENDER_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 10, false );
|
219 |
+
|
220 |
+
return self::$SENDER_ADDRESS;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Constant for the recipient address attribute.
|
225 |
+
*
|
226 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the recipient address attribute.
|
227 |
+
*/
|
228 |
+
public static final function RECIPIENT_ADDRESS()
|
229 |
+
{
|
230 |
+
if(null === self::$RECIPIENT_ADDRESS)
|
231 |
+
self::$RECIPIENT_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 11, false );
|
232 |
+
|
233 |
+
return self::$RECIPIENT_ADDRESS;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Constant for the reply address attribute.
|
238 |
+
*
|
239 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the reply address attribute.
|
240 |
+
*/
|
241 |
+
public static final function REPLY_TO_ADDRESS()
|
242 |
+
{
|
243 |
+
if(null === self::$REPLY_TO_ADDRESS)
|
244 |
+
self::$REPLY_TO_ADDRESS = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 12, false );
|
245 |
+
|
246 |
+
return self::$REPLY_TO_ADDRESS;
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Constant for the priority attribute.
|
251 |
+
*
|
252 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the priority attribute.
|
253 |
+
*/
|
254 |
+
public static final function PRIORITY()
|
255 |
+
{
|
256 |
+
if(null === self::$PRIORITY)
|
257 |
+
self::$PRIORITY = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 13, false );
|
258 |
+
|
259 |
+
return self::$PRIORITY;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Constant for the modification datetime attribute. Used for ordering by the <i>TriggerMailingManager</i>.
|
264 |
+
*
|
265 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the modification datetime attribute.
|
266 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
267 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
268 |
+
* $iOrderType = null, $sFilter = null )
|
269 |
+
*/
|
270 |
+
public static final function MODIFICATION_DATETIME()
|
271 |
+
{
|
272 |
+
if(null === self::$MODIFICATION_DATETIME)
|
273 |
+
self::$MODIFICATION_DATETIME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 14, true );
|
274 |
+
|
275 |
+
return self::$MODIFICATION_DATETIME;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Constant for the style attribute. Used by the <i>UpdateException</i> to identify the error source.
|
280 |
+
*
|
281 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the style attribute.
|
282 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
283 |
+
*/
|
284 |
+
public static final function STYLE()
|
285 |
+
{
|
286 |
+
if(null === self::$STYLE)
|
287 |
+
self::$STYLE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 15, false );
|
288 |
+
|
289 |
+
return self::$STYLE;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Constant for the activation datetime attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
294 |
+
*
|
295 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the activation datetime attribute.
|
296 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
297 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
298 |
+
* $iOrderType = null, $sFilter = null )
|
299 |
+
*/
|
300 |
+
public static final function ACTIVATION_DATETIME()
|
301 |
+
{
|
302 |
+
if(null === self::$ACTIVATION_DATETIME)
|
303 |
+
self::$ACTIVATION_DATETIME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 16, true );
|
304 |
+
|
305 |
+
return self::$ACTIVATION_DATETIME;
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Constant for the single send count attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
310 |
+
*
|
311 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the single send count attribute.
|
312 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
313 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
314 |
+
* $iOrderType = null, $sFilter = null )
|
315 |
+
*/
|
316 |
+
public static final function SINGLE_SEND_COUNT()
|
317 |
+
{
|
318 |
+
if(null === self::$SINGLE_SEND_COUNT)
|
319 |
+
self::$SINGLE_SEND_COUNT = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 17, true );
|
320 |
+
|
321 |
+
return self::$SINGLE_SEND_COUNT;
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Constant for the name attribute. Used for ordering by the <i>TriggerMailingManager</i>
|
326 |
+
*
|
327 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the name attribute.
|
328 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingManager::selectByState( Inx_Api_List_ListContext $listContext,
|
329 |
+
* Inx_Api_TriggerMailing_StateFilter $stateFilter, Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null,
|
330 |
+
* $iOrderType = null, $sFilter = null )
|
331 |
+
*/
|
332 |
+
public static final function NAME()
|
333 |
+
{
|
334 |
+
if(null === self::$NAME)
|
335 |
+
self::$NAME = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 18, true );
|
336 |
+
|
337 |
+
return self::$NAME;
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Constant for the trigger descriptor attribute. Used by the <i>UpdateException</i> to identify the error
|
342 |
+
* source.
|
343 |
+
*
|
344 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the descriptor attribute.
|
345 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
346 |
+
*/
|
347 |
+
public static final function DESCRIPTOR()
|
348 |
+
{
|
349 |
+
if(null === self::$DESCRIPTOR)
|
350 |
+
self::$DESCRIPTOR = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 19, false );
|
351 |
+
|
352 |
+
return self::$DESCRIPTOR;
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* The default attribute used for ordering and as error source if no specific attribute is known or given.
|
357 |
+
*
|
358 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the default attribute.
|
359 |
+
*/
|
360 |
+
public static final function DEFAULT_ATTRIBUTE()
|
361 |
+
{
|
362 |
+
if(null === self::$DEFAULT_ATTRIBUTE)
|
363 |
+
self::$DEFAULT_ATTRIBUTE = new Inx_Api_TriggerMailing_TriggerMailingAttribute( -1, true );
|
364 |
+
|
365 |
+
return self::$DEFAULT_ATTRIBUTE;
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Constant for an unknown attribute. This attribute indicates a version mismatch between API and server. It might
|
370 |
+
* be used by the <i>UpdateException</i> to identify the error source.
|
371 |
+
*
|
372 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the unknown attribute.
|
373 |
+
* @see Inx_Api_UpdateException::getErrorSource()
|
374 |
+
*/
|
375 |
+
public static final function UNKNOWN()
|
376 |
+
{
|
377 |
+
if(null === self::$UNKNOWN)
|
378 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerMailingAttribute( -2, false );
|
379 |
+
|
380 |
+
return self::$UNKNOWN;
|
381 |
+
}
|
382 |
+
|
383 |
+
private $id;
|
384 |
+
|
385 |
+
private $isOrderAttribute;
|
386 |
+
|
387 |
+
|
388 |
+
private function __construct( $iId, $blIsOrderAttribute )
|
389 |
+
{
|
390 |
+
$this->id = $iId;
|
391 |
+
$this->isOrderAttribute = $blIsOrderAttribute;
|
392 |
+
}
|
393 |
+
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Returns the ID of the <i>TriggerMailingAttribute</i>. The ID is used for transmission purposes and should
|
397 |
+
* not be used inside client code.
|
398 |
+
*
|
399 |
+
* @return int the ID of the <i>TriggerMailingAttribute</i>.
|
400 |
+
*/
|
401 |
+
public function getId()
|
402 |
+
{
|
403 |
+
return $this->id;
|
404 |
+
}
|
405 |
+
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Returns a <i>bool</i> indicating if this <i>TriggerMailingAttribute</i> can be used for ordering
|
409 |
+
* of result sets.
|
410 |
+
*
|
411 |
+
* @return bool <i>true</i> if this attribute can be used for ordering, <i>false</i> otherwise.
|
412 |
+
*/
|
413 |
+
public function isOrderAttribute()
|
414 |
+
{
|
415 |
+
return $this->isOrderAttribute;
|
416 |
+
}
|
417 |
+
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Returns the <i>TriggerMailingAttribute</i> corresponding to the given id. If the id is unknown, the
|
421 |
+
* <i>UNKNOWN</i> attribute will be returned. The ID is used for transmission purposes and should not be used
|
422 |
+
* inside client code.
|
423 |
+
*
|
424 |
+
* @param int $iId the ID of the <i>TriggerMailingAttribute</i> to retrieve.
|
425 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingAttribute the <i>TriggerMailingAttribute</i> corresponding to
|
426 |
+
* the given ID.
|
427 |
+
*/
|
428 |
+
public static function byId( $iId )
|
429 |
+
{
|
430 |
+
foreach( self::values() as $attribute )
|
431 |
+
{
|
432 |
+
if( $attribute->getId() == $iId )
|
433 |
+
{
|
434 |
+
return $attribute;
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
return self::UNKNOWN();
|
439 |
+
}
|
440 |
+
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Returns an array of the <i>TriggerMailingAttribute</i>s which can be used for ordering.
|
444 |
+
*
|
445 |
+
* @return array an array of the <i>TriggerMailingAttribute</i>s which can be used for ordering.
|
446 |
+
*/
|
447 |
+
public static function getOrderAttributes()
|
448 |
+
{
|
449 |
+
$result = array();
|
450 |
+
|
451 |
+
foreach( self::values() as $attribute )
|
452 |
+
{
|
453 |
+
if( $attribute->isOrderAttribute() )
|
454 |
+
{
|
455 |
+
$result[] = $attribute;
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
return $result;
|
460 |
+
}
|
461 |
+
|
462 |
+
/**
|
463 |
+
* Returns an array containing all available <i>TriggerMailingAttribute</i>s including UNKNOWN.
|
464 |
+
*
|
465 |
+
* @return array an array containing all available <i>TriggerMailingAttribute</i>s including UNKNOWN.
|
466 |
+
*/
|
467 |
+
public static function values()
|
468 |
+
{
|
469 |
+
return array(self::INTERNAL_MAILING_LIST_ID(), self::INTERNAL_MAILING_CONTENT_MAIL_TYPE(),
|
470 |
+
self::INTERNAL_MAILING_FEATURE_ID(), self:: SUBJECT(), self::PLAIN_TEXT(), self::HTML_TEXT(),
|
471 |
+
self::XML_CONTENT(), self::PLAIN_TEXT_XSL(), self::HTML_TEXT_XSL(), self::FILTER_ID(),
|
472 |
+
self::SENDER_ADDRESS(), self::RECIPIENT_ADDRESS(), self::REPLY_TO_ADDRESS(), self::PRIORITY(),
|
473 |
+
self::MODIFICATION_DATETIME(), self::STYLE(), self::ACTIVATION_DATETIME(), self::SINGLE_SEND_COUNT(),
|
474 |
+
self::NAME(), self::DESCRIPTOR(), self::DEFAULT_ATTRIBUTE(), self::UNKNOWN());
|
475 |
+
}
|
476 |
+
}
|
lib/Inx/Api/TriggerMailing/TriggerMailingManager.php
CHANGED
@@ -1,337 +1,337 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>TriggerMailingManager</i> manages all trigger mailings. The <i>TriggerMailingManager</i> can be
|
9 |
-
* used to perform the following tasks:
|
10 |
-
* <ul>
|
11 |
-
* <li>Retrieve mailings
|
12 |
-
* <li>Create mailings
|
13 |
-
* <li>Clone mailings
|
14 |
-
* <li>Create a renderer to generate a preview of the mailing
|
15 |
-
* </ul>
|
16 |
-
* Be aware that this manager is not able to manage normal mailings. Normal mailings are managed by the
|
17 |
-
* <i>Inx_Api_Mailing_MailingManager</i>.
|
18 |
-
* <p>
|
19 |
-
* <strong>Mailing retrieval</strong>
|
20 |
-
* <p>
|
21 |
-
* There are several ways to retrieve trigger mailings. The simplest way is to call <i>selectAll()</i> which will
|
22 |
-
* retrieve all trigger mailings. To retrieve a single trigger mailing, use the <i>get(int)</i> method. To
|
23 |
-
* retrieve all trigger mailings of a specific list use one of the <i>selectByState(...)</i> methods. Using this
|
24 |
-
* type of method gives you the ability to define search filters, like the trigger mailing state. It is also possible to
|
25 |
-
* order the result.
|
26 |
-
* <p>
|
27 |
-
* The following snippet shows how to retrieve all trigger mailings of a specific list, which are either in the
|
28 |
-
* <code>DRAFT</code> or the <code>APPROVAL_REQUESTED</code> state and print out their names:
|
29 |
-
*
|
30 |
-
* <pre>
|
31 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
32 |
-
* $mailingStateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
33 |
-
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
34 |
-
* $stateFilter = $triggerMailingMgr->createMailingStateFilter( $mailingStateFilter );
|
35 |
-
* $set = $triggerMailingMgr->selectByState( $listContext, $stateFilter );
|
36 |
-
*
|
37 |
-
* for( $i = 0; $i < $set->size(); $i++ )
|
38 |
-
* {
|
39 |
-
* $tm = $set->get( $i );
|
40 |
-
* echo $tm->getName() . '<br>';
|
41 |
-
* }
|
42 |
-
*
|
43 |
-
* $set->close();
|
44 |
-
* </pre>
|
45 |
-
*
|
46 |
-
* To retrieve all mailings of a specific list, disregarding their state, use the all matching state filter which can be
|
47 |
-
* created using the <i>createAllMatchingStateFilter()</i> method. This filter produces the same result as a state
|
48 |
-
* filter with all states.
|
49 |
-
* <p>
|
50 |
-
* If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
|
51 |
-
* using filter expressions. The following snippet extends the previous select statement with a filter that restricts
|
52 |
-
* the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
|
53 |
-
*
|
54 |
-
* <pre>
|
55 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
56 |
-
*
|
57 |
-
* $filterDate = date('d.m.Y H:i:s', strtotime('-1 hour'));
|
58 |
-
* $filter = 'Attribute(' . Inx_Api_TriggerMailing_TriggerMailingAttribute::MODIFICATION_DATETIME()->getId()
|
59 |
-
* . ') > #' . $filterDate . '#';
|
60 |
-
*
|
61 |
-
* $mailingStateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
62 |
-
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
63 |
-
* $stateFilter = $triggerMailingMgr->createMailingStateFilter( $mailingStateFilter );
|
64 |
-
*
|
65 |
-
* $set = $triggerMailingMgr->selectByState( $listContext, $stateFilter,
|
66 |
-
* Inx_Api_TriggerMailing_TriggerMailingAttribute::NAME(), Inx_Api_Order::ASC, $filter );
|
67 |
-
*
|
68 |
-
* for( $i = 0; $i < $set->size(); $i++ )
|
69 |
-
* {
|
70 |
-
* $tm = $set->get( $i );
|
71 |
-
* echo $tm->getName() . '<br>';
|
72 |
-
* }
|
73 |
-
*
|
74 |
-
* $set->close();
|
75 |
-
* </pre>
|
76 |
-
* <p>
|
77 |
-
* <strong>Mailing creation and editing</strong>
|
78 |
-
* <p>
|
79 |
-
* Creating a trigger mailing can be a bit tricky as there are many settings needed to set up a trigger descriptor.
|
80 |
-
* There are several builders which will help you with creating a valid trigger descriptor. The following snippet
|
81 |
-
* exemplary shows how to create an anniversary trigger mailing:
|
82 |
-
*
|
83 |
-
* <pre>
|
84 |
-
* $optInDate = $session->createRecipientContext()->getMetaData()->getSubscriptionAttribute(
|
85 |
-
* $listContext )->getId();
|
86 |
-
* $startDate = date('c');
|
87 |
-
* $sendingTime = date('c', mktime(12, 30));
|
88 |
-
*
|
89 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
90 |
-
* $descriptor = $triggerMailingMgr->getTriggerDescriptorBuilderFactory()
|
91 |
-
* ->createAnniversaryTriggerDescriptorBuilder()->startDate( $startDate )->sendingTime( $sendingTime )
|
92 |
-
* ->attribute( $optInDate )->columnModificator(
|
93 |
-
* new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
94 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
95 |
-
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 1 ) )->build();
|
96 |
-
*
|
97 |
-
* $mailing = $triggerMailingMgr->createTriggerMailing( $listContext, $descriptor );
|
98 |
-
* $mailing->updateName( 'One year anniversary' );
|
99 |
-
* $mailing->updateSubject( "Thank's for staying with us!" );
|
100 |
-
* $mailing->commitUpdate();
|
101 |
-
* </pre>
|
102 |
-
*
|
103 |
-
* The created anniversary mailing will be sent to recipients that have been member of the specified list for one year.
|
104 |
-
* The descriptor in this example is set up with minimal information. If you wish to, you can configure even more
|
105 |
-
* aspects of the trigger. You could, for example, add commands to set recipient attributes along with sending the
|
106 |
-
* mailing. The available options vary from builder to builder, documented for each builder interface, including
|
107 |
-
* information on which settings are mandatory and which are optional.
|
108 |
-
* <p>
|
109 |
-
* <strong>Note:</strong> For existing trigger mailings, always call <i>lock()</i> before updating it, and
|
110 |
-
* <i>unlock()</i> after committing changes!
|
111 |
-
* <p>
|
112 |
-
* The following snippet shows how to edit an existing trigger mailing:
|
113 |
-
*
|
114 |
-
* <pre>
|
115 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
116 |
-
* $mailing = $triggerMailingMgr->get( $iMailingId );
|
117 |
-
*
|
118 |
-
* try
|
119 |
-
* {
|
120 |
-
* $mailing->lock();
|
121 |
-
* $mailing->updateSubject( 'New Subject' );
|
122 |
-
* $mailing->commitUpdate();
|
123 |
-
* $mailing->unlock();
|
124 |
-
* }
|
125 |
-
* catch( Inx_Api_LockException $x )
|
126 |
-
* {
|
127 |
-
* // someone else has locked this mailing
|
128 |
-
* }
|
129 |
-
* </pre>
|
130 |
-
* <p>
|
131 |
-
* It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
|
132 |
-
* <i>clone()</i> method.
|
133 |
-
* <p>
|
134 |
-
* The following snippet shows how to clone a mailing and put the clone in the specified list:
|
135 |
-
*
|
136 |
-
* <pre>
|
137 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
138 |
-
* $triggerMailingMgr->cloneMailing( $iMailingId, $listContext );
|
139 |
-
* </pre>
|
140 |
-
* <p>
|
141 |
-
* <strong>Preview generation</strong>
|
142 |
-
* <p>
|
143 |
-
* To create a preview of a trigger mailing, an <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> is needed. A renderer
|
144 |
-
* can be obtained using the <i>createRenderer()</i> method.
|
145 |
-
* <p>
|
146 |
-
* The following snippet shows how to create a <i>TriggerMailingRenderer</i> and generate a preview of the trigger
|
147 |
-
* mailing:
|
148 |
-
*
|
149 |
-
* <pre>
|
150 |
-
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
151 |
-
* $renderer = $triggerMailingMgr->createRenderer();
|
152 |
-
* $renderer->parse( $iMailingId, Inx_Api_TriggerMail_BuildMode::PREVIEW() );
|
153 |
-
* $preview = $renderer->build( $iRecipientId );
|
154 |
-
*
|
155 |
-
* echo $preview->getHtmlText() . '<br>';
|
156 |
-
* </pre>
|
157 |
-
* <p>
|
158 |
-
* For more information on <i>TriggerMailing</i>s, see the <i>Inx_Api_TriggerMailing_TriggerMailing</i> documentation.
|
159 |
-
* <p>
|
160 |
-
* Note: To use trigger mailings, the following API user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
|
161 |
-
*
|
162 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing
|
163 |
-
* @since API 1.10.0
|
164 |
-
* @author chge, 12.07.2012
|
165 |
-
*/
|
166 |
-
interface Inx_Api_TriggerMailing_TriggerMailingManager extends Inx_Api_BOManager
|
167 |
-
{
|
168 |
-
/**
|
169 |
-
* Returns a <code>BOResultSet</code> containing all trigger mailings of the specified list, that pass the specified
|
170 |
-
* state filter and filter expression. The result will be ordered by the given attribute using the specified order
|
171 |
-
* type.
|
172 |
-
* <p>
|
173 |
-
* The stateFilter parameter can be created using one of the following methods:
|
174 |
-
* <ul>
|
175 |
-
* <li><i>createMailingStateFilter</i>: matches a set of mailing states.
|
176 |
-
* <li><i>createTriggerStateFilter</i>: matches a specific trigger state.
|
177 |
-
* <li><i>createStateFilter</i>: matches a set of mailing states and a specific trigger state. Both filters must
|
178 |
-
* be passed.
|
179 |
-
* <li><i>createAllMatchingStateFilter()</i>: matches any mailing and trigger state. Note: this is a singleton.
|
180 |
-
* </ul>
|
181 |
-
* <p>
|
182 |
-
* To retrieve all trigger mailings of a list, disregarding their state, use the all matching state filter.
|
183 |
-
* <p>
|
184 |
-
* The filter parameter is a boolean expression on a single trigger mailing attribute. The expression syntax is
|
185 |
-
* almost identical to the one used by <i>Inx_Api_Filter_Filter::updateStatement( $sStmt )</i> with two exceptions:
|
186 |
-
* <ol>
|
187 |
-
* <li>The filter is not matching recipient attributes, but trigger mailing attributes. To define the mailing
|
188 |
-
* attribute to match, use the following pattern:
|
189 |
-
* <i>'Attribute(' . Inx_Api_TriggerMailing_TriggerMailingAttribute::XYZ()->getId() . ')'</i>
|
190 |
-
* <li>The filter may only match one column. The operators AND and OR are not allowed.
|
191 |
-
* </ol>
|
192 |
-
* <p>
|
193 |
-
* The orderAttribute parameter is the attribute used to order the result. Allowed attributes are:
|
194 |
-
* <ul>
|
195 |
-
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::SUBJECT()</i>: the subject of the trigger mailing - alphabetical order.
|
196 |
-
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::NAME()</i>: the name of the trigger mailing - alphabetical order.
|
197 |
-
* <li><I>Inx_Api_TriggerMailing_TriggerMailingAttribute::MODIFICATION_DATETIME()</i>: the datetime of the last modification of
|
198 |
-
* the trigger mailing - chronological order.
|
199 |
-
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::ACTIVATION_DATETIME()</i>: the datetime of the first activation of the
|
200 |
-
* trigger mailing - chronological order.
|
201 |
-
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::SINGLE_SEND_COUNT()</i>: the number of recipients to which the trigger
|
202 |
-
* mailing was sent till now - numerical order.
|
203 |
-
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::DEFAULT()</i>: the default order attribute - unspecified order.
|
204 |
-
* </ul>
|
205 |
-
* To check if an attribute can be used as order attribute, use the
|
206 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailingAttribute::isOrderAttribute()</i> method.
|
207 |
-
*
|
208 |
-
* @param Inx_Api_List_ListContext $listContext the list which contains the trigger mailings to be retrieved.
|
209 |
-
* @param Inx_Api_TriggerMailing_StateFilter $stateFilter the state filter condition.
|
210 |
-
* @param Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute the attribute used to order the result. May be omitted.
|
211 |
-
* @param int $iOrderType the order direction; one of <i>Inx_Api_Order::ASC</i> and <I>Inx_Api_Order::DESC</i>. May be omitted.
|
212 |
-
* @param string $sFilter the filter expression. May be omitted.
|
213 |
-
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all trigger mailings of the specified list, that pass the specified
|
214 |
-
* state filter and filter expression.
|
215 |
-
* @throws Inx_Api_FilterStmtException if the given filter statement could not be parsed.
|
216 |
-
* @throws Inx_Api_IllegalArgumentException if the given order attribute is invalid.
|
217 |
-
*/
|
218 |
-
public function selectByState( Inx_Api_List_ListContext $listContext, Inx_Api_TriggerMailing_StateFilter $stateFilter,
|
219 |
-
Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null, $iOrderType = null, $sFilter = null );
|
220 |
-
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Creates a new trigger mailing in the specified list using the given trigger descriptor. To create a trigger
|
224 |
-
* descriptor, use one of the builders provided by the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i>,
|
225 |
-
* which can be obtained using the <i>getTriggerDescriptorBuilderFactory()</i> method.
|
226 |
-
*
|
227 |
-
* @param Inx_Api_List_ListContext $listContext the list that will be containing the trigger mailing.
|
228 |
-
* @param Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor $descriptor the descriptor for the trigger.
|
229 |
-
* @return Inx_Api_TriggerMailing_TriggerMailing a new <i>TriggerMailing</i>.
|
230 |
-
*/
|
231 |
-
public function createTriggerMailing( Inx_Api_List_ListContext $listContext,
|
232 |
-
Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor $descriptor );
|
233 |
-
|
234 |
-
|
235 |
-
/**
|
236 |
-
* Creates a new <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> which can be used to render a <i>TriggerMailing</i>.
|
237 |
-
*
|
238 |
-
* @return Inx_Api_TriggerMail_TriggerMailingRenderer a new <i>TriggerMailingRenderer</i>.
|
239 |
-
*/
|
240 |
-
public function createRenderer();
|
241 |
-
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Creates a new <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> which can be used to render a <i>TriggerMailing</i>
|
245 |
-
* personalized with a test recipient instead of an ordinary recipient.
|
246 |
-
*
|
247 |
-
* @return Inx_Api_TriggerMail_TriggerMailingRenderer a new <i>TriggerMailingRenderer</i> for test recipients.
|
248 |
-
*/
|
249 |
-
public function createRendererForTestrecipient();
|
250 |
-
|
251 |
-
|
252 |
-
/**
|
253 |
-
* Copies a <i>TriggerMailing</i> to the specified list.
|
254 |
-
*
|
255 |
-
* @param int $iMailingId the id of the trigger mailing to be cloned.
|
256 |
-
* @param Inx_Api_List_ListContext $lc the list to which the trigger mailing should be cloned.
|
257 |
-
* @return Inx_Api_TriggerMailing_TriggerMailing the new <i>TriggerMailing</i> which is a clone of the specified
|
258 |
-
* <i>TriggerMailing</i>.
|
259 |
-
* @throws Inx_Api_DataException if the trigger mailing does not exist or can not be copied. See the exception reason for
|
260 |
-
* detailed information.
|
261 |
-
*/
|
262 |
-
public function cloneMailing( $iMailingId, Inx_Api_List_ListContext $lc );
|
263 |
-
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches all of the given mailing states and any trigger
|
267 |
-
* state.
|
268 |
-
* <p>
|
269 |
-
* The easiest way to create the array is to use the <i>array()</i> method. The following example demonstrates how to
|
270 |
-
* create a <i>set</i> of two mailing states:
|
271 |
-
*
|
272 |
-
* <pre>
|
273 |
-
* $stateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
274 |
-
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
275 |
-
* </pre>
|
276 |
-
*
|
277 |
-
* @param array $stateFilter a set of mailing states the filter shall match.
|
278 |
-
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given mailing states.
|
279 |
-
*/
|
280 |
-
public function createMailingStateFilter( array $stateFilter = null );
|
281 |
-
|
282 |
-
|
283 |
-
/**
|
284 |
-
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches the given trigger state and any mailing state.
|
285 |
-
*
|
286 |
-
* @param Inx_Api_TriggerMailing_TriggerState $stateFilter the trigger state the filter shall match.
|
287 |
-
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given trigger state.
|
288 |
-
*/
|
289 |
-
public function createTriggerStateFilter( Inx_Api_TriggerMailing_TriggerState $stateFilter = null );
|
290 |
-
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches all of the given mailing states AND the given
|
294 |
-
* trigger state. Both filters must be matched.
|
295 |
-
*
|
296 |
-
* @param array $mailingStateFilter a set of mailing states the filter shall match.
|
297 |
-
* @param Inx_Api_TriggerMailing_TriggerState $triggerStateFilter the trigger state the filter shall match.
|
298 |
-
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given mailing states and trigger state.
|
299 |
-
*/
|
300 |
-
public function createStateFilter( array $mailingStateFilter = null,
|
301 |
-
Inx_Api_TriggerMailing_TriggerState $triggerStateFilter = null );
|
302 |
-
|
303 |
-
|
304 |
-
/**
|
305 |
-
* Returns a <i>Inx_Api_TriggerMailing_StateFilter</i> which matches any mailing and trigger state.
|
306 |
-
* <p>
|
307 |
-
* Note: This <i>StateFilter</i> is a singleton.
|
308 |
-
*
|
309 |
-
* @return Inx_Api_TriggerMailing_StateFilter a <i>StateFilter</i> which matches any mailing and trigger state.
|
310 |
-
*/
|
311 |
-
public function createAllMatchingStateFilter();
|
312 |
-
|
313 |
-
|
314 |
-
/**
|
315 |
-
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i> used to create builders for
|
316 |
-
* the various trigger types.
|
317 |
-
* <p>
|
318 |
-
* Note: The factory is a singleton.
|
319 |
-
*
|
320 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory the <i>TriggerDescriptorBuilderFactory</i>
|
321 |
-
* used to create builders for the various trigger types.
|
322 |
-
*/
|
323 |
-
public function getTriggerDescriptorBuilderFactory();
|
324 |
-
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Return the <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i> used to create the builders for
|
328 |
-
* the various interval types. The resulting <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> is used for
|
329 |
-
* interval trigger mailings.
|
330 |
-
* <p>
|
331 |
-
* Note: the factory is a singleton.
|
332 |
-
*
|
333 |
-
* @return Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory the <i>TriggerIntervalBuilderFactory</i>
|
334 |
-
* used to create the builders for the various interval types.
|
335 |
-
*/
|
336 |
-
public function getTriggerIntervalBuilderFactory();
|
337 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>TriggerMailingManager</i> manages all trigger mailings. The <i>TriggerMailingManager</i> can be
|
9 |
+
* used to perform the following tasks:
|
10 |
+
* <ul>
|
11 |
+
* <li>Retrieve mailings
|
12 |
+
* <li>Create mailings
|
13 |
+
* <li>Clone mailings
|
14 |
+
* <li>Create a renderer to generate a preview of the mailing
|
15 |
+
* </ul>
|
16 |
+
* Be aware that this manager is not able to manage normal mailings. Normal mailings are managed by the
|
17 |
+
* <i>Inx_Api_Mailing_MailingManager</i>.
|
18 |
+
* <p>
|
19 |
+
* <strong>Mailing retrieval</strong>
|
20 |
+
* <p>
|
21 |
+
* There are several ways to retrieve trigger mailings. The simplest way is to call <i>selectAll()</i> which will
|
22 |
+
* retrieve all trigger mailings. To retrieve a single trigger mailing, use the <i>get(int)</i> method. To
|
23 |
+
* retrieve all trigger mailings of a specific list use one of the <i>selectByState(...)</i> methods. Using this
|
24 |
+
* type of method gives you the ability to define search filters, like the trigger mailing state. It is also possible to
|
25 |
+
* order the result.
|
26 |
+
* <p>
|
27 |
+
* The following snippet shows how to retrieve all trigger mailings of a specific list, which are either in the
|
28 |
+
* <code>DRAFT</code> or the <code>APPROVAL_REQUESTED</code> state and print out their names:
|
29 |
+
*
|
30 |
+
* <pre>
|
31 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
32 |
+
* $mailingStateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
33 |
+
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
34 |
+
* $stateFilter = $triggerMailingMgr->createMailingStateFilter( $mailingStateFilter );
|
35 |
+
* $set = $triggerMailingMgr->selectByState( $listContext, $stateFilter );
|
36 |
+
*
|
37 |
+
* for( $i = 0; $i < $set->size(); $i++ )
|
38 |
+
* {
|
39 |
+
* $tm = $set->get( $i );
|
40 |
+
* echo $tm->getName() . '<br>';
|
41 |
+
* }
|
42 |
+
*
|
43 |
+
* $set->close();
|
44 |
+
* </pre>
|
45 |
+
*
|
46 |
+
* To retrieve all mailings of a specific list, disregarding their state, use the all matching state filter which can be
|
47 |
+
* created using the <i>createAllMatchingStateFilter()</i> method. This filter produces the same result as a state
|
48 |
+
* filter with all states.
|
49 |
+
* <p>
|
50 |
+
* If needed, it is possible to create much more complex select statements than the one above. This can be accomplished
|
51 |
+
* using filter expressions. The following snippet extends the previous select statement with a filter that restricts
|
52 |
+
* the result to mailings which were modified during the last hour. The result is also ordered by the mailing name:
|
53 |
+
*
|
54 |
+
* <pre>
|
55 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
56 |
+
*
|
57 |
+
* $filterDate = date('d.m.Y H:i:s', strtotime('-1 hour'));
|
58 |
+
* $filter = 'Attribute(' . Inx_Api_TriggerMailing_TriggerMailingAttribute::MODIFICATION_DATETIME()->getId()
|
59 |
+
* . ') > #' . $filterDate . '#';
|
60 |
+
*
|
61 |
+
* $mailingStateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
62 |
+
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
63 |
+
* $stateFilter = $triggerMailingMgr->createMailingStateFilter( $mailingStateFilter );
|
64 |
+
*
|
65 |
+
* $set = $triggerMailingMgr->selectByState( $listContext, $stateFilter,
|
66 |
+
* Inx_Api_TriggerMailing_TriggerMailingAttribute::NAME(), Inx_Api_Order::ASC, $filter );
|
67 |
+
*
|
68 |
+
* for( $i = 0; $i < $set->size(); $i++ )
|
69 |
+
* {
|
70 |
+
* $tm = $set->get( $i );
|
71 |
+
* echo $tm->getName() . '<br>';
|
72 |
+
* }
|
73 |
+
*
|
74 |
+
* $set->close();
|
75 |
+
* </pre>
|
76 |
+
* <p>
|
77 |
+
* <strong>Mailing creation and editing</strong>
|
78 |
+
* <p>
|
79 |
+
* Creating a trigger mailing can be a bit tricky as there are many settings needed to set up a trigger descriptor.
|
80 |
+
* There are several builders which will help you with creating a valid trigger descriptor. The following snippet
|
81 |
+
* exemplary shows how to create an anniversary trigger mailing:
|
82 |
+
*
|
83 |
+
* <pre>
|
84 |
+
* $optInDate = $session->createRecipientContext()->getMetaData()->getSubscriptionAttribute(
|
85 |
+
* $listContext )->getId();
|
86 |
+
* $startDate = date('c');
|
87 |
+
* $sendingTime = date('c', mktime(12, 30));
|
88 |
+
*
|
89 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
90 |
+
* $descriptor = $triggerMailingMgr->getTriggerDescriptorBuilderFactory()
|
91 |
+
* ->createAnniversaryTriggerDescriptorBuilder()->startDate( $startDate )->sendingTime( $sendingTime )
|
92 |
+
* ->attribute( $optInDate )->columnModificator(
|
93 |
+
* new Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffset(
|
94 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerOffsetType::WAS_AGO(),
|
95 |
+
* Inx_Api_TriggerMailing_Descriptor_TimeTriggerUnit::YEAR(), 1 ) )->build();
|
96 |
+
*
|
97 |
+
* $mailing = $triggerMailingMgr->createTriggerMailing( $listContext, $descriptor );
|
98 |
+
* $mailing->updateName( 'One year anniversary' );
|
99 |
+
* $mailing->updateSubject( "Thank's for staying with us!" );
|
100 |
+
* $mailing->commitUpdate();
|
101 |
+
* </pre>
|
102 |
+
*
|
103 |
+
* The created anniversary mailing will be sent to recipients that have been member of the specified list for one year.
|
104 |
+
* The descriptor in this example is set up with minimal information. If you wish to, you can configure even more
|
105 |
+
* aspects of the trigger. You could, for example, add commands to set recipient attributes along with sending the
|
106 |
+
* mailing. The available options vary from builder to builder, documented for each builder interface, including
|
107 |
+
* information on which settings are mandatory and which are optional.
|
108 |
+
* <p>
|
109 |
+
* <strong>Note:</strong> For existing trigger mailings, always call <i>lock()</i> before updating it, and
|
110 |
+
* <i>unlock()</i> after committing changes!
|
111 |
+
* <p>
|
112 |
+
* The following snippet shows how to edit an existing trigger mailing:
|
113 |
+
*
|
114 |
+
* <pre>
|
115 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
116 |
+
* $mailing = $triggerMailingMgr->get( $iMailingId );
|
117 |
+
*
|
118 |
+
* try
|
119 |
+
* {
|
120 |
+
* $mailing->lock();
|
121 |
+
* $mailing->updateSubject( 'New Subject' );
|
122 |
+
* $mailing->commitUpdate();
|
123 |
+
* $mailing->unlock();
|
124 |
+
* }
|
125 |
+
* catch( Inx_Api_LockException $x )
|
126 |
+
* {
|
127 |
+
* // someone else has locked this mailing
|
128 |
+
* }
|
129 |
+
* </pre>
|
130 |
+
* <p>
|
131 |
+
* It is not necessary to repeatedly create almost identical mailings. This can be accomplished a lot easier using the
|
132 |
+
* <i>clone()</i> method.
|
133 |
+
* <p>
|
134 |
+
* The following snippet shows how to clone a mailing and put the clone in the specified list:
|
135 |
+
*
|
136 |
+
* <pre>
|
137 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
138 |
+
* $triggerMailingMgr->cloneMailing( $iMailingId, $listContext );
|
139 |
+
* </pre>
|
140 |
+
* <p>
|
141 |
+
* <strong>Preview generation</strong>
|
142 |
+
* <p>
|
143 |
+
* To create a preview of a trigger mailing, an <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> is needed. A renderer
|
144 |
+
* can be obtained using the <i>createRenderer()</i> method.
|
145 |
+
* <p>
|
146 |
+
* The following snippet shows how to create a <i>TriggerMailingRenderer</i> and generate a preview of the trigger
|
147 |
+
* mailing:
|
148 |
+
*
|
149 |
+
* <pre>
|
150 |
+
* $triggerMailingMgr = $session->getTriggerMailingManager();
|
151 |
+
* $renderer = $triggerMailingMgr->createRenderer();
|
152 |
+
* $renderer->parse( $iMailingId, Inx_Api_TriggerMail_BuildMode::PREVIEW() );
|
153 |
+
* $preview = $renderer->build( $iRecipientId );
|
154 |
+
*
|
155 |
+
* echo $preview->getHtmlText() . '<br>';
|
156 |
+
* </pre>
|
157 |
+
* <p>
|
158 |
+
* For more information on <i>TriggerMailing</i>s, see the <i>Inx_Api_TriggerMailing_TriggerMailing</i> documentation.
|
159 |
+
* <p>
|
160 |
+
* Note: To use trigger mailings, the following API user right is required: <i>Inx_Api_UserRights::MAILING_FEATURE_USE</i>
|
161 |
+
*
|
162 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing
|
163 |
+
* @since API 1.10.0
|
164 |
+
* @author chge, 12.07.2012
|
165 |
+
*/
|
166 |
+
interface Inx_Api_TriggerMailing_TriggerMailingManager extends Inx_Api_BOManager
|
167 |
+
{
|
168 |
+
/**
|
169 |
+
* Returns a <code>BOResultSet</code> containing all trigger mailings of the specified list, that pass the specified
|
170 |
+
* state filter and filter expression. The result will be ordered by the given attribute using the specified order
|
171 |
+
* type.
|
172 |
+
* <p>
|
173 |
+
* The stateFilter parameter can be created using one of the following methods:
|
174 |
+
* <ul>
|
175 |
+
* <li><i>createMailingStateFilter</i>: matches a set of mailing states.
|
176 |
+
* <li><i>createTriggerStateFilter</i>: matches a specific trigger state.
|
177 |
+
* <li><i>createStateFilter</i>: matches a set of mailing states and a specific trigger state. Both filters must
|
178 |
+
* be passed.
|
179 |
+
* <li><i>createAllMatchingStateFilter()</i>: matches any mailing and trigger state. Note: this is a singleton.
|
180 |
+
* </ul>
|
181 |
+
* <p>
|
182 |
+
* To retrieve all trigger mailings of a list, disregarding their state, use the all matching state filter.
|
183 |
+
* <p>
|
184 |
+
* The filter parameter is a boolean expression on a single trigger mailing attribute. The expression syntax is
|
185 |
+
* almost identical to the one used by <i>Inx_Api_Filter_Filter::updateStatement( $sStmt )</i> with two exceptions:
|
186 |
+
* <ol>
|
187 |
+
* <li>The filter is not matching recipient attributes, but trigger mailing attributes. To define the mailing
|
188 |
+
* attribute to match, use the following pattern:
|
189 |
+
* <i>'Attribute(' . Inx_Api_TriggerMailing_TriggerMailingAttribute::XYZ()->getId() . ')'</i>
|
190 |
+
* <li>The filter may only match one column. The operators AND and OR are not allowed.
|
191 |
+
* </ol>
|
192 |
+
* <p>
|
193 |
+
* The orderAttribute parameter is the attribute used to order the result. Allowed attributes are:
|
194 |
+
* <ul>
|
195 |
+
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::SUBJECT()</i>: the subject of the trigger mailing - alphabetical order.
|
196 |
+
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::NAME()</i>: the name of the trigger mailing - alphabetical order.
|
197 |
+
* <li><I>Inx_Api_TriggerMailing_TriggerMailingAttribute::MODIFICATION_DATETIME()</i>: the datetime of the last modification of
|
198 |
+
* the trigger mailing - chronological order.
|
199 |
+
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::ACTIVATION_DATETIME()</i>: the datetime of the first activation of the
|
200 |
+
* trigger mailing - chronological order.
|
201 |
+
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::SINGLE_SEND_COUNT()</i>: the number of recipients to which the trigger
|
202 |
+
* mailing was sent till now - numerical order.
|
203 |
+
* <li><i>Inx_Api_TriggerMailing_TriggerMailingAttribute::DEFAULT()</i>: the default order attribute - unspecified order.
|
204 |
+
* </ul>
|
205 |
+
* To check if an attribute can be used as order attribute, use the
|
206 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailingAttribute::isOrderAttribute()</i> method.
|
207 |
+
*
|
208 |
+
* @param Inx_Api_List_ListContext $listContext the list which contains the trigger mailings to be retrieved.
|
209 |
+
* @param Inx_Api_TriggerMailing_StateFilter $stateFilter the state filter condition.
|
210 |
+
* @param Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute the attribute used to order the result. May be omitted.
|
211 |
+
* @param int $iOrderType the order direction; one of <i>Inx_Api_Order::ASC</i> and <I>Inx_Api_Order::DESC</i>. May be omitted.
|
212 |
+
* @param string $sFilter the filter expression. May be omitted.
|
213 |
+
* @return Inx_Api_BOResultSet a <i>BOResultSet</i> containing all trigger mailings of the specified list, that pass the specified
|
214 |
+
* state filter and filter expression.
|
215 |
+
* @throws Inx_Api_FilterStmtException if the given filter statement could not be parsed.
|
216 |
+
* @throws Inx_Api_IllegalArgumentException if the given order attribute is invalid.
|
217 |
+
*/
|
218 |
+
public function selectByState( Inx_Api_List_ListContext $listContext, Inx_Api_TriggerMailing_StateFilter $stateFilter,
|
219 |
+
Inx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null, $iOrderType = null, $sFilter = null );
|
220 |
+
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Creates a new trigger mailing in the specified list using the given trigger descriptor. To create a trigger
|
224 |
+
* descriptor, use one of the builders provided by the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i>,
|
225 |
+
* which can be obtained using the <i>getTriggerDescriptorBuilderFactory()</i> method.
|
226 |
+
*
|
227 |
+
* @param Inx_Api_List_ListContext $listContext the list that will be containing the trigger mailing.
|
228 |
+
* @param Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor $descriptor the descriptor for the trigger.
|
229 |
+
* @return Inx_Api_TriggerMailing_TriggerMailing a new <i>TriggerMailing</i>.
|
230 |
+
*/
|
231 |
+
public function createTriggerMailing( Inx_Api_List_ListContext $listContext,
|
232 |
+
Inx_Api_TriggerMailing_Descriptor_TriggerDescriptor $descriptor );
|
233 |
+
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Creates a new <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> which can be used to render a <i>TriggerMailing</i>.
|
237 |
+
*
|
238 |
+
* @return Inx_Api_TriggerMail_TriggerMailingRenderer a new <i>TriggerMailingRenderer</i>.
|
239 |
+
*/
|
240 |
+
public function createRenderer();
|
241 |
+
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Creates a new <i>Inx_Api_TriggerMail_TriggerMailingRenderer</i> which can be used to render a <i>TriggerMailing</i>
|
245 |
+
* personalized with a test recipient instead of an ordinary recipient.
|
246 |
+
*
|
247 |
+
* @return Inx_Api_TriggerMail_TriggerMailingRenderer a new <i>TriggerMailingRenderer</i> for test recipients.
|
248 |
+
*/
|
249 |
+
public function createRendererForTestrecipient();
|
250 |
+
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Copies a <i>TriggerMailing</i> to the specified list.
|
254 |
+
*
|
255 |
+
* @param int $iMailingId the id of the trigger mailing to be cloned.
|
256 |
+
* @param Inx_Api_List_ListContext $lc the list to which the trigger mailing should be cloned.
|
257 |
+
* @return Inx_Api_TriggerMailing_TriggerMailing the new <i>TriggerMailing</i> which is a clone of the specified
|
258 |
+
* <i>TriggerMailing</i>.
|
259 |
+
* @throws Inx_Api_DataException if the trigger mailing does not exist or can not be copied. See the exception reason for
|
260 |
+
* detailed information.
|
261 |
+
*/
|
262 |
+
public function cloneMailing( $iMailingId, Inx_Api_List_ListContext $lc );
|
263 |
+
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches all of the given mailing states and any trigger
|
267 |
+
* state.
|
268 |
+
* <p>
|
269 |
+
* The easiest way to create the array is to use the <i>array()</i> method. The following example demonstrates how to
|
270 |
+
* create a <i>set</i> of two mailing states:
|
271 |
+
*
|
272 |
+
* <pre>
|
273 |
+
* $stateFilter = array( Inx_Api_TriggerMailing_TriggerMailingState::DRAFT(),
|
274 |
+
* Inx_Api_TriggerMailing_TriggerMailingState::APPROVAL_REQUESTED() );
|
275 |
+
* </pre>
|
276 |
+
*
|
277 |
+
* @param array $stateFilter a set of mailing states the filter shall match.
|
278 |
+
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given mailing states.
|
279 |
+
*/
|
280 |
+
public function createMailingStateFilter( array $stateFilter = null );
|
281 |
+
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches the given trigger state and any mailing state.
|
285 |
+
*
|
286 |
+
* @param Inx_Api_TriggerMailing_TriggerState $stateFilter the trigger state the filter shall match.
|
287 |
+
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given trigger state.
|
288 |
+
*/
|
289 |
+
public function createTriggerStateFilter( Inx_Api_TriggerMailing_TriggerState $stateFilter = null );
|
290 |
+
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Creates a new <i>Inx_Api_TriggerMailing_StateFilter</i> which matches all of the given mailing states AND the given
|
294 |
+
* trigger state. Both filters must be matched.
|
295 |
+
*
|
296 |
+
* @param array $mailingStateFilter a set of mailing states the filter shall match.
|
297 |
+
* @param Inx_Api_TriggerMailing_TriggerState $triggerStateFilter the trigger state the filter shall match.
|
298 |
+
* @return Inx_Api_TriggerMailing_StateFilter a new <i>StateFilter</i> matching the given mailing states and trigger state.
|
299 |
+
*/
|
300 |
+
public function createStateFilter( array $mailingStateFilter = null,
|
301 |
+
Inx_Api_TriggerMailing_TriggerState $triggerStateFilter = null );
|
302 |
+
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Returns a <i>Inx_Api_TriggerMailing_StateFilter</i> which matches any mailing and trigger state.
|
306 |
+
* <p>
|
307 |
+
* Note: This <i>StateFilter</i> is a singleton.
|
308 |
+
*
|
309 |
+
* @return Inx_Api_TriggerMailing_StateFilter a <i>StateFilter</i> which matches any mailing and trigger state.
|
310 |
+
*/
|
311 |
+
public function createAllMatchingStateFilter();
|
312 |
+
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Returns the <i>Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory</i> used to create builders for
|
316 |
+
* the various trigger types.
|
317 |
+
* <p>
|
318 |
+
* Note: The factory is a singleton.
|
319 |
+
*
|
320 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerDescriptorBuilderFactory the <i>TriggerDescriptorBuilderFactory</i>
|
321 |
+
* used to create builders for the various trigger types.
|
322 |
+
*/
|
323 |
+
public function getTriggerDescriptorBuilderFactory();
|
324 |
+
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Return the <i>Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory</i> used to create the builders for
|
328 |
+
* the various interval types. The resulting <i>Inx_Api_TriggerMailing_Descriptor_TriggerInterval</i> is used for
|
329 |
+
* interval trigger mailings.
|
330 |
+
* <p>
|
331 |
+
* Note: the factory is a singleton.
|
332 |
+
*
|
333 |
+
* @return Inx_Api_TriggerMailing_Descriptor_TriggerIntervalBuilderFactory the <i>TriggerIntervalBuilderFactory</i>
|
334 |
+
* used to create the builders for the various interval types.
|
335 |
+
*/
|
336 |
+
public function getTriggerIntervalBuilderFactory();
|
337 |
+
}
|
lib/Inx/Api/TriggerMailing/TriggerMailingState.php
CHANGED
@@ -1,217 +1,217 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_TriggerMailingState</i> enumeration defines the states in which a trigger mailing may
|
9 |
-
* transit. Most operations on trigger mailings are only allowed while the mailing is in a specific state. For example,
|
10 |
-
* a trigger mailing may only be edited while it is in the DRAFT state, which is the initial state.
|
11 |
-
* <p>
|
12 |
-
* If an operation is performed while in an illegal state, normally a <i>TriggerMailingStateException</i> will be
|
13 |
-
* raised. The only exception is the commitUpdate method, which cannot throw a state exception as it is inherited from
|
14 |
-
* <i>Inx_Api_BusinessObject</i>. Instead, commitUpdate will throw an <i>Inx_Api_UpdateException</i> stating that it is
|
15 |
-
* illegal to perform the action in the current state.
|
16 |
-
* <p>
|
17 |
-
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
18 |
-
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
19 |
-
* purpose similar to integer constants.
|
20 |
-
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
21 |
-
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
22 |
-
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
23 |
-
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
24 |
-
* implemented enumerations as classes with private constructor and methods which return the named values.
|
25 |
-
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
26 |
-
* identity operator (===) on these objects and use them comfortably in switch statements.
|
27 |
-
*
|
28 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing
|
29 |
-
* @since API 1.10.0
|
30 |
-
* @author chge, 13.07.2012
|
31 |
-
*/
|
32 |
-
final class Inx_Api_TriggerMailing_TriggerMailingState
|
33 |
-
{
|
34 |
-
private static $DRAFT = null;
|
35 |
-
|
36 |
-
private static $APPROVAL_REQUESTED = null;
|
37 |
-
|
38 |
-
private static $APPROVED = null;
|
39 |
-
|
40 |
-
private static $USED = null;
|
41 |
-
|
42 |
-
private static $UNKNOWN = null;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* State constant for the draft state. The draft state is the initial state of a trigger mailing. The state
|
46 |
-
* constants are also used by the <i>TriggerMailingStateException</i>.
|
47 |
-
*
|
48 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the draft state.
|
49 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
50 |
-
*/
|
51 |
-
public static final function DRAFT()
|
52 |
-
{
|
53 |
-
if(null === self::$DRAFT)
|
54 |
-
self::$DRAFT = new Inx_Api_TriggerMailing_TriggerMailingState( 1 );
|
55 |
-
|
56 |
-
return self::$DRAFT;
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* State constant for the approval requested state. This state indicates that the approval of a trigger mailing was
|
61 |
-
* requested but not yet granted or denied. The state constants are also used by the
|
62 |
-
* <i>TriggerMailingStateException</i>.
|
63 |
-
*
|
64 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the approval requested state.
|
65 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
66 |
-
*/
|
67 |
-
public static final function APPROVAL_REQUESTED()
|
68 |
-
{
|
69 |
-
if(null === self::$APPROVAL_REQUESTED)
|
70 |
-
self::$APPROVAL_REQUESTED = new Inx_Api_TriggerMailing_TriggerMailingState( 2 );
|
71 |
-
|
72 |
-
return self::$APPROVAL_REQUESTED;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* State constant for the approved state. This state indicates that a trigger mailing was approved and is ready to
|
77 |
-
* be sent. The state constants are also used by the <i>TriggerMailingStateException</i>.
|
78 |
-
*
|
79 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the approved state.
|
80 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
81 |
-
*/
|
82 |
-
public static final function APPROVED()
|
83 |
-
{
|
84 |
-
if(null === self::$APPROVED)
|
85 |
-
self::$APPROVED = new Inx_Api_TriggerMailing_TriggerMailingState( 4 );
|
86 |
-
|
87 |
-
return self::$APPROVED;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* State constant for the used state. This state indicates that a trigger mailing was activated (used) at least
|
92 |
-
* once. The state constants are also used by the <i>TriggerMailingStateException</i>.
|
93 |
-
*
|
94 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the used state.
|
95 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
96 |
-
*/
|
97 |
-
public static final function USED()
|
98 |
-
{
|
99 |
-
if(null === self::$USED)
|
100 |
-
self::$USED = new Inx_Api_TriggerMailing_TriggerMailingState( 8 );
|
101 |
-
|
102 |
-
return self::$USED;
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* State constant for an unknown state. This state indicates a version mismatch between API and server. The state
|
107 |
-
* constants are also used by the <code>TriggerMailingStateException</code>.
|
108 |
-
*
|
109 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the unknown state.
|
110 |
-
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
111 |
-
*/
|
112 |
-
public static final function UNKNOWN()
|
113 |
-
{
|
114 |
-
if(null === self::$UNKNOWN)
|
115 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerMailingState( -1 );
|
116 |
-
|
117 |
-
return self::$UNKNOWN;
|
118 |
-
}
|
119 |
-
|
120 |
-
private $id;
|
121 |
-
|
122 |
-
|
123 |
-
private function __construct( $iId )
|
124 |
-
{
|
125 |
-
$this->id = $iId;
|
126 |
-
}
|
127 |
-
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Returns the ID of the <i>TriggerMailingState</i>. The ID is used for transmission purposes and should not
|
131 |
-
* be used inside client code.
|
132 |
-
*
|
133 |
-
* @return int the ID of the <i>TriggerMailingState</i>.
|
134 |
-
*/
|
135 |
-
public function getId()
|
136 |
-
{
|
137 |
-
return $this->id;
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Returns the <i>TriggerMailingState</i> corresponding to the given id. If the id is unknown, the
|
143 |
-
* <i>UNKNOWN</i> state will be returned. The ID is used for transmission purposes and should not be used
|
144 |
-
* inside client code.
|
145 |
-
*
|
146 |
-
* @param int $iId the ID of the <i>TriggerMailingState</i> to retrieve.
|
147 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the <i>TriggerMailingState</i> corresponding to the given ID.
|
148 |
-
*/
|
149 |
-
public static function byId( $iId )
|
150 |
-
{
|
151 |
-
foreach( self::values() as $state )
|
152 |
-
{
|
153 |
-
if( $state->getId() == $iId )
|
154 |
-
{
|
155 |
-
return $state;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
return self::UNKNOWN();
|
160 |
-
}
|
161 |
-
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Returns an array of <i>TriggerMailingState</i>s corresponding to the given bit pattern. Unknown
|
165 |
-
* bits will be ignored. The bit pattern is used for transmission purposes and should not be used in client code.
|
166 |
-
*
|
167 |
-
* @param int $iBitPattern the bit pattern corresponding to the <i>TriggerMailingState</i>s to retrieve.
|
168 |
-
* @return array an array of <i>TriggerMailingState</i>s corresponding to the given bit pattern.
|
169 |
-
*/
|
170 |
-
public static function fromBitPattern( $iBitPattern )
|
171 |
-
{
|
172 |
-
$result = array();
|
173 |
-
|
174 |
-
foreach( self::values() as $state )
|
175 |
-
{
|
176 |
-
if( ( $state->getId() & $iBitPattern ) == $state->getId() )
|
177 |
-
{
|
178 |
-
$result[] = $state;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
|
182 |
-
return $result;
|
183 |
-
}
|
184 |
-
|
185 |
-
|
186 |
-
/**
|
187 |
-
* Returns the bit pattern corresponding to the given array of <i>TriggerMailingState</i>s. The bit
|
188 |
-
* pattern is used for transmission purposes and should not be used in client code.
|
189 |
-
*
|
190 |
-
* @param array $states the states to be converted into a bit pattern.
|
191 |
-
* @return int the bit pattern corresponding to the given array of <i>TriggerMailingState</i>s.
|
192 |
-
*/
|
193 |
-
public static function toBitPattern( array $states )
|
194 |
-
{
|
195 |
-
if( null === $states || empty($states) )
|
196 |
-
return PHP_INT_MAX;
|
197 |
-
|
198 |
-
$result = 0;
|
199 |
-
|
200 |
-
foreach( $states as $state )
|
201 |
-
{
|
202 |
-
$result |= $state->getId();
|
203 |
-
}
|
204 |
-
|
205 |
-
return $result;
|
206 |
-
}
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Returns an array containing all available <i>TriggerMailingState</i>s including UNKNOWN.
|
210 |
-
*
|
211 |
-
* @return array an array containing all available <i>TriggerMailingState</i>s including UNKNOWN.
|
212 |
-
*/
|
213 |
-
public static function values()
|
214 |
-
{
|
215 |
-
return array(self::DRAFT(), self::APPROVAL_REQUESTED(), self::APPROVED(), self::USED(), self::UNKNOWN());
|
216 |
-
}
|
217 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_TriggerMailingState</i> enumeration defines the states in which a trigger mailing may
|
9 |
+
* transit. Most operations on trigger mailings are only allowed while the mailing is in a specific state. For example,
|
10 |
+
* a trigger mailing may only be edited while it is in the DRAFT state, which is the initial state.
|
11 |
+
* <p>
|
12 |
+
* If an operation is performed while in an illegal state, normally a <i>TriggerMailingStateException</i> will be
|
13 |
+
* raised. The only exception is the commitUpdate method, which cannot throw a state exception as it is inherited from
|
14 |
+
* <i>Inx_Api_BusinessObject</i>. Instead, commitUpdate will throw an <i>Inx_Api_UpdateException</i> stating that it is
|
15 |
+
* illegal to perform the action in the current state.
|
16 |
+
* <p>
|
17 |
+
* A note for programmers who are not familiar with the concept of enumerations: Enumerations or enumerated types are basically
|
18 |
+
* a fixed set of named values. They are usually used to define a couple of legitimate values in a specific context and serve a
|
19 |
+
* purpose similar to integer constants.
|
20 |
+
* The advantage of enumerations is, that you cannot specify any "weird" values because every value has to be an instance of
|
21 |
+
* the enumerated type. It is also possible to associate data or even behaviour (methods) with the values.
|
22 |
+
* PHP does not support such a language feature like Java and C# do. In most languages the named values are a sort of constant
|
23 |
+
* whose value is an instance of the enumerated type. In PHP a constant cannot contain a reference type. Therefore, we
|
24 |
+
* implemented enumerations as classes with private constructor and methods which return the named values.
|
25 |
+
* Be aware that the objects returned by the static methods are always the same object. That way it is possible to use the
|
26 |
+
* identity operator (===) on these objects and use them comfortably in switch statements.
|
27 |
+
*
|
28 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing
|
29 |
+
* @since API 1.10.0
|
30 |
+
* @author chge, 13.07.2012
|
31 |
+
*/
|
32 |
+
final class Inx_Api_TriggerMailing_TriggerMailingState
|
33 |
+
{
|
34 |
+
private static $DRAFT = null;
|
35 |
+
|
36 |
+
private static $APPROVAL_REQUESTED = null;
|
37 |
+
|
38 |
+
private static $APPROVED = null;
|
39 |
+
|
40 |
+
private static $USED = null;
|
41 |
+
|
42 |
+
private static $UNKNOWN = null;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* State constant for the draft state. The draft state is the initial state of a trigger mailing. The state
|
46 |
+
* constants are also used by the <i>TriggerMailingStateException</i>.
|
47 |
+
*
|
48 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the draft state.
|
49 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
50 |
+
*/
|
51 |
+
public static final function DRAFT()
|
52 |
+
{
|
53 |
+
if(null === self::$DRAFT)
|
54 |
+
self::$DRAFT = new Inx_Api_TriggerMailing_TriggerMailingState( 1 );
|
55 |
+
|
56 |
+
return self::$DRAFT;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* State constant for the approval requested state. This state indicates that the approval of a trigger mailing was
|
61 |
+
* requested but not yet granted or denied. The state constants are also used by the
|
62 |
+
* <i>TriggerMailingStateException</i>.
|
63 |
+
*
|
64 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the approval requested state.
|
65 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
66 |
+
*/
|
67 |
+
public static final function APPROVAL_REQUESTED()
|
68 |
+
{
|
69 |
+
if(null === self::$APPROVAL_REQUESTED)
|
70 |
+
self::$APPROVAL_REQUESTED = new Inx_Api_TriggerMailing_TriggerMailingState( 2 );
|
71 |
+
|
72 |
+
return self::$APPROVAL_REQUESTED;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* State constant for the approved state. This state indicates that a trigger mailing was approved and is ready to
|
77 |
+
* be sent. The state constants are also used by the <i>TriggerMailingStateException</i>.
|
78 |
+
*
|
79 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the approved state.
|
80 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
81 |
+
*/
|
82 |
+
public static final function APPROVED()
|
83 |
+
{
|
84 |
+
if(null === self::$APPROVED)
|
85 |
+
self::$APPROVED = new Inx_Api_TriggerMailing_TriggerMailingState( 4 );
|
86 |
+
|
87 |
+
return self::$APPROVED;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* State constant for the used state. This state indicates that a trigger mailing was activated (used) at least
|
92 |
+
* once. The state constants are also used by the <i>TriggerMailingStateException</i>.
|
93 |
+
*
|
94 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the used state.
|
95 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
96 |
+
*/
|
97 |
+
public static final function USED()
|
98 |
+
{
|
99 |
+
if(null === self::$USED)
|
100 |
+
self::$USED = new Inx_Api_TriggerMailing_TriggerMailingState( 8 );
|
101 |
+
|
102 |
+
return self::$USED;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* State constant for an unknown state. This state indicates a version mismatch between API and server. The state
|
107 |
+
* constants are also used by the <code>TriggerMailingStateException</code>.
|
108 |
+
*
|
109 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the unknown state.
|
110 |
+
* @see Inx_Api_TriggerMailing_TriggerMailingStateException::getCurrentMailingState()
|
111 |
+
*/
|
112 |
+
public static final function UNKNOWN()
|
113 |
+
{
|
114 |
+
if(null === self::$UNKNOWN)
|
115 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerMailingState( -1 );
|
116 |
+
|
117 |
+
return self::$UNKNOWN;
|
118 |
+
}
|
119 |
+
|
120 |
+
private $id;
|
121 |
+
|
122 |
+
|
123 |
+
private function __construct( $iId )
|
124 |
+
{
|
125 |
+
$this->id = $iId;
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Returns the ID of the <i>TriggerMailingState</i>. The ID is used for transmission purposes and should not
|
131 |
+
* be used inside client code.
|
132 |
+
*
|
133 |
+
* @return int the ID of the <i>TriggerMailingState</i>.
|
134 |
+
*/
|
135 |
+
public function getId()
|
136 |
+
{
|
137 |
+
return $this->id;
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Returns the <i>TriggerMailingState</i> corresponding to the given id. If the id is unknown, the
|
143 |
+
* <i>UNKNOWN</i> state will be returned. The ID is used for transmission purposes and should not be used
|
144 |
+
* inside client code.
|
145 |
+
*
|
146 |
+
* @param int $iId the ID of the <i>TriggerMailingState</i> to retrieve.
|
147 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the <i>TriggerMailingState</i> corresponding to the given ID.
|
148 |
+
*/
|
149 |
+
public static function byId( $iId )
|
150 |
+
{
|
151 |
+
foreach( self::values() as $state )
|
152 |
+
{
|
153 |
+
if( $state->getId() == $iId )
|
154 |
+
{
|
155 |
+
return $state;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
return self::UNKNOWN();
|
160 |
+
}
|
161 |
+
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Returns an array of <i>TriggerMailingState</i>s corresponding to the given bit pattern. Unknown
|
165 |
+
* bits will be ignored. The bit pattern is used for transmission purposes and should not be used in client code.
|
166 |
+
*
|
167 |
+
* @param int $iBitPattern the bit pattern corresponding to the <i>TriggerMailingState</i>s to retrieve.
|
168 |
+
* @return array an array of <i>TriggerMailingState</i>s corresponding to the given bit pattern.
|
169 |
+
*/
|
170 |
+
public static function fromBitPattern( $iBitPattern )
|
171 |
+
{
|
172 |
+
$result = array();
|
173 |
+
|
174 |
+
foreach( self::values() as $state )
|
175 |
+
{
|
176 |
+
if( ( $state->getId() & $iBitPattern ) == $state->getId() )
|
177 |
+
{
|
178 |
+
$result[] = $state;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
return $result;
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Returns the bit pattern corresponding to the given array of <i>TriggerMailingState</i>s. The bit
|
188 |
+
* pattern is used for transmission purposes and should not be used in client code.
|
189 |
+
*
|
190 |
+
* @param array $states the states to be converted into a bit pattern.
|
191 |
+
* @return int the bit pattern corresponding to the given array of <i>TriggerMailingState</i>s.
|
192 |
+
*/
|
193 |
+
public static function toBitPattern( array $states )
|
194 |
+
{
|
195 |
+
if( null === $states || empty($states) )
|
196 |
+
return PHP_INT_MAX;
|
197 |
+
|
198 |
+
$result = 0;
|
199 |
+
|
200 |
+
foreach( $states as $state )
|
201 |
+
{
|
202 |
+
$result |= $state->getId();
|
203 |
+
}
|
204 |
+
|
205 |
+
return $result;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Returns an array containing all available <i>TriggerMailingState</i>s including UNKNOWN.
|
210 |
+
*
|
211 |
+
* @return array an array containing all available <i>TriggerMailingState</i>s including UNKNOWN.
|
212 |
+
*/
|
213 |
+
public static function values()
|
214 |
+
{
|
215 |
+
return array(self::DRAFT(), self::APPROVAL_REQUESTED(), self::APPROVED(), self::USED(), self::UNKNOWN());
|
216 |
+
}
|
217 |
+
}
|
lib/Inx/Api/TriggerMailing/TriggerMailingStateException.php
CHANGED
@@ -1,76 +1,76 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* An <i>Inx_Api_TriggerMailing_TriggerMailingStateException</i> is thrown when a trigger mailing action is invoked which
|
9 |
-
* is not allowed to be performed in the current state. For example, invoking <i>TriggerMailing::activateSending()</i> is
|
10 |
-
* not allowed if the mailing is in the state <i>TriggerMailingState::APPROVAL_REQUESTED()</i>, thus raising a
|
11 |
-
* <i>TriggerMailingStateException</i>.
|
12 |
-
*
|
13 |
-
* @since API 1.10.0
|
14 |
-
* @author chge, 31.05.2012
|
15 |
-
*/
|
16 |
-
final class Inx_Api_TriggerMailing_TriggerMailingStateException extends Exception
|
17 |
-
{
|
18 |
-
private $currentMailingState;
|
19 |
-
|
20 |
-
private $currentTriggerState;
|
21 |
-
|
22 |
-
private $locked;
|
23 |
-
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Creates a <i>TriggerMailingStateException</i> with the given detail message, current state and locking
|
27 |
-
* state.
|
28 |
-
*
|
29 |
-
* @param string $sMsg the detail message.
|
30 |
-
* @param Inx_Api_TriggerMailing_TriggerMailingState $currentMailingState the current state of the affected
|
31 |
-
* mailing.
|
32 |
-
* @param bool $blLocked <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
33 |
-
*/
|
34 |
-
public function __construct( $sMsg, Inx_Api_TriggerMailing_TriggerMailingState $currentMailingState,
|
35 |
-
Inx_Api_TriggerMailing_TriggerState $currentTriggerState, $blLocked )
|
36 |
-
{
|
37 |
-
parent::__construct( $sMsg );
|
38 |
-
|
39 |
-
$this->currentMailingState = $currentMailingState;
|
40 |
-
$this->currentTriggerState = $currentTriggerState;
|
41 |
-
$this->locked = $blLocked;
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Returns the current state of the affected trigger mailing.
|
47 |
-
*
|
48 |
-
* @return Inx_Api_TriggerMailing_TriggerMailingState the current state of the trigger mailing.
|
49 |
-
*/
|
50 |
-
public function getCurrentMailingState()
|
51 |
-
{
|
52 |
-
return $this->currentMailingState;
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Returns the current state of the trigger of the affected trigger mailing.
|
58 |
-
*
|
59 |
-
* @return Inx_Api_TriggerMailing_TriggerState the current state of the trigger.
|
60 |
-
*/
|
61 |
-
public function getCurrentTriggerState()
|
62 |
-
{
|
63 |
-
return $this->currentTriggerState;
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Checks if the trigger mailing is locked.
|
69 |
-
*
|
70 |
-
* @return bool <i>true</i> if the trigger mailing is locked, <i>false</i> otherwise.
|
71 |
-
*/
|
72 |
-
public function isLocked()
|
73 |
-
{
|
74 |
-
return $this->locked;
|
75 |
-
}
|
76 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An <i>Inx_Api_TriggerMailing_TriggerMailingStateException</i> is thrown when a trigger mailing action is invoked which
|
9 |
+
* is not allowed to be performed in the current state. For example, invoking <i>TriggerMailing::activateSending()</i> is
|
10 |
+
* not allowed if the mailing is in the state <i>TriggerMailingState::APPROVAL_REQUESTED()</i>, thus raising a
|
11 |
+
* <i>TriggerMailingStateException</i>.
|
12 |
+
*
|
13 |
+
* @since API 1.10.0
|
14 |
+
* @author chge, 31.05.2012
|
15 |
+
*/
|
16 |
+
final class Inx_Api_TriggerMailing_TriggerMailingStateException extends Exception
|
17 |
+
{
|
18 |
+
private $currentMailingState;
|
19 |
+
|
20 |
+
private $currentTriggerState;
|
21 |
+
|
22 |
+
private $locked;
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Creates a <i>TriggerMailingStateException</i> with the given detail message, current state and locking
|
27 |
+
* state.
|
28 |
+
*
|
29 |
+
* @param string $sMsg the detail message.
|
30 |
+
* @param Inx_Api_TriggerMailing_TriggerMailingState $currentMailingState the current state of the affected
|
31 |
+
* mailing.
|
32 |
+
* @param bool $blLocked <i>true</i> if the mailing is locked, <i>false</i> otherwise.
|
33 |
+
*/
|
34 |
+
public function __construct( $sMsg, Inx_Api_TriggerMailing_TriggerMailingState $currentMailingState,
|
35 |
+
Inx_Api_TriggerMailing_TriggerState $currentTriggerState, $blLocked )
|
36 |
+
{
|
37 |
+
parent::__construct( $sMsg );
|
38 |
+
|
39 |
+
$this->currentMailingState = $currentMailingState;
|
40 |
+
$this->currentTriggerState = $currentTriggerState;
|
41 |
+
$this->locked = $blLocked;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Returns the current state of the affected trigger mailing.
|
47 |
+
*
|
48 |
+
* @return Inx_Api_TriggerMailing_TriggerMailingState the current state of the trigger mailing.
|
49 |
+
*/
|
50 |
+
public function getCurrentMailingState()
|
51 |
+
{
|
52 |
+
return $this->currentMailingState;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Returns the current state of the trigger of the affected trigger mailing.
|
58 |
+
*
|
59 |
+
* @return Inx_Api_TriggerMailing_TriggerState the current state of the trigger.
|
60 |
+
*/
|
61 |
+
public function getCurrentTriggerState()
|
62 |
+
{
|
63 |
+
return $this->currentTriggerState;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Checks if the trigger mailing is locked.
|
69 |
+
*
|
70 |
+
* @return bool <i>true</i> if the trigger mailing is locked, <i>false</i> otherwise.
|
71 |
+
*/
|
72 |
+
public function isLocked()
|
73 |
+
{
|
74 |
+
return $this->locked;
|
75 |
+
}
|
76 |
+
}
|
lib/Inx/Api/TriggerMailing/TriggerState.php
CHANGED
@@ -1,135 +1,135 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
* @subpackage TriggerMailing
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_TriggerMailing_TriggerState</i> enumeration defines the states in which a trigger may transit. For
|
9 |
-
* time trigger mailings, the trigger state is either <i>ACTIVE</i> or <i>INACTIVE</i>, which is the initial state.
|
10 |
-
* For action mailings it is <i>UNSPECIFIED</i>.
|
11 |
-
*
|
12 |
-
* @see Inx_Api_TriggerMailing_TriggerMailing
|
13 |
-
* @since API 1.10.0
|
14 |
-
* @author chge, 13.07.2012
|
15 |
-
*/
|
16 |
-
final class Inx_Api_TriggerMailing_TriggerState
|
17 |
-
{
|
18 |
-
private static $ACTIVE = null;
|
19 |
-
|
20 |
-
private static $INACTIVE = null;
|
21 |
-
|
22 |
-
private static $UNKNOWN = null;
|
23 |
-
|
24 |
-
private static $UNSPECIFIED = null;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* State constant for the active state. This state indicates that the trigger has been activated and the trigger
|
28 |
-
* mailing may be sent during the next dispatch interval.
|
29 |
-
*
|
30 |
-
* @return Inx_Api_TriggerMailing_TriggerState the active state.
|
31 |
-
*/
|
32 |
-
public static final function ACTIVE()
|
33 |
-
{
|
34 |
-
if(null === self::$ACTIVE)
|
35 |
-
self::$ACTIVE = new Inx_Api_TriggerMailing_TriggerState( 1 );
|
36 |
-
|
37 |
-
return self::$ACTIVE;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* State constant for the inactive state. This is the initial state of time trigger mailings and indicates that the
|
42 |
-
* trigger has not yet been activated or was deactivated. The trigger mailing will not be sent during the next
|
43 |
-
* dispatch interval.
|
44 |
-
*
|
45 |
-
* @return Inx_Api_TriggerMailing_TriggerState the inactive state.
|
46 |
-
*/
|
47 |
-
public static final function INACTIVE()
|
48 |
-
{
|
49 |
-
if(null === self::$INACTIVE)
|
50 |
-
self::$INACTIVE = new Inx_Api_TriggerMailing_TriggerState( 2 );
|
51 |
-
|
52 |
-
return self::$INACTIVE;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* State constant for an unknown state. This state indicates a version mismatch between API and server.
|
57 |
-
*
|
58 |
-
* @return Inx_Api_TriggerMailing_TriggerState the unknown state.
|
59 |
-
*/
|
60 |
-
public static final function UNKNOWN()
|
61 |
-
{
|
62 |
-
if(null === self::$UNKNOWN)
|
63 |
-
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerState( 3 );
|
64 |
-
|
65 |
-
return self::$UNKNOWN;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* State constant for the unspecified state. This is the initial (and only) state of action mailings and indicates
|
70 |
-
* that the trigger (in this case an action) cannot be activated or deactivated. using the
|
71 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailing::activateSending()</i> and
|
72 |
-
* <i>Inx_Api_TriggerMailing_TriggerMailing::deactivateSending(bool)</i> methods. This state can be used to retrieve
|
73 |
-
* all action mailings when used inside a <i>Inx_Api_TriggerMailing_StateFilter</i>.
|
74 |
-
*
|
75 |
-
* @return Inx_Api_TriggerMailing_TriggerState the unspecified state.
|
76 |
-
*/
|
77 |
-
public static final function UNSPECIFIED()
|
78 |
-
{
|
79 |
-
if(null === self::$UNSPECIFIED)
|
80 |
-
self::$UNSPECIFIED = new Inx_Api_TriggerMailing_TriggerState( 4 );
|
81 |
-
|
82 |
-
return self::$UNSPECIFIED;
|
83 |
-
}
|
84 |
-
|
85 |
-
private $id;
|
86 |
-
|
87 |
-
|
88 |
-
private function __construct( $iId )
|
89 |
-
{
|
90 |
-
$this->id = $iId;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Returns the ID of the <i>TriggerState</i>. The ID is used for transmission purposes and should not be used
|
96 |
-
* inside client code.
|
97 |
-
*
|
98 |
-
* @return int the ID of the <i>TriggerState</i>.
|
99 |
-
*/
|
100 |
-
public function getId()
|
101 |
-
{
|
102 |
-
return $this->id;
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Returns the <i>TriggerState</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN state will
|
108 |
-
* be used. The ID is used for transmission purposes and should not be used inside client code.
|
109 |
-
*
|
110 |
-
* @param int $iState the ID of the <i>TriggerState</i> to retrieve.
|
111 |
-
* @return Inx_Api_TriggerMailing_TriggerState the <i>TriggerState</i> corresponding to the given ID.
|
112 |
-
*/
|
113 |
-
public static function byId( $iState )
|
114 |
-
{
|
115 |
-
foreach( self::values() as $s )
|
116 |
-
{
|
117 |
-
if( $s->getId() == $iState )
|
118 |
-
{
|
119 |
-
return $s;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
return self::UNKNOWN();
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Returns an array containing all available <i>TriggerState</i>s including UNKNOWN.
|
128 |
-
*
|
129 |
-
* @return array an array containing all available <i>TriggerState</i>s including UNKNOWN.
|
130 |
-
*/
|
131 |
-
public static function values()
|
132 |
-
{
|
133 |
-
return array(self::ACTIVE(), self::INACTIVE(), self::UNKNOWN(), self::UNSPECIFIED());
|
134 |
-
}
|
135 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
* @subpackage TriggerMailing
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_TriggerMailing_TriggerState</i> enumeration defines the states in which a trigger may transit. For
|
9 |
+
* time trigger mailings, the trigger state is either <i>ACTIVE</i> or <i>INACTIVE</i>, which is the initial state.
|
10 |
+
* For action mailings it is <i>UNSPECIFIED</i>.
|
11 |
+
*
|
12 |
+
* @see Inx_Api_TriggerMailing_TriggerMailing
|
13 |
+
* @since API 1.10.0
|
14 |
+
* @author chge, 13.07.2012
|
15 |
+
*/
|
16 |
+
final class Inx_Api_TriggerMailing_TriggerState
|
17 |
+
{
|
18 |
+
private static $ACTIVE = null;
|
19 |
+
|
20 |
+
private static $INACTIVE = null;
|
21 |
+
|
22 |
+
private static $UNKNOWN = null;
|
23 |
+
|
24 |
+
private static $UNSPECIFIED = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* State constant for the active state. This state indicates that the trigger has been activated and the trigger
|
28 |
+
* mailing may be sent during the next dispatch interval.
|
29 |
+
*
|
30 |
+
* @return Inx_Api_TriggerMailing_TriggerState the active state.
|
31 |
+
*/
|
32 |
+
public static final function ACTIVE()
|
33 |
+
{
|
34 |
+
if(null === self::$ACTIVE)
|
35 |
+
self::$ACTIVE = new Inx_Api_TriggerMailing_TriggerState( 1 );
|
36 |
+
|
37 |
+
return self::$ACTIVE;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* State constant for the inactive state. This is the initial state of time trigger mailings and indicates that the
|
42 |
+
* trigger has not yet been activated or was deactivated. The trigger mailing will not be sent during the next
|
43 |
+
* dispatch interval.
|
44 |
+
*
|
45 |
+
* @return Inx_Api_TriggerMailing_TriggerState the inactive state.
|
46 |
+
*/
|
47 |
+
public static final function INACTIVE()
|
48 |
+
{
|
49 |
+
if(null === self::$INACTIVE)
|
50 |
+
self::$INACTIVE = new Inx_Api_TriggerMailing_TriggerState( 2 );
|
51 |
+
|
52 |
+
return self::$INACTIVE;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* State constant for an unknown state. This state indicates a version mismatch between API and server.
|
57 |
+
*
|
58 |
+
* @return Inx_Api_TriggerMailing_TriggerState the unknown state.
|
59 |
+
*/
|
60 |
+
public static final function UNKNOWN()
|
61 |
+
{
|
62 |
+
if(null === self::$UNKNOWN)
|
63 |
+
self::$UNKNOWN = new Inx_Api_TriggerMailing_TriggerState( 3 );
|
64 |
+
|
65 |
+
return self::$UNKNOWN;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* State constant for the unspecified state. This is the initial (and only) state of action mailings and indicates
|
70 |
+
* that the trigger (in this case an action) cannot be activated or deactivated. using the
|
71 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailing::activateSending()</i> and
|
72 |
+
* <i>Inx_Api_TriggerMailing_TriggerMailing::deactivateSending(bool)</i> methods. This state can be used to retrieve
|
73 |
+
* all action mailings when used inside a <i>Inx_Api_TriggerMailing_StateFilter</i>.
|
74 |
+
*
|
75 |
+
* @return Inx_Api_TriggerMailing_TriggerState the unspecified state.
|
76 |
+
*/
|
77 |
+
public static final function UNSPECIFIED()
|
78 |
+
{
|
79 |
+
if(null === self::$UNSPECIFIED)
|
80 |
+
self::$UNSPECIFIED = new Inx_Api_TriggerMailing_TriggerState( 4 );
|
81 |
+
|
82 |
+
return self::$UNSPECIFIED;
|
83 |
+
}
|
84 |
+
|
85 |
+
private $id;
|
86 |
+
|
87 |
+
|
88 |
+
private function __construct( $iId )
|
89 |
+
{
|
90 |
+
$this->id = $iId;
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Returns the ID of the <i>TriggerState</i>. The ID is used for transmission purposes and should not be used
|
96 |
+
* inside client code.
|
97 |
+
*
|
98 |
+
* @return int the ID of the <i>TriggerState</i>.
|
99 |
+
*/
|
100 |
+
public function getId()
|
101 |
+
{
|
102 |
+
return $this->id;
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Returns the <i>TriggerState</i> corresponding to the given ID. If the ID is unknown, the UNKNOWN state will
|
108 |
+
* be used. The ID is used for transmission purposes and should not be used inside client code.
|
109 |
+
*
|
110 |
+
* @param int $iState the ID of the <i>TriggerState</i> to retrieve.
|
111 |
+
* @return Inx_Api_TriggerMailing_TriggerState the <i>TriggerState</i> corresponding to the given ID.
|
112 |
+
*/
|
113 |
+
public static function byId( $iState )
|
114 |
+
{
|
115 |
+
foreach( self::values() as $s )
|
116 |
+
{
|
117 |
+
if( $s->getId() == $iState )
|
118 |
+
{
|
119 |
+
return $s;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
return self::UNKNOWN();
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Returns an array containing all available <i>TriggerState</i>s including UNKNOWN.
|
128 |
+
*
|
129 |
+
* @return array an array containing all available <i>TriggerState</i>s including UNKNOWN.
|
130 |
+
*/
|
131 |
+
public static function values()
|
132 |
+
{
|
133 |
+
return array(self::ACTIVE(), self::INACTIVE(), self::UNKNOWN(), self::UNSPECIFIED());
|
134 |
+
}
|
135 |
+
}
|
lib/Inx/Api/UnknownRecipientException.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The <i>Inx_Api_UnknownRecipientException</i> is thrown when an attempt to read recipient data fails due to an unknown
|
4 |
-
* recipient.
|
5 |
-
*
|
6 |
-
* @author chge, 22.06.2012
|
7 |
-
*/
|
8 |
-
class Inx_Api_UnknownRecipientException extends Exception
|
9 |
-
{
|
10 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The <i>Inx_Api_UnknownRecipientException</i> is thrown when an attempt to read recipient data fails due to an unknown
|
4 |
+
* recipient.
|
5 |
+
*
|
6 |
+
* @author chge, 22.06.2012
|
7 |
+
*/
|
8 |
+
class Inx_Api_UnknownRecipientException extends Exception
|
9 |
+
{
|
10 |
+
}
|
lib/Inx/Api/UpdateException.php
CHANGED
@@ -1,72 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* This exception is thrown by the <i>commitUpdate()</i> method in the <i>Inx_Api_BusinessObject</i> class to
|
7 |
-
* indicate that the update failed.
|
8 |
-
* <p>
|
9 |
-
* There are several error types associated with this exception:
|
10 |
-
* <ul>
|
11 |
-
* <li>ERROR_TYPE_PERSISTENCE - the update could not be persisted
|
12 |
-
* <li>ERROR_TYPE_ILLEGAL_VALUE - an illegal value was committed
|
13 |
-
* <li>ERROR_TYPE_DUPLICATE_KEY_VALUE - a duplicate key was committed
|
14 |
-
* <li>ERROR_TYPE_ILLEGAL_OPERATION - an illegal operation was triggered
|
15 |
-
* </ul>
|
16 |
-
*
|
17 |
-
* @see Inx_Api_BusinessObject#commitUpdate()
|
18 |
-
* @version $Revision$ $Date$ $Author$
|
19 |
-
* @package Inxmail
|
20 |
-
*/
|
21 |
-
class Inx_Api_UpdateException extends Exception
|
22 |
-
{
|
23 |
-
/** Error type indicating that a persistence error has occurred. */
|
24 |
-
const ERROR_TYPE_PERSISTENCE = -1;
|
25 |
-
|
26 |
-
/** Error type indicating that an illegal value was committed. */
|
27 |
-
const ERROR_TYPE_ILLEGAL_VALUE = -2;
|
28 |
-
|
29 |
-
/** Error type indicating that a duplicate key was committed. */
|
30 |
-
const ERROR_TYPE_DUPLICATE_KEY_VALUE = -3;
|
31 |
-
|
32 |
-
/** Error type indicating that an illegal operation was triggered. */
|
33 |
-
const ERROR_TYPE_ILLEGAL_OPERATION = -4;
|
34 |
-
|
35 |
-
/** Indicates that no error source was specified. */
|
36 |
-
const ERROR_SOURCE_NOT_SPECIFIED = -1000;
|
37 |
-
|
38 |
-
/** The error type of this exception. */
|
39 |
-
protected $iErrorType;
|
40 |
-
|
41 |
-
/** The error source of this exception. */
|
42 |
-
protected $iErrorSource;
|
43 |
-
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Creates a new <i>Inx_Api_UpdateException</i> with the given error type, error source and detail message.
|
47 |
-
*
|
48 |
-
* @param $sMsg the detail message.
|
49 |
-
* @param $iErrorCode the error type. One of the error type constants defined in this exception.
|
50 |
-
* @param $iErrorSource the error source. Can be either <i>Inx_Api_UpdateException.ERROR_SOURCE_NOT_SPECIFIED</i> or a
|
51 |
-
* more specific constant of a related <i>Inx_Api_BusinessObject</i> (e.g.
|
52 |
-
* <i>Inx_Api_List_ListContext.ATTRIBUTE_NAME</i>).
|
53 |
-
*/
|
54 |
-
public function __construct( $sMsg, $iErrorCode, $iErrorSource)
|
55 |
-
{
|
56 |
-
parent::__construct( $sMsg, $iErrorCode );
|
57 |
-
$this->iErrorSource = $iErrorSource;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Returns the error source. The error source can be <i>Inx_ApiUpdateException::ERROR_SOURCE_NOT_SPECIFIED</i>
|
62 |
-
* or a more specific constant of a related <i>Inx_Api_BusinessObject</i>.
|
63 |
-
* <p>
|
64 |
-
* e.g. <i>Inx_Api_List_ListContext::ATTRIBUTE_NAME</i> if the list name is illegal or already exists.
|
65 |
-
*
|
66 |
-
* @return int the error source.
|
67 |
-
*/
|
68 |
-
public function getErrorSource()
|
69 |
-
{
|
70 |
-
return $this->iErrorSource;
|
71 |
-
}
|
72 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* This exception is thrown by the <i>commitUpdate()</i> method in the <i>Inx_Api_BusinessObject</i> class to
|
7 |
+
* indicate that the update failed.
|
8 |
+
* <p>
|
9 |
+
* There are several error types associated with this exception:
|
10 |
+
* <ul>
|
11 |
+
* <li>ERROR_TYPE_PERSISTENCE - the update could not be persisted
|
12 |
+
* <li>ERROR_TYPE_ILLEGAL_VALUE - an illegal value was committed
|
13 |
+
* <li>ERROR_TYPE_DUPLICATE_KEY_VALUE - a duplicate key was committed
|
14 |
+
* <li>ERROR_TYPE_ILLEGAL_OPERATION - an illegal operation was triggered
|
15 |
+
* </ul>
|
16 |
+
*
|
17 |
+
* @see Inx_Api_BusinessObject#commitUpdate()
|
18 |
+
* @version $Revision$ $Date$ $Author$
|
19 |
+
* @package Inxmail
|
20 |
+
*/
|
21 |
+
class Inx_Api_UpdateException extends Exception
|
22 |
+
{
|
23 |
+
/** Error type indicating that a persistence error has occurred. */
|
24 |
+
const ERROR_TYPE_PERSISTENCE = -1;
|
25 |
+
|
26 |
+
/** Error type indicating that an illegal value was committed. */
|
27 |
+
const ERROR_TYPE_ILLEGAL_VALUE = -2;
|
28 |
+
|
29 |
+
/** Error type indicating that a duplicate key was committed. */
|
30 |
+
const ERROR_TYPE_DUPLICATE_KEY_VALUE = -3;
|
31 |
+
|
32 |
+
/** Error type indicating that an illegal operation was triggered. */
|
33 |
+
const ERROR_TYPE_ILLEGAL_OPERATION = -4;
|
34 |
+
|
35 |
+
/** Indicates that no error source was specified. */
|
36 |
+
const ERROR_SOURCE_NOT_SPECIFIED = -1000;
|
37 |
+
|
38 |
+
/** The error type of this exception. */
|
39 |
+
protected $iErrorType;
|
40 |
+
|
41 |
+
/** The error source of this exception. */
|
42 |
+
protected $iErrorSource;
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Creates a new <i>Inx_Api_UpdateException</i> with the given error type, error source and detail message.
|
47 |
+
*
|
48 |
+
* @param $sMsg the detail message.
|
49 |
+
* @param $iErrorCode the error type. One of the error type constants defined in this exception.
|
50 |
+
* @param $iErrorSource the error source. Can be either <i>Inx_Api_UpdateException.ERROR_SOURCE_NOT_SPECIFIED</i> or a
|
51 |
+
* more specific constant of a related <i>Inx_Api_BusinessObject</i> (e.g.
|
52 |
+
* <i>Inx_Api_List_ListContext.ATTRIBUTE_NAME</i>).
|
53 |
+
*/
|
54 |
+
public function __construct( $sMsg, $iErrorCode, $iErrorSource)
|
55 |
+
{
|
56 |
+
parent::__construct( $sMsg, $iErrorCode );
|
57 |
+
$this->iErrorSource = $iErrorSource;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Returns the error source. The error source can be <i>Inx_ApiUpdateException::ERROR_SOURCE_NOT_SPECIFIED</i>
|
62 |
+
* or a more specific constant of a related <i>Inx_Api_BusinessObject</i>.
|
63 |
+
* <p>
|
64 |
+
* e.g. <i>Inx_Api_List_ListContext::ATTRIBUTE_NAME</i> if the list name is illegal or already exists.
|
65 |
+
*
|
66 |
+
* @return int the error source.
|
67 |
+
*/
|
68 |
+
public function getErrorSource()
|
69 |
+
{
|
70 |
+
return $this->iErrorSource;
|
71 |
+
}
|
72 |
+
}
|
lib/Inx/Api/User.php
CHANGED
@@ -1,83 +1,83 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
/**
|
6 |
-
* The <i>User</i> object contains information about the actual logged in user.
|
7 |
-
* <P>
|
8 |
-
* Copyright (c) 2010 Inxmail GmbH. All Rights Reserved.
|
9 |
-
*
|
10 |
-
* @since API 1.7.0
|
11 |
-
* @package Inxmail
|
12 |
-
*/
|
13 |
-
class Inx_Api_User
|
14 |
-
{
|
15 |
-
|
16 |
-
private $user;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* This constructor is used internally to create an <i>Inx_Api_User</i> object.
|
20 |
-
* @param stdClass $user the user data.
|
21 |
-
*/
|
22 |
-
public function __construct( $user )
|
23 |
-
{
|
24 |
-
$this->user = $user;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Returns the user name of the logged in user.
|
30 |
-
*
|
31 |
-
* @return string the user name of the logged in user.
|
32 |
-
*/
|
33 |
-
public function getUsername()
|
34 |
-
{
|
35 |
-
return $this->user->username;
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Returns the email address of the logged in user.
|
41 |
-
*
|
42 |
-
* @return string the email address of the logged in user.
|
43 |
-
*/
|
44 |
-
public function getEMail()
|
45 |
-
{
|
46 |
-
return $this->user->email;
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Returns the real name of the logged in user.
|
52 |
-
*
|
53 |
-
* @return string the real name of the logged in user.
|
54 |
-
*/
|
55 |
-
public function getRealName()
|
56 |
-
{
|
57 |
-
return $this->user->realname;
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Returns the description of the logged in user.
|
63 |
-
*
|
64 |
-
* @return string the description of the logged in user.
|
65 |
-
*/
|
66 |
-
public function getDescription()
|
67 |
-
{
|
68 |
-
return $this->user->description;
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Return the creation date of the logged in user as ISO 8601 formatted date string.
|
74 |
-
*
|
75 |
-
* @return string the creation date of the logged in user as ISO 8601 formatted date string.
|
76 |
-
*/
|
77 |
-
public function getCreationDate()
|
78 |
-
{
|
79 |
-
return $this->user->creationdate;
|
80 |
-
}
|
81 |
-
|
82 |
-
}
|
83 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
/**
|
6 |
+
* The <i>User</i> object contains information about the actual logged in user.
|
7 |
+
* <P>
|
8 |
+
* Copyright (c) 2010 Inxmail GmbH. All Rights Reserved.
|
9 |
+
*
|
10 |
+
* @since API 1.7.0
|
11 |
+
* @package Inxmail
|
12 |
+
*/
|
13 |
+
class Inx_Api_User
|
14 |
+
{
|
15 |
+
|
16 |
+
private $user;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* This constructor is used internally to create an <i>Inx_Api_User</i> object.
|
20 |
+
* @param stdClass $user the user data.
|
21 |
+
*/
|
22 |
+
public function __construct( $user )
|
23 |
+
{
|
24 |
+
$this->user = $user;
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Returns the user name of the logged in user.
|
30 |
+
*
|
31 |
+
* @return string the user name of the logged in user.
|
32 |
+
*/
|
33 |
+
public function getUsername()
|
34 |
+
{
|
35 |
+
return $this->user->username;
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Returns the email address of the logged in user.
|
41 |
+
*
|
42 |
+
* @return string the email address of the logged in user.
|
43 |
+
*/
|
44 |
+
public function getEMail()
|
45 |
+
{
|
46 |
+
return $this->user->email;
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Returns the real name of the logged in user.
|
52 |
+
*
|
53 |
+
* @return string the real name of the logged in user.
|
54 |
+
*/
|
55 |
+
public function getRealName()
|
56 |
+
{
|
57 |
+
return $this->user->realname;
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Returns the description of the logged in user.
|
63 |
+
*
|
64 |
+
* @return string the description of the logged in user.
|
65 |
+
*/
|
66 |
+
public function getDescription()
|
67 |
+
{
|
68 |
+
return $this->user->description;
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Return the creation date of the logged in user as ISO 8601 formatted date string.
|
74 |
+
*
|
75 |
+
* @return string the creation date of the logged in user as ISO 8601 formatted date string.
|
76 |
+
*/
|
77 |
+
public function getCreationDate()
|
78 |
+
{
|
79 |
+
return $this->user->creationdate;
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
83 |
+
?>
|
lib/Inx/Api/UserContext.php
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Inxmail
|
4 |
-
*/
|
5 |
-
|
6 |
-
/**
|
7 |
-
* The <i>Inx_Api_UserContext</i> allows to check the rights of the currently logged in user and gives access to the
|
8 |
-
* <i>Inx_Api_user</i> object.
|
9 |
-
*
|
10 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
-
* @package Inxmail
|
12 |
-
*/
|
13 |
-
interface Inx_Api_UserContext
|
14 |
-
{
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Checks if the currently logged in user has the specified user right.
|
18 |
-
*
|
19 |
-
* @param string $sUserRight the user right (Inx_Api_UserRights) to be checked.
|
20 |
-
* @return boolean true, if the user has the right; false, otherwise.
|
21 |
-
* @see Inx_Api_UserRights
|
22 |
-
*/
|
23 |
-
public function hasUserRight( $sUserRight );
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Refreshes this <i>Inx_Api_UserContext</i>.
|
28 |
-
* Reloads the newest user rights from the server.
|
29 |
-
*/
|
30 |
-
public function refresh();
|
31 |
-
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Returns the timestamp from the last refresh.
|
35 |
-
*
|
36 |
-
* @return int the timestamp from the last refresh.
|
37 |
-
*/
|
38 |
-
public function getLastRefresh();
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Returns the currently logged in <i>Inx_Api_User</i>.
|
42 |
-
*
|
43 |
-
* @return Inx_Api_User the currently logged in <i>Inx_Api_User</i>.
|
44 |
-
* @since API 1.7.0
|
45 |
-
*/
|
46 |
-
public function whoAmI();
|
47 |
-
|
48 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Inxmail
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* The <i>Inx_Api_UserContext</i> allows to check the rights of the currently logged in user and gives access to the
|
8 |
+
* <i>Inx_Api_user</i> object.
|
9 |
+
*
|
10 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
11 |
+
* @package Inxmail
|
12 |
+
*/
|
13 |
+
interface Inx_Api_UserContext
|
14 |
+
{
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Checks if the currently logged in user has the specified user right.
|
18 |
+
*
|
19 |
+
* @param string $sUserRight the user right (Inx_Api_UserRights) to be checked.
|
20 |
+
* @return boolean true, if the user has the right; false, otherwise.
|
21 |
+
* @see Inx_Api_UserRights
|
22 |
+
*/
|
23 |
+
public function hasUserRight( $sUserRight );
|
24 |
+
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Refreshes this <i>Inx_Api_UserContext</i>.
|
28 |
+
* Reloads the newest user rights from the server.
|
29 |
+
*/
|
30 |
+
public function refresh();
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns the timestamp from the last refresh.
|
35 |
+
*
|
36 |
+
* @return int the timestamp from the last refresh.
|
37 |
+
*/
|
38 |
+
public function getLastRefresh();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Returns the currently logged in <i>Inx_Api_User</i>.
|
42 |
+
*
|
43 |
+
* @return Inx_Api_User the currently logged in <i>Inx_Api_User</i>.
|
44 |
+
* @since API 1.7.0
|
45 |
+
*/
|
46 |
+
public function whoAmI();
|
47 |
+
|
48 |
+
}
|
lib/Inx/Api/Util/TellAFriendException.php
CHANGED
@@ -1,58 +1,58 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Util
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* Thrown by <i>Inx_Api_Util_Utilities::tellAFriend(Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
9 |
-
* $blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro)</i> to indicate that the mail could not be forwarded.
|
10 |
-
* For further insight on the error, inspect the error code. The following error codes may occur:
|
11 |
-
* <p>
|
12 |
-
* <ul>
|
13 |
-
* <li><i>TELLAFRIEND_MAILBUILD_ERROR</i>: The mailing could not be built.
|
14 |
-
* <li><i>TELLAFRIEND_MAILSEND_ERROR</i>: The mail could not be sent.
|
15 |
-
* <li><i>TELLAFRIEND_ORIGINAL_RECIPIENT_ERROR</i>: The original recipient could not be found.
|
16 |
-
* <li><i>TELLAFRIEND_TARGET_RECIPIENT_ERROR</i>: The target recipient address is invalid.
|
17 |
-
* <li><i>TELLAFRIEND_TASK_ERROR</i>: The task (mail) could not be found.
|
18 |
-
* </ul>
|
19 |
-
*
|
20 |
-
* @see Inx_Api_Util_Utilities::tellAFriend(Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
21 |
-
* $blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro)
|
22 |
-
* @since API 1.1.0
|
23 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
24 |
-
* @package Inxmail
|
25 |
-
* @subpackage Util
|
26 |
-
*/
|
27 |
-
class Inx_Api_Util_TellAFriendException extends Exception
|
28 |
-
{
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Error constant stating that the mail could not be built anymore.
|
32 |
-
* This is probably permanent.
|
33 |
-
*/
|
34 |
-
const TELLAFRIEND_MAILBUILD_ERROR = -200;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Error constant stating that the mail could not be sent.
|
38 |
-
* This is most likely a runtime error, might succeed later.
|
39 |
-
*/
|
40 |
-
const TELLAFRIEND_MAILSEND_ERROR = -201;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Error constant stating that the original recipient could not be found.
|
44 |
-
*/
|
45 |
-
const TELLAFRIEND_ORIGINAL_RECIPIENT_ERROR = -202;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Error constant stating that the target recipient could not be determined.
|
49 |
-
* This is most likely caused by an illegal email address, which is not conform to the RFC standard.
|
50 |
-
*/
|
51 |
-
const TELLAFRIEND_TARGET_RECIPIENT_ERROR = -203;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Error constant stating that the task (mail) could not be found.
|
55 |
-
*/
|
56 |
-
const TELLAFRIEND_TASK_ERROR = -204;
|
57 |
-
|
58 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Util
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* Thrown by <i>Inx_Api_Util_Utilities::tellAFriend(Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
9 |
+
* $blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro)</i> to indicate that the mail could not be forwarded.
|
10 |
+
* For further insight on the error, inspect the error code. The following error codes may occur:
|
11 |
+
* <p>
|
12 |
+
* <ul>
|
13 |
+
* <li><i>TELLAFRIEND_MAILBUILD_ERROR</i>: The mailing could not be built.
|
14 |
+
* <li><i>TELLAFRIEND_MAILSEND_ERROR</i>: The mail could not be sent.
|
15 |
+
* <li><i>TELLAFRIEND_ORIGINAL_RECIPIENT_ERROR</i>: The original recipient could not be found.
|
16 |
+
* <li><i>TELLAFRIEND_TARGET_RECIPIENT_ERROR</i>: The target recipient address is invalid.
|
17 |
+
* <li><i>TELLAFRIEND_TASK_ERROR</i>: The task (mail) could not be found.
|
18 |
+
* </ul>
|
19 |
+
*
|
20 |
+
* @see Inx_Api_Util_Utilities::tellAFriend(Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
21 |
+
* $blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro)
|
22 |
+
* @since API 1.1.0
|
23 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
24 |
+
* @package Inxmail
|
25 |
+
* @subpackage Util
|
26 |
+
*/
|
27 |
+
class Inx_Api_Util_TellAFriendException extends Exception
|
28 |
+
{
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Error constant stating that the mail could not be built anymore.
|
32 |
+
* This is probably permanent.
|
33 |
+
*/
|
34 |
+
const TELLAFRIEND_MAILBUILD_ERROR = -200;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Error constant stating that the mail could not be sent.
|
38 |
+
* This is most likely a runtime error, might succeed later.
|
39 |
+
*/
|
40 |
+
const TELLAFRIEND_MAILSEND_ERROR = -201;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Error constant stating that the original recipient could not be found.
|
44 |
+
*/
|
45 |
+
const TELLAFRIEND_ORIGINAL_RECIPIENT_ERROR = -202;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Error constant stating that the target recipient could not be determined.
|
49 |
+
* This is most likely caused by an illegal email address, which is not conform to the RFC standard.
|
50 |
+
*/
|
51 |
+
const TELLAFRIEND_TARGET_RECIPIENT_ERROR = -203;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Error constant stating that the task (mail) could not be found.
|
55 |
+
*/
|
56 |
+
const TELLAFRIEND_TASK_ERROR = -204;
|
57 |
+
|
58 |
+
}
|
lib/Inx/Api/Util/TemporaryMail.php
CHANGED
@@ -1,125 +1,125 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Util
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* A <i>Inx_Api_Util_TemporaryMail</i> is a mailing that may be sent to a single recipient that does not have to be a
|
9 |
-
* registered recipient in Inxmail.
|
10 |
-
* A temporary mailing behaves mostly like a simple version of a normal <i>Inx_Api_Mailing_Mailing</i>.
|
11 |
-
* However, the mailing will not be personalized and will not be saved in Inxmail and therefore won't be trackable.
|
12 |
-
* <i>TemporaryMail</i>s may be sent using the <i>Inx_Api_Util_TemporaryMailSender</i>.
|
13 |
-
* <p>
|
14 |
-
* Because a <i>TemporaryMail</i> does not belong to a specific list, you have to specify some information not
|
15 |
-
* needed when using a normal <i>Mailing</i>. The most important is the recipient address.
|
16 |
-
* Normally, the recipient address is determined by the list, but as a temporary mail does not belong to any list,
|
17 |
-
* there is no predefined recipient address.
|
18 |
-
* The same is true for the reply address, though this address is not technically required to send the mail.
|
19 |
-
* The sender address, on the other hand, does not have to be specified as long as it is configured in the list
|
20 |
-
* that was passed on the creation of the temporary mailing.
|
21 |
-
* <p>
|
22 |
-
* <strong>Note:</strong> While it is discouraged to explicitly set the recipient address of a standard
|
23 |
-
* <i>Inx_Api_Mailing_Mailing</i>, this is a technical requirement for the <i>TemporaryMail</i>.
|
24 |
-
* You won't be able to send a temporary mail to a recipient not registered in Inxmail without specifying the sender
|
25 |
-
* address, though the send method will return <i>true</i>.
|
26 |
-
* You may, however, send the mailing to a recipient known by Inxmail, without explicitly specifying the sender address.
|
27 |
-
* To do so, use the <i>Inx_Api_Util_TemporaryMailSender::sendTemporaryMail($oTemporaryMail, $iRecipientId)</i> method.
|
28 |
-
* This method will also personalize the mailing for the given recipient.
|
29 |
-
* <p>
|
30 |
-
* For an example on how to send a temporary mail, see the <i>Inx_Api_Util_TemporaryMailSender</i> documentation.
|
31 |
-
*
|
32 |
-
* @see Inx_Api_Util_TemporaryMailSender
|
33 |
-
* @see Inx_Api_Mailing_Mailing
|
34 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
35 |
-
* @package Inxmail
|
36 |
-
* @subpackage Util
|
37 |
-
*/
|
38 |
-
interface Inx_Api_Util_TemporaryMail
|
39 |
-
{
|
40 |
-
/**
|
41 |
-
* Returns the sender address of this temporary mailing.
|
42 |
-
*
|
43 |
-
* @return string the sender address of this temporary mailing.
|
44 |
-
*/
|
45 |
-
public function getSenderAddress();
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Sets the sender address of this temporary mailing.
|
49 |
-
*
|
50 |
-
* @param string $sSenderAddress the sender address of this temporary mailing.
|
51 |
-
*/
|
52 |
-
public function updateSenderAddress( $sSenderAddress );
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Returns the recipient address header value of this temporary mailing.
|
57 |
-
* This is the address to which the mailing will be sent.
|
58 |
-
*
|
59 |
-
* @return string the recipient address header value of this temporary mailing.
|
60 |
-
*/
|
61 |
-
public function getRecipientAddress();
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Sets the recipient address header value of this temporary mailing.
|
65 |
-
* This is the address to which the mailing will be sent.
|
66 |
-
*
|
67 |
-
* @param string $sRecipientAddress the recipient address header value of this temporary mailing.
|
68 |
-
*/
|
69 |
-
public function updateRecipientAddress( $sRecipientAddress );
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Returns the reply address of this temporary mailing.
|
74 |
-
*
|
75 |
-
* @return string the reply address of this temporary mailing.
|
76 |
-
*/
|
77 |
-
public function getReplyToAddress();
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Sets the reply address of this temporary mailing.
|
81 |
-
* Replies to this mailing will be sent to the given address.
|
82 |
-
*
|
83 |
-
* @param string $sReplyToAddress the reply address of this mailing.
|
84 |
-
*/
|
85 |
-
public function updateReplyToAddress( $sReplyToAddress );
|
86 |
-
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Returns the subject of this temporary mailing.
|
90 |
-
*
|
91 |
-
* @return string the subject of this temporary mailing.
|
92 |
-
*/
|
93 |
-
public function getSubject();
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Sets the subject of this temporary mailing.
|
97 |
-
*
|
98 |
-
* @param string $sSubject the subject of this temporary mailing.
|
99 |
-
*/
|
100 |
-
public function updateSubject( $sSubject );
|
101 |
-
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Returns the content handler, which contains the format-specific mail content.
|
105 |
-
*
|
106 |
-
* @return Inx_Api_Mailing_ContentHandler the content handler.
|
107 |
-
*/
|
108 |
-
public function getContentHandler();
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Creates a new content handler. Allowed classes are:
|
112 |
-
* <ul>
|
113 |
-
* <li><i>PlainTextContentHandler</i>
|
114 |
-
* <li><i>HtmlTextContentHandler</i>
|
115 |
-
* <li><i>MultiPartContentHandler</i>
|
116 |
-
* <li><i>XsltMultiPartContentHandler</i>
|
117 |
-
* <li><i>XsltHtmlTextContentHandler</i>
|
118 |
-
* <li><i>XsltPlainTextContentHandler</i>
|
119 |
-
* </ul>
|
120 |
-
*
|
121 |
-
* @param string $oContentHandlerClazz the <i>Class</i> of the content handler
|
122 |
-
*/
|
123 |
-
public function setContentHandler( $oContentHandlerClazz );
|
124 |
-
|
125 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Util
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* A <i>Inx_Api_Util_TemporaryMail</i> is a mailing that may be sent to a single recipient that does not have to be a
|
9 |
+
* registered recipient in Inxmail.
|
10 |
+
* A temporary mailing behaves mostly like a simple version of a normal <i>Inx_Api_Mailing_Mailing</i>.
|
11 |
+
* However, the mailing will not be personalized and will not be saved in Inxmail and therefore won't be trackable.
|
12 |
+
* <i>TemporaryMail</i>s may be sent using the <i>Inx_Api_Util_TemporaryMailSender</i>.
|
13 |
+
* <p>
|
14 |
+
* Because a <i>TemporaryMail</i> does not belong to a specific list, you have to specify some information not
|
15 |
+
* needed when using a normal <i>Mailing</i>. The most important is the recipient address.
|
16 |
+
* Normally, the recipient address is determined by the list, but as a temporary mail does not belong to any list,
|
17 |
+
* there is no predefined recipient address.
|
18 |
+
* The same is true for the reply address, though this address is not technically required to send the mail.
|
19 |
+
* The sender address, on the other hand, does not have to be specified as long as it is configured in the list
|
20 |
+
* that was passed on the creation of the temporary mailing.
|
21 |
+
* <p>
|
22 |
+
* <strong>Note:</strong> While it is discouraged to explicitly set the recipient address of a standard
|
23 |
+
* <i>Inx_Api_Mailing_Mailing</i>, this is a technical requirement for the <i>TemporaryMail</i>.
|
24 |
+
* You won't be able to send a temporary mail to a recipient not registered in Inxmail without specifying the sender
|
25 |
+
* address, though the send method will return <i>true</i>.
|
26 |
+
* You may, however, send the mailing to a recipient known by Inxmail, without explicitly specifying the sender address.
|
27 |
+
* To do so, use the <i>Inx_Api_Util_TemporaryMailSender::sendTemporaryMail($oTemporaryMail, $iRecipientId)</i> method.
|
28 |
+
* This method will also personalize the mailing for the given recipient.
|
29 |
+
* <p>
|
30 |
+
* For an example on how to send a temporary mail, see the <i>Inx_Api_Util_TemporaryMailSender</i> documentation.
|
31 |
+
*
|
32 |
+
* @see Inx_Api_Util_TemporaryMailSender
|
33 |
+
* @see Inx_Api_Mailing_Mailing
|
34 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
35 |
+
* @package Inxmail
|
36 |
+
* @subpackage Util
|
37 |
+
*/
|
38 |
+
interface Inx_Api_Util_TemporaryMail
|
39 |
+
{
|
40 |
+
/**
|
41 |
+
* Returns the sender address of this temporary mailing.
|
42 |
+
*
|
43 |
+
* @return string the sender address of this temporary mailing.
|
44 |
+
*/
|
45 |
+
public function getSenderAddress();
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Sets the sender address of this temporary mailing.
|
49 |
+
*
|
50 |
+
* @param string $sSenderAddress the sender address of this temporary mailing.
|
51 |
+
*/
|
52 |
+
public function updateSenderAddress( $sSenderAddress );
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Returns the recipient address header value of this temporary mailing.
|
57 |
+
* This is the address to which the mailing will be sent.
|
58 |
+
*
|
59 |
+
* @return string the recipient address header value of this temporary mailing.
|
60 |
+
*/
|
61 |
+
public function getRecipientAddress();
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Sets the recipient address header value of this temporary mailing.
|
65 |
+
* This is the address to which the mailing will be sent.
|
66 |
+
*
|
67 |
+
* @param string $sRecipientAddress the recipient address header value of this temporary mailing.
|
68 |
+
*/
|
69 |
+
public function updateRecipientAddress( $sRecipientAddress );
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns the reply address of this temporary mailing.
|
74 |
+
*
|
75 |
+
* @return string the reply address of this temporary mailing.
|
76 |
+
*/
|
77 |
+
public function getReplyToAddress();
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Sets the reply address of this temporary mailing.
|
81 |
+
* Replies to this mailing will be sent to the given address.
|
82 |
+
*
|
83 |
+
* @param string $sReplyToAddress the reply address of this mailing.
|
84 |
+
*/
|
85 |
+
public function updateReplyToAddress( $sReplyToAddress );
|
86 |
+
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Returns the subject of this temporary mailing.
|
90 |
+
*
|
91 |
+
* @return string the subject of this temporary mailing.
|
92 |
+
*/
|
93 |
+
public function getSubject();
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Sets the subject of this temporary mailing.
|
97 |
+
*
|
98 |
+
* @param string $sSubject the subject of this temporary mailing.
|
99 |
+
*/
|
100 |
+
public function updateSubject( $sSubject );
|
101 |
+
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Returns the content handler, which contains the format-specific mail content.
|
105 |
+
*
|
106 |
+
* @return Inx_Api_Mailing_ContentHandler the content handler.
|
107 |
+
*/
|
108 |
+
public function getContentHandler();
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Creates a new content handler. Allowed classes are:
|
112 |
+
* <ul>
|
113 |
+
* <li><i>PlainTextContentHandler</i>
|
114 |
+
* <li><i>HtmlTextContentHandler</i>
|
115 |
+
* <li><i>MultiPartContentHandler</i>
|
116 |
+
* <li><i>XsltMultiPartContentHandler</i>
|
117 |
+
* <li><i>XsltHtmlTextContentHandler</i>
|
118 |
+
* <li><i>XsltPlainTextContentHandler</i>
|
119 |
+
* </ul>
|
120 |
+
*
|
121 |
+
* @param string $oContentHandlerClazz the <i>Class</i> of the content handler
|
122 |
+
*/
|
123 |
+
public function setContentHandler( $oContentHandlerClazz );
|
124 |
+
|
125 |
+
}
|
lib/Inx/Api/Util/TemporaryMailSender.php
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Util
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Util_TemporaryMailSender</i> may be used to send <i>Inx_Api_Util_TemporaryMail</i>s.
|
9 |
-
* A <i>TemporaryMail</i> is a mailing that may be sent to a single recipient that does not have to be a registered
|
10 |
-
* recipient in Inxmail.
|
11 |
-
* The mailing will not be personalized and will not be saved in Inxmail and therefore won't be trackable.
|
12 |
-
* <p>
|
13 |
-
* The following snippet shows how to send a temporary mail:
|
14 |
-
*
|
15 |
-
* <pre>
|
16 |
-
* $oListContextManager = $oSession->getListContextManager();
|
17 |
-
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
18 |
-
*
|
19 |
-
* $oTemporaryMailSender = $oSession->getTemporaryMailSender();
|
20 |
-
* $oTemporaryMail = $oTemporaryMailSender->createTemporaryMail( $oListContext );
|
21 |
-
* $oTemporaryMail->updateRecipientAddress( "recipient@domain.invalid" );
|
22 |
-
* $oTemporaryMail->updateSenderAddress( "sender@domains.invalid" );
|
23 |
-
* $oTemporaryMail->updateSubject( "Temporary Mailing" );
|
24 |
-
* $oTemporaryMail->setContentHandler( 'Inx_Api_Mailing_HtmlTextContentHandler' );
|
25 |
-
*
|
26 |
-
* $oHtmlTextContentHandler = $oTemporaryMail->getContentHandler();
|
27 |
-
* $oHtmlTextContentHandler->updateContent( "<html><head></head><body>Hi there,<br>this is a temporary mailing!</body></html>" );
|
28 |
-
*
|
29 |
-
* $blSuccess = $oTemporaryMailSender->sendTemporaryMail( $oTemporaryMail );
|
30 |
-
*
|
31 |
-
* if( $blSuccess )
|
32 |
-
* {
|
33 |
-
* echo "Mailing sended.<br>";
|
34 |
-
* }
|
35 |
-
* else
|
36 |
-
* {
|
37 |
-
* echo "Mailing not sended.<br>";
|
38 |
-
* }
|
39 |
-
* </pre>
|
40 |
-
*
|
41 |
-
* The approach shown above will send a mail to the specified recipient address without any personalization.
|
42 |
-
* To personalize a mailing for a specific recipient, use the <i>sendTemporaryMail($oTemporaryMail, $iRecipientId)</i>
|
43 |
-
* method instead.
|
44 |
-
* You can mix using this method and explicitly specifying a recipient address to send a mailing to a recipient
|
45 |
-
* (possibly unknown to Inxmail) which was personalized for a different recipient.
|
46 |
-
* <p>
|
47 |
-
* <strong>Note:</strong> Be aware that the <i>bool</i> returned by the send method does not state if the mail has really been sent.
|
48 |
-
* The method may return <i>true</i> even though no recipient address was specified, thus the mail was not sent to any recipient.
|
49 |
-
* The only requirement is that the sender address has been set and the content is not <i>null</i> or empty.
|
50 |
-
* The sender address may also be determined by the list provided on the creation of the mail, as long as the address is configured.
|
51 |
-
* <p>
|
52 |
-
* For more information on temporary mails in general, see the <i>Inx_Api_Util_TemporaryMail</i> documentation.
|
53 |
-
*
|
54 |
-
* @see Inx_Api_Util_TemporaryMail
|
55 |
-
* @version $Revision: 9545 $ $Date: 2007-12-21 18:49:01 +0200 (Pn, 21 Grd 2007) $ $Author: vladas $
|
56 |
-
* @package Inxmail
|
57 |
-
* @subpackage Util
|
58 |
-
*/
|
59 |
-
interface Inx_Api_Util_TemporaryMailSender
|
60 |
-
{
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Creates a <i>TemporaryMail</i> using the sender address of the specified list by default.
|
64 |
-
*
|
65 |
-
* @param Inx_Api_List_ListContext $oListContext the list context.
|
66 |
-
* @return Inx_Api_Util_TemporaryMail a new <i>TemporaryMail</i>.
|
67 |
-
*/
|
68 |
-
public function createTemporaryMail( Inx_Api_List_ListContext $oListContext );
|
69 |
-
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Sends the specified <i>TemporaryMail</i> to the given recipient, if any was passed.
|
73 |
-
* The mail will be personalized for this recipient.
|
74 |
-
* It is possible to override the recipient address using <i>Inx_Api_Util_TemporaryMail::updateRecipientAddress($sRecipientAddress)</i>.
|
75 |
-
* Using this approach you can send a mail to a recipient which is personalized for a different recipient.
|
76 |
-
* <p>
|
77 |
-
* <strong>Note:</strong> If the recipient id is ommitted, you are required to specify a recipient address.
|
78 |
-
* <p>
|
79 |
-
* <strong>Note:</strong> This method may return <i>true</i> even if the recipient address was explicitly set to <i>null</i>.
|
80 |
-
*
|
81 |
-
* @param Inx_Api_Util_TemporaryMail $oMail the mail to be sent.
|
82 |
-
* @param int $iRecipientId the recipient for whom the mail shall be personalized and probably send to. May be ommitted.
|
83 |
-
* @return bool <i>true</i> if the mailing could (possibly) be sent, <i>false</i> otherwise.
|
84 |
-
*/
|
85 |
-
public function sendTemporaryMail( $oMail, $iRecipientId = -2 );
|
86 |
-
|
87 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Util
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Util_TemporaryMailSender</i> may be used to send <i>Inx_Api_Util_TemporaryMail</i>s.
|
9 |
+
* A <i>TemporaryMail</i> is a mailing that may be sent to a single recipient that does not have to be a registered
|
10 |
+
* recipient in Inxmail.
|
11 |
+
* The mailing will not be personalized and will not be saved in Inxmail and therefore won't be trackable.
|
12 |
+
* <p>
|
13 |
+
* The following snippet shows how to send a temporary mail:
|
14 |
+
*
|
15 |
+
* <pre>
|
16 |
+
* $oListContextManager = $oSession->getListContextManager();
|
17 |
+
* $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );
|
18 |
+
*
|
19 |
+
* $oTemporaryMailSender = $oSession->getTemporaryMailSender();
|
20 |
+
* $oTemporaryMail = $oTemporaryMailSender->createTemporaryMail( $oListContext );
|
21 |
+
* $oTemporaryMail->updateRecipientAddress( "recipient@domain.invalid" );
|
22 |
+
* $oTemporaryMail->updateSenderAddress( "sender@domains.invalid" );
|
23 |
+
* $oTemporaryMail->updateSubject( "Temporary Mailing" );
|
24 |
+
* $oTemporaryMail->setContentHandler( 'Inx_Api_Mailing_HtmlTextContentHandler' );
|
25 |
+
*
|
26 |
+
* $oHtmlTextContentHandler = $oTemporaryMail->getContentHandler();
|
27 |
+
* $oHtmlTextContentHandler->updateContent( "<html><head></head><body>Hi there,<br>this is a temporary mailing!</body></html>" );
|
28 |
+
*
|
29 |
+
* $blSuccess = $oTemporaryMailSender->sendTemporaryMail( $oTemporaryMail );
|
30 |
+
*
|
31 |
+
* if( $blSuccess )
|
32 |
+
* {
|
33 |
+
* echo "Mailing sended.<br>";
|
34 |
+
* }
|
35 |
+
* else
|
36 |
+
* {
|
37 |
+
* echo "Mailing not sended.<br>";
|
38 |
+
* }
|
39 |
+
* </pre>
|
40 |
+
*
|
41 |
+
* The approach shown above will send a mail to the specified recipient address without any personalization.
|
42 |
+
* To personalize a mailing for a specific recipient, use the <i>sendTemporaryMail($oTemporaryMail, $iRecipientId)</i>
|
43 |
+
* method instead.
|
44 |
+
* You can mix using this method and explicitly specifying a recipient address to send a mailing to a recipient
|
45 |
+
* (possibly unknown to Inxmail) which was personalized for a different recipient.
|
46 |
+
* <p>
|
47 |
+
* <strong>Note:</strong> Be aware that the <i>bool</i> returned by the send method does not state if the mail has really been sent.
|
48 |
+
* The method may return <i>true</i> even though no recipient address was specified, thus the mail was not sent to any recipient.
|
49 |
+
* The only requirement is that the sender address has been set and the content is not <i>null</i> or empty.
|
50 |
+
* The sender address may also be determined by the list provided on the creation of the mail, as long as the address is configured.
|
51 |
+
* <p>
|
52 |
+
* For more information on temporary mails in general, see the <i>Inx_Api_Util_TemporaryMail</i> documentation.
|
53 |
+
*
|
54 |
+
* @see Inx_Api_Util_TemporaryMail
|
55 |
+
* @version $Revision: 9545 $ $Date: 2007-12-21 18:49:01 +0200 (Pn, 21 Grd 2007) $ $Author: vladas $
|
56 |
+
* @package Inxmail
|
57 |
+
* @subpackage Util
|
58 |
+
*/
|
59 |
+
interface Inx_Api_Util_TemporaryMailSender
|
60 |
+
{
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Creates a <i>TemporaryMail</i> using the sender address of the specified list by default.
|
64 |
+
*
|
65 |
+
* @param Inx_Api_List_ListContext $oListContext the list context.
|
66 |
+
* @return Inx_Api_Util_TemporaryMail a new <i>TemporaryMail</i>.
|
67 |
+
*/
|
68 |
+
public function createTemporaryMail( Inx_Api_List_ListContext $oListContext );
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Sends the specified <i>TemporaryMail</i> to the given recipient, if any was passed.
|
73 |
+
* The mail will be personalized for this recipient.
|
74 |
+
* It is possible to override the recipient address using <i>Inx_Api_Util_TemporaryMail::updateRecipientAddress($sRecipientAddress)</i>.
|
75 |
+
* Using this approach you can send a mail to a recipient which is personalized for a different recipient.
|
76 |
+
* <p>
|
77 |
+
* <strong>Note:</strong> If the recipient id is ommitted, you are required to specify a recipient address.
|
78 |
+
* <p>
|
79 |
+
* <strong>Note:</strong> This method may return <i>true</i> even if the recipient address was explicitly set to <i>null</i>.
|
80 |
+
*
|
81 |
+
* @param Inx_Api_Util_TemporaryMail $oMail the mail to be sent.
|
82 |
+
* @param int $iRecipientId the recipient for whom the mail shall be personalized and probably send to. May be ommitted.
|
83 |
+
* @return bool <i>true</i> if the mailing could (possibly) be sent, <i>false</i> otherwise.
|
84 |
+
*/
|
85 |
+
public function sendTemporaryMail( $oMail, $iRecipientId = -2 );
|
86 |
+
|
87 |
+
}
|
lib/Inx/Api/Util/Utilities.php
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Inxmail
|
5 |
-
* @subpackage Util
|
6 |
-
*/
|
7 |
-
/**
|
8 |
-
* The <i>Inx_Api_Util_Utilities</i> class provides utility methods that can be used for special activities.
|
9 |
-
*
|
10 |
-
* @since API 1.1.0
|
11 |
-
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
-
* @package Inxmail
|
13 |
-
* @subpackage Util
|
14 |
-
*/
|
15 |
-
interface Inx_Api_Util_Utilities
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* Forwards a mailing to someone different from the original recipient.
|
19 |
-
* The mailing may be personalized for the original recipient, and introductory information (e.g. who
|
20 |
-
* forwarded the mail, and who to subscribe) may be added.
|
21 |
-
*
|
22 |
-
* @param Inx_Api_List_ListContext $oListContext the list to which the mail was sent.
|
23 |
-
* @param int $iMailingId the mailing to forward.
|
24 |
-
* @param int $iRecipientId the original recipient.
|
25 |
-
* @param bool $blTakeProfile <code>true</code> if the mailing shall be personalized for the original recipient,
|
26 |
-
* <code>false</code> otherwise.
|
27 |
-
* @param string $sEmail the address of the recipient to whom the mail shall be forwarded.
|
28 |
-
* @param string $sTextIntro introductory text, plain text format.
|
29 |
-
* @param string $sHtmlIntro introductory text, HTML format.
|
30 |
-
* @throws Inx_Api_Util_TellAFriendException if the mail could not be forwarded.
|
31 |
-
* @since API 1.1.0
|
32 |
-
*/
|
33 |
-
public function tellAFriend( Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
34 |
-
$blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro );
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Checks whether the given test recipient id exists.
|
38 |
-
*
|
39 |
-
* @param int $iIdToCheck the test recipient id to check.
|
40 |
-
* @return bool <i>true</i> if the given test recipient id exists, <i>false</i> otherwise.
|
41 |
-
* @since API 1.6.0
|
42 |
-
*/
|
43 |
-
public function existsTestRecipient( $iIdToCheck );
|
44 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Inxmail
|
5 |
+
* @subpackage Util
|
6 |
+
*/
|
7 |
+
/**
|
8 |
+
* The <i>Inx_Api_Util_Utilities</i> class provides utility methods that can be used for special activities.
|
9 |
+
*
|
10 |
+
* @since API 1.1.0
|
11 |
+
* @version $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
|
12 |
+
* @package Inxmail
|
13 |
+
* @subpackage Util
|
14 |
+
*/
|
15 |
+
interface Inx_Api_Util_Utilities
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* Forwards a mailing to someone different from the original recipient.
|
19 |
+
* The mailing may be personalized for the original recipient, and introductory information (e.g. who
|
20 |
+
* forwarded the mail, and who to subscribe) may be added.
|
21 |
+
*
|
22 |
+
* @param Inx_Api_List_ListContext $oListContext the list to which the mail was sent.
|
23 |
+
* @param int $iMailingId the mailing to forward.
|
24 |
+
* @param int $iRecipientId the original recipient.
|
25 |
+
* @param bool $blTakeProfile <code>true</code> if the mailing shall be personalized for the original recipient,
|
26 |
+
* <code>false</code> otherwise.
|
27 |
+
* @param string $sEmail the address of the recipient to whom the mail shall be forwarded.
|
28 |
+
* @param string $sTextIntro introductory text, plain text format.
|
29 |
+
* @param string $sHtmlIntro introductory text, HTML format.
|
30 |
+
* @throws Inx_Api_Util_TellAFriendException if the mail could not be forwarded.
|
31 |
+
* @since API 1.1.0
|
32 |
+
*/
|
33 |
+
public function tellAFriend( Inx_Api_List_ListContext $oListContext, $iMailingId, $iRecipientId,
|
34 |
+
$blTakeProfile, $sEmail, $sTextIntro, $sHtmlIntro );
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Checks whether the given test recipient id exists.
|
38 |
+
*
|
39 |
+
* @param int $iIdToCheck the test recipient id to check.
|
40 |
+
* @return bool <i>true</i> if the given test recipient id exists, <i>false</i> otherwise.
|
41 |
+
* @since API 1.6.0
|
42 |
+
*/
|
43 |
+
public function existsTestRecipient( $iIdToCheck );
|
44 |
+
}
|
lib/Inx/Api/Webpage/Webpage.php
CHANGED
@@ -1,98 +1,98 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* An <i>Inx_Api_Webpage_Webpage</i> object can be used to access information about a web page.
|
5 |
-
* A web page can be a JSP or a FORM or of unknown type and is bound to a server URL.
|
6 |
-
* A <i>Webpage</i> object also has a sub type which defines the usage of the web page.
|
7 |
-
* A possible sub type is, for example, subscription.
|
8 |
-
* <p>
|
9 |
-
* The following code snippet prints out the names of all available webpages:
|
10 |
-
*
|
11 |
-
* <PRE>
|
12 |
-
* $oWebpageManager = $oSession->getWebpageManager();
|
13 |
-
* $oBOResultSet = $oWebpageManager->selectAll();
|
14 |
-
*
|
15 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
16 |
-
* {
|
17 |
-
* $oWebpage = $oBOResultSet->get( $i );
|
18 |
-
* echo 'Page name: ' . $oWebpage->getName() . '<br>';
|
19 |
-
* }
|
20 |
-
*
|
21 |
-
* $oBOResultSet->close();
|
22 |
-
* </PRE>
|
23 |
-
*
|
24 |
-
* @see Inx_Api_Webpage_WebpageManager
|
25 |
-
* @author chge, 06.03.2012
|
26 |
-
* @since API 1.9.0
|
27 |
-
* @package Inxmail
|
28 |
-
* @subpackage Webpage
|
29 |
-
*/
|
30 |
-
interface Inx_Api_Webpage_Webpage extends Inx_Api_BusinessObject
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* Type for JSP webpages.
|
34 |
-
*
|
35 |
-
* @var int
|
36 |
-
*/
|
37 |
-
const TYPE_JSP = 0;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Type for form (HTML) webpages.
|
41 |
-
*
|
42 |
-
* @var int
|
43 |
-
*/
|
44 |
-
const TYPE_FORM = 1;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Type for webpages of unknown type.
|
48 |
-
*
|
49 |
-
* @var int
|
50 |
-
*/
|
51 |
-
const TYPE_UNKNOWN = 2;
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Returns the name of this web page.
|
56 |
-
*
|
57 |
-
* @return string the name.
|
58 |
-
*/
|
59 |
-
public function getName();
|
60 |
-
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Returns the server URL this web page is published at.
|
64 |
-
*
|
65 |
-
* @return string the server URL.
|
66 |
-
*/
|
67 |
-
public function getServerUrl();
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Returns the type of this web page. The possible types are:
|
72 |
-
* <ul>
|
73 |
-
* <li><i>TYPE_FORM</i>: A form (HTML) web page
|
74 |
-
* <li><i>TYPE_JSP</i>: A JSP web page
|
75 |
-
* <li><I>TYPE_UNKNOWN</i>: A web page of unknown type
|
76 |
-
* </ul>
|
77 |
-
*
|
78 |
-
* @return int the type.
|
79 |
-
*/
|
80 |
-
public function getType();
|
81 |
-
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Returns the sub type of this web page. A possible value would be subscription.
|
85 |
-
*
|
86 |
-
* @return string the sub type.
|
87 |
-
*/
|
88 |
-
public function getSubType();
|
89 |
-
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Returns the creation date of this web page.
|
93 |
-
* The date will be returned as ISO 8601 formatted datetime string.
|
94 |
-
*
|
95 |
-
* @return string the creation date.
|
96 |
-
*/
|
97 |
-
public function getCreationDate();
|
98 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* An <i>Inx_Api_Webpage_Webpage</i> object can be used to access information about a web page.
|
5 |
+
* A web page can be a JSP or a FORM or of unknown type and is bound to a server URL.
|
6 |
+
* A <i>Webpage</i> object also has a sub type which defines the usage of the web page.
|
7 |
+
* A possible sub type is, for example, subscription.
|
8 |
+
* <p>
|
9 |
+
* The following code snippet prints out the names of all available webpages:
|
10 |
+
*
|
11 |
+
* <PRE>
|
12 |
+
* $oWebpageManager = $oSession->getWebpageManager();
|
13 |
+
* $oBOResultSet = $oWebpageManager->selectAll();
|
14 |
+
*
|
15 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
16 |
+
* {
|
17 |
+
* $oWebpage = $oBOResultSet->get( $i );
|
18 |
+
* echo 'Page name: ' . $oWebpage->getName() . '<br>';
|
19 |
+
* }
|
20 |
+
*
|
21 |
+
* $oBOResultSet->close();
|
22 |
+
* </PRE>
|
23 |
+
*
|
24 |
+
* @see Inx_Api_Webpage_WebpageManager
|
25 |
+
* @author chge, 06.03.2012
|
26 |
+
* @since API 1.9.0
|
27 |
+
* @package Inxmail
|
28 |
+
* @subpackage Webpage
|
29 |
+
*/
|
30 |
+
interface Inx_Api_Webpage_Webpage extends Inx_Api_BusinessObject
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Type for JSP webpages.
|
34 |
+
*
|
35 |
+
* @var int
|
36 |
+
*/
|
37 |
+
const TYPE_JSP = 0;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Type for form (HTML) webpages.
|
41 |
+
*
|
42 |
+
* @var int
|
43 |
+
*/
|
44 |
+
const TYPE_FORM = 1;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Type for webpages of unknown type.
|
48 |
+
*
|
49 |
+
* @var int
|
50 |
+
*/
|
51 |
+
const TYPE_UNKNOWN = 2;
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Returns the name of this web page.
|
56 |
+
*
|
57 |
+
* @return string the name.
|
58 |
+
*/
|
59 |
+
public function getName();
|
60 |
+
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Returns the server URL this web page is published at.
|
64 |
+
*
|
65 |
+
* @return string the server URL.
|
66 |
+
*/
|
67 |
+
public function getServerUrl();
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Returns the type of this web page. The possible types are:
|
72 |
+
* <ul>
|
73 |
+
* <li><i>TYPE_FORM</i>: A form (HTML) web page
|
74 |
+
* <li><i>TYPE_JSP</i>: A JSP web page
|
75 |
+
* <li><I>TYPE_UNKNOWN</i>: A web page of unknown type
|
76 |
+
* </ul>
|
77 |
+
*
|
78 |
+
* @return int the type.
|
79 |
+
*/
|
80 |
+
public function getType();
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Returns the sub type of this web page. A possible value would be subscription.
|
85 |
+
*
|
86 |
+
* @return string the sub type.
|
87 |
+
*/
|
88 |
+
public function getSubType();
|
89 |
+
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Returns the creation date of this web page.
|
93 |
+
* The date will be returned as ISO 8601 formatted datetime string.
|
94 |
+
*
|
95 |
+
* @return string the creation date.
|
96 |
+
*/
|
97 |
+
public function getCreationDate();
|
98 |
}
|
lib/Inx/Api/Webpage/WebpageManager.php
CHANGED
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* An <i>Inx_Api_Webpage_WebpageManager</i> object can be used to retrieve <i>Inx_Api_Webpage_Webpage</i> objects.
|
4 |
-
* The web pages can be retrieved by their id, by their type (i.e. JSP, Form), by their sub type (e.g. "subscription")
|
5 |
-
* or a combination of type and sub type.
|
6 |
-
* <p>
|
7 |
-
* The following code snippet prints out the names of all available web pages (JSPs and forms):
|
8 |
-
*
|
9 |
-
* <PRE>
|
10 |
-
* $oWebpageManager = $oSession->getWebpageManager();
|
11 |
-
* $oBOResultSet = $oWebpageManager->selectAll();
|
12 |
-
*
|
13 |
-
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
14 |
-
* {
|
15 |
-
* $oWebpage = $oBOResultSet->get( $i );
|
16 |
-
* echo 'Page name: ' . $oWebpage->getName() . '<br>';
|
17 |
-
* }
|
18 |
-
*
|
19 |
-
* $oBOResultSet->close();
|
20 |
-
* </PRE>
|
21 |
-
* <p>
|
22 |
-
* For more information on web pages, see the <i>Inx_Api_Webpage_Webpage</i> documentation.
|
23 |
-
*
|
24 |
-
* @see Inx_Api_Webpage_Webpage
|
25 |
-
* @author chge, 06.03.2012
|
26 |
-
* @since API 1.9.0
|
27 |
-
* @package Inxmail
|
28 |
-
* @subpackage Webpage
|
29 |
-
*/
|
30 |
-
interface Inx_Api_Webpage_WebpageManager
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* Returns the web page with the given id.
|
34 |
-
*
|
35 |
-
* @param int $iId the id of the web page to be retrieved.
|
36 |
-
* @return Inx_Api_Webpage_Webpage The web page specified by the given id.
|
37 |
-
* @throws Inx_Api_DataException if the web page has been deleted.
|
38 |
-
*/
|
39 |
-
public function get( $iId );
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Returns a <i>BOResultSet</i> containing all webpages.
|
44 |
-
*
|
45 |
-
* @return Inx_Api_BOResultSet a result set containing all webpages.
|
46 |
-
*/
|
47 |
-
public function selectAll();
|
48 |
-
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Returns a <i>BOResultSet</i> containing all webpages with the given sub type.
|
52 |
-
*
|
53 |
-
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
54 |
-
* @return Inx_Api_BOResultSet a result set containing all webpages with the given sub type.
|
55 |
-
*/
|
56 |
-
public function selectBySubType( $sSubType );
|
57 |
-
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Returns a <i>BOResultSet</i> containing all JSP webpages.
|
61 |
-
*
|
62 |
-
* @return Inx_Api_BOResultSet a result set containing all JSP webpages.
|
63 |
-
*/
|
64 |
-
public function selectAllJsps();
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Returns a <i>BOResultSet</i> containing all form (HTML) webpages.
|
69 |
-
*
|
70 |
-
* @return Inx_Api_BOResultSet a result set containing all form (HTML) webpages.
|
71 |
-
*/
|
72 |
-
public function selectAllForms();
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Returns a <i>BOResultSet</i> containing all JSP webpages with the given sub type.
|
77 |
-
*
|
78 |
-
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
79 |
-
* @return Inx_Api_BOResultSet a result set containing all JSP webpages with the given sub type.
|
80 |
-
*/
|
81 |
-
public function selectJspsBySubType( $sSubType );
|
82 |
-
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Returns a <i>BOResultSet</i> containing all form (HTML) webpages with the given sub type.
|
86 |
-
*
|
87 |
-
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
88 |
-
* @return Inx_Api_BOResultSet a result set containing all form (HTML) webpages with the given sub type.
|
89 |
-
*/
|
90 |
-
public function selectFormsBySubType( $sSubType );
|
91 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* An <i>Inx_Api_Webpage_WebpageManager</i> object can be used to retrieve <i>Inx_Api_Webpage_Webpage</i> objects.
|
4 |
+
* The web pages can be retrieved by their id, by their type (i.e. JSP, Form), by their sub type (e.g. "subscription")
|
5 |
+
* or a combination of type and sub type.
|
6 |
+
* <p>
|
7 |
+
* The following code snippet prints out the names of all available web pages (JSPs and forms):
|
8 |
+
*
|
9 |
+
* <PRE>
|
10 |
+
* $oWebpageManager = $oSession->getWebpageManager();
|
11 |
+
* $oBOResultSet = $oWebpageManager->selectAll();
|
12 |
+
*
|
13 |
+
* for( $i = 0; $i < $oBOResultSet->size(); $i++ )
|
14 |
+
* {
|
15 |
+
* $oWebpage = $oBOResultSet->get( $i );
|
16 |
+
* echo 'Page name: ' . $oWebpage->getName() . '<br>';
|
17 |
+
* }
|
18 |
+
*
|
19 |
+
* $oBOResultSet->close();
|
20 |
+
* </PRE>
|
21 |
+
* <p>
|
22 |
+
* For more information on web pages, see the <i>Inx_Api_Webpage_Webpage</i> documentation.
|
23 |
+
*
|
24 |
+
* @see Inx_Api_Webpage_Webpage
|
25 |
+
* @author chge, 06.03.2012
|
26 |
+
* @since API 1.9.0
|
27 |
+
* @package Inxmail
|
28 |
+
* @subpackage Webpage
|
29 |
+
*/
|
30 |
+
interface Inx_Api_Webpage_WebpageManager
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Returns the web page with the given id.
|
34 |
+
*
|
35 |
+
* @param int $iId the id of the web page to be retrieved.
|
36 |
+
* @return Inx_Api_Webpage_Webpage The web page specified by the given id.
|
37 |
+
* @throws Inx_Api_DataException if the web page has been deleted.
|
38 |
+
*/
|
39 |
+
public function get( $iId );
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Returns a <i>BOResultSet</i> containing all webpages.
|
44 |
+
*
|
45 |
+
* @return Inx_Api_BOResultSet a result set containing all webpages.
|
46 |
+
*/
|
47 |
+
public function selectAll();
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Returns a <i>BOResultSet</i> containing all webpages with the given sub type.
|
52 |
+
*
|
53 |
+
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
54 |
+
* @return Inx_Api_BOResultSet a result set containing all webpages with the given sub type.
|
55 |
+
*/
|
56 |
+
public function selectBySubType( $sSubType );
|
57 |
+
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Returns a <i>BOResultSet</i> containing all JSP webpages.
|
61 |
+
*
|
62 |
+
* @return Inx_Api_BOResultSet a result set containing all JSP webpages.
|
63 |
+
*/
|
64 |
+
public function selectAllJsps();
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Returns a <i>BOResultSet</i> containing all form (HTML) webpages.
|
69 |
+
*
|
70 |
+
* @return Inx_Api_BOResultSet a result set containing all form (HTML) webpages.
|
71 |
+
*/
|
72 |
+
public function selectAllForms();
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Returns a <i>BOResultSet</i> containing all JSP webpages with the given sub type.
|
77 |
+
*
|
78 |
+
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
79 |
+
* @return Inx_Api_BOResultSet a result set containing all JSP webpages with the given sub type.
|
80 |
+
*/
|
81 |
+
public function selectJspsBySubType( $sSubType );
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Returns a <i>BOResultSet</i> containing all form (HTML) webpages with the given sub type.
|
86 |
+
*
|
87 |
+
* @param string $sSubType the sub type of the web pages to retrieve (e.g. 'subscription').
|
88 |
+
* @return Inx_Api_BOResultSet a result set containing all form (HTML) webpages with the given sub type.
|
89 |
+
*/
|
90 |
+
public function selectFormsBySubType( $sSubType );
|
91 |
}
|
lib/Inx/Apiimpl/Action/ActionConstants.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Action_ActionConstants
|
3 |
-
{
|
4 |
-
const MAX_ATTRIBUTES = 4;
|
5 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Action_ActionConstants
|
3 |
+
{
|
4 |
+
const MAX_ATTRIBUTES = 4;
|
5 |
}
|
lib/Inx/Apiimpl/Action/ActionManagerImpl.php
CHANGED
@@ -1,169 +1,169 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* <code>Inx_Apiimpl_Action_ActionManagerImpl</code>
|
5 |
-
*
|
6 |
-
* @since API 1.2.0
|
7 |
-
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
-
*/
|
9 |
-
class Inx_Apiimpl_Action_ActionManagerImpl implements Inx_Api_Action_ActionManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
10 |
-
{
|
11 |
-
/**
|
12 |
-
* @var Inx_Apiimpl_SessionContext
|
13 |
-
*/
|
14 |
-
protected $_oSessionContext;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @var SoapClient
|
18 |
-
*/
|
19 |
-
protected $_oService;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @var Inx_Apiimpl_Action_CommandFactory
|
23 |
-
*/
|
24 |
-
protected $_oCmdFactory = null;
|
25 |
-
|
26 |
-
|
27 |
-
public function __construct( Inx_Apiimpl_SessionContext $sc )
|
28 |
-
{
|
29 |
-
$this->_oSessionContext = $sc;
|
30 |
-
$this->_oService = $sc->getService( Inx_Apiimpl_SessionContext::ACTION_SERVICE );
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @see com.inxmail.xpro.api.action.ActionManager#createAction(com.inxmail.xpro.api.list.ListContext)
|
36 |
-
*/
|
37 |
-
public function createAction( Inx_Api_List_ListContext $listContext )
|
38 |
-
{
|
39 |
-
$a = new Inx_Apiimpl_Action_ActionImpl( $this->_oSessionContext, Inx_Apiimpl_Action_ActionImpl::createActionData() );
|
40 |
-
$a->updateListContextId( $listContext->getId() );
|
41 |
-
return $a;
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @see com.inxmail.xpro.api.BOManager#get(int)
|
47 |
-
* @throws Inx_Api_DataException
|
48 |
-
*/
|
49 |
-
public function get( $iId )
|
50 |
-
{
|
51 |
-
if (!is_int($iId)) {
|
52 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iId argument or null expected');
|
53 |
-
}
|
54 |
-
try
|
55 |
-
{
|
56 |
-
$bo = Inx_Apiimpl_Action_ActionImpl::convert( $this->_oSessionContext,
|
57 |
-
$this->_oService->get( $this->_oSessionContext->createCxt(), $iId ) );
|
58 |
-
if( $bo === null )
|
59 |
-
throw new Inx_Api_DataException( "action is deleted" );
|
60 |
-
return $bo;
|
61 |
-
}
|
62 |
-
catch( Inx_Api_RemoteException $x )
|
63 |
-
{
|
64 |
-
$this->_oSessionContext->notify( $x );
|
65 |
-
return null;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* @see com.inxmail.xpro.api.BOManager#remove(int)
|
72 |
-
*/
|
73 |
-
public function remove( $iId )
|
74 |
-
{
|
75 |
-
if (!is_int($iId)) {
|
76 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iId argument or null expected');
|
77 |
-
}
|
78 |
-
try
|
79 |
-
{
|
80 |
-
return $this->_oService->remove( $this->_oSessionContext->createCxt(), $iId );
|
81 |
-
}
|
82 |
-
catch( Inx_Api_RemoteException $x )
|
83 |
-
{
|
84 |
-
$this->_oSessionContext->notify( $x );
|
85 |
-
return false;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* @see com.inxmail.xpro.api.BOManager#selectAll()
|
92 |
-
*/
|
93 |
-
public function selectAll()
|
94 |
-
{
|
95 |
-
return $this->select( Inx_Apiimpl_Constants::ID_UNSPECIFIED, -1, -1 );
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @param mixed listContextId ListContext or listcontext id
|
101 |
-
* @param orderAttribute
|
102 |
-
* @param orderType
|
103 |
-
* @return
|
104 |
-
*/
|
105 |
-
public function select($mListContext, $iOrderAttribute= -1, $iOrderType = -1 )
|
106 |
-
{
|
107 |
-
if ($mListContext instanceof Inx_Api_List_ListContext ) {
|
108 |
-
$mListContext = $mListContext->getId();
|
109 |
-
}
|
110 |
-
|
111 |
-
if (!is_int($iOrderAttribute)) {
|
112 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iOrderAttribute argument or null expected');
|
113 |
-
}
|
114 |
-
if (!is_int($iOrderType)) {
|
115 |
-
throw new Inx_Api_IllegalArgumentException('Integer $$iOrderType argument or null expected');
|
116 |
-
}
|
117 |
-
|
118 |
-
try
|
119 |
-
{
|
120 |
-
$rs = $this->_oService->select( $this->_oSessionContext->createCxt(), $mListContext,
|
121 |
-
$iOrderAttribute, $iOrderType );
|
122 |
-
|
123 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet(
|
124 |
-
$this->_oSessionContext, $this, $rs->remoteRefId, $rs->size,
|
125 |
-
Inx_Apiimpl_Action_ActionImpl::convertArr(
|
126 |
-
$this->_oSessionContext, $rs->data)
|
127 |
-
);
|
128 |
-
}
|
129 |
-
catch( Inx_Api_RemoteException $x )
|
130 |
-
{
|
131 |
-
$this->_oSessionContext->notify( $x );
|
132 |
-
return null;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
|
137 |
-
/**
|
138 |
-
* @see com.inxmail.xpro.apiimpl.core.BOResultSetDelegate#removeBOs(com.inxmail.xpro.apiimpl.RemoteRef, com.inxmail.xpro.apiservice.TInteger[])
|
139 |
-
* @throws RemoteException
|
140 |
-
*/
|
141 |
-
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
142 |
-
|
143 |
-
{
|
144 |
-
return $this->_oService->removeSelection(
|
145 |
-
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
-
/**
|
150 |
-
* @see com.inxmail.xpro.apiimpl.core.BOResultSetDelegate#fetchBOs(com.inxmail.xpro.apiimpl.RemoteRef, int, int)
|
151 |
-
* @throws Inx_Api_RemoteException
|
152 |
-
*/
|
153 |
-
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
154 |
-
{
|
155 |
-
return Inx_Apiimpl_Action_ActionImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
156 |
-
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
157 |
-
}
|
158 |
-
|
159 |
-
|
160 |
-
/**
|
161 |
-
* @see com.inxmail.xpro.api.action.ActionManager#getCommandFactory()
|
162 |
-
*/
|
163 |
-
public function getCommandFactory()
|
164 |
-
{
|
165 |
-
if( !isset($this->_oCmdFactory) )
|
166 |
-
$this->_oCmdFactory = new Inx_Apiimpl_Action_CommandFactoryImpl();
|
167 |
-
return $this->_oCmdFactory;
|
168 |
-
}
|
169 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* <code>Inx_Apiimpl_Action_ActionManagerImpl</code>
|
5 |
+
*
|
6 |
+
* @since API 1.2.0
|
7 |
+
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
+
*/
|
9 |
+
class Inx_Apiimpl_Action_ActionManagerImpl implements Inx_Api_Action_ActionManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* @var Inx_Apiimpl_SessionContext
|
13 |
+
*/
|
14 |
+
protected $_oSessionContext;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @var SoapClient
|
18 |
+
*/
|
19 |
+
protected $_oService;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @var Inx_Apiimpl_Action_CommandFactory
|
23 |
+
*/
|
24 |
+
protected $_oCmdFactory = null;
|
25 |
+
|
26 |
+
|
27 |
+
public function __construct( Inx_Apiimpl_SessionContext $sc )
|
28 |
+
{
|
29 |
+
$this->_oSessionContext = $sc;
|
30 |
+
$this->_oService = $sc->getService( Inx_Apiimpl_SessionContext::ACTION_SERVICE );
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @see com.inxmail.xpro.api.action.ActionManager#createAction(com.inxmail.xpro.api.list.ListContext)
|
36 |
+
*/
|
37 |
+
public function createAction( Inx_Api_List_ListContext $listContext )
|
38 |
+
{
|
39 |
+
$a = new Inx_Apiimpl_Action_ActionImpl( $this->_oSessionContext, Inx_Apiimpl_Action_ActionImpl::createActionData() );
|
40 |
+
$a->updateListContextId( $listContext->getId() );
|
41 |
+
return $a;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @see com.inxmail.xpro.api.BOManager#get(int)
|
47 |
+
* @throws Inx_Api_DataException
|
48 |
+
*/
|
49 |
+
public function get( $iId )
|
50 |
+
{
|
51 |
+
if (!is_int($iId)) {
|
52 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iId argument or null expected');
|
53 |
+
}
|
54 |
+
try
|
55 |
+
{
|
56 |
+
$bo = Inx_Apiimpl_Action_ActionImpl::convert( $this->_oSessionContext,
|
57 |
+
$this->_oService->get( $this->_oSessionContext->createCxt(), $iId ) );
|
58 |
+
if( $bo === null )
|
59 |
+
throw new Inx_Api_DataException( "action is deleted" );
|
60 |
+
return $bo;
|
61 |
+
}
|
62 |
+
catch( Inx_Api_RemoteException $x )
|
63 |
+
{
|
64 |
+
$this->_oSessionContext->notify( $x );
|
65 |
+
return null;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* @see com.inxmail.xpro.api.BOManager#remove(int)
|
72 |
+
*/
|
73 |
+
public function remove( $iId )
|
74 |
+
{
|
75 |
+
if (!is_int($iId)) {
|
76 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iId argument or null expected');
|
77 |
+
}
|
78 |
+
try
|
79 |
+
{
|
80 |
+
return $this->_oService->remove( $this->_oSessionContext->createCxt(), $iId );
|
81 |
+
}
|
82 |
+
catch( Inx_Api_RemoteException $x )
|
83 |
+
{
|
84 |
+
$this->_oSessionContext->notify( $x );
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @see com.inxmail.xpro.api.BOManager#selectAll()
|
92 |
+
*/
|
93 |
+
public function selectAll()
|
94 |
+
{
|
95 |
+
return $this->select( Inx_Apiimpl_Constants::ID_UNSPECIFIED, -1, -1 );
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @param mixed listContextId ListContext or listcontext id
|
101 |
+
* @param orderAttribute
|
102 |
+
* @param orderType
|
103 |
+
* @return
|
104 |
+
*/
|
105 |
+
public function select($mListContext, $iOrderAttribute= -1, $iOrderType = -1 )
|
106 |
+
{
|
107 |
+
if ($mListContext instanceof Inx_Api_List_ListContext ) {
|
108 |
+
$mListContext = $mListContext->getId();
|
109 |
+
}
|
110 |
+
|
111 |
+
if (!is_int($iOrderAttribute)) {
|
112 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iOrderAttribute argument or null expected');
|
113 |
+
}
|
114 |
+
if (!is_int($iOrderType)) {
|
115 |
+
throw new Inx_Api_IllegalArgumentException('Integer $$iOrderType argument or null expected');
|
116 |
+
}
|
117 |
+
|
118 |
+
try
|
119 |
+
{
|
120 |
+
$rs = $this->_oService->select( $this->_oSessionContext->createCxt(), $mListContext,
|
121 |
+
$iOrderAttribute, $iOrderType );
|
122 |
+
|
123 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet(
|
124 |
+
$this->_oSessionContext, $this, $rs->remoteRefId, $rs->size,
|
125 |
+
Inx_Apiimpl_Action_ActionImpl::convertArr(
|
126 |
+
$this->_oSessionContext, $rs->data)
|
127 |
+
);
|
128 |
+
}
|
129 |
+
catch( Inx_Api_RemoteException $x )
|
130 |
+
{
|
131 |
+
$this->_oSessionContext->notify( $x );
|
132 |
+
return null;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
/**
|
138 |
+
* @see com.inxmail.xpro.apiimpl.core.BOResultSetDelegate#removeBOs(com.inxmail.xpro.apiimpl.RemoteRef, com.inxmail.xpro.apiservice.TInteger[])
|
139 |
+
* @throws RemoteException
|
140 |
+
*/
|
141 |
+
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
142 |
+
|
143 |
+
{
|
144 |
+
return $this->_oService->removeSelection(
|
145 |
+
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* @see com.inxmail.xpro.apiimpl.core.BOResultSetDelegate#fetchBOs(com.inxmail.xpro.apiimpl.RemoteRef, int, int)
|
151 |
+
* @throws Inx_Api_RemoteException
|
152 |
+
*/
|
153 |
+
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
154 |
+
{
|
155 |
+
return Inx_Apiimpl_Action_ActionImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
156 |
+
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* @see com.inxmail.xpro.api.action.ActionManager#getCommandFactory()
|
162 |
+
*/
|
163 |
+
public function getCommandFactory()
|
164 |
+
{
|
165 |
+
if( !isset($this->_oCmdFactory) )
|
166 |
+
$this->_oCmdFactory = new Inx_Apiimpl_Action_CommandFactoryImpl();
|
167 |
+
return $this->_oCmdFactory;
|
168 |
+
}
|
169 |
+
}
|
lib/Inx/Apiimpl/Action/CommandFactoryImpl.php
CHANGED
@@ -1,158 +1,158 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* <code>CommandFactoryImpl</code>
|
5 |
-
*
|
6 |
-
* @since API 1.2.0
|
7 |
-
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
-
*/
|
9 |
-
class Inx_Apiimpl_Action_CommandFactoryImpl implements Inx_Api_Action_CommandFactory
|
10 |
-
{
|
11 |
-
|
12 |
-
/**
|
13 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createDeleteRecipientCmd()
|
14 |
-
*/
|
15 |
-
public function createDeleteRecipientCmd()
|
16 |
-
{
|
17 |
-
return new Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd();
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSetValueCmd(int, java.lang.String)
|
22 |
-
*/
|
23 |
-
public function createSetValueCmd( $iAttributeId, $sExpression )
|
24 |
-
{
|
25 |
-
if (!is_int($iAttributeId)) {
|
26 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
27 |
-
}
|
28 |
-
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
29 |
-
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_FREE_EXPRESSION, $sExpression );
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSetAbsoluteValueCmd(int, java.lang.String)
|
34 |
-
*/
|
35 |
-
public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue )
|
36 |
-
{
|
37 |
-
if (!is_int($iAttributeId)) {
|
38 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
39 |
-
}
|
40 |
-
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
41 |
-
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_ABSOLUTE, $sAbsoluteValue );
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSetRelativeValueCmd(int, java.lang.String)
|
46 |
-
*/
|
47 |
-
public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue )
|
48 |
-
{
|
49 |
-
if (!is_int($iAttributeId)) {
|
50 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
51 |
-
}
|
52 |
-
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
53 |
-
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_RELATIVE, $sRelativeValue );
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSubscriptionCmd(int, boolean)
|
58 |
-
*/
|
59 |
-
public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled )
|
60 |
-
{
|
61 |
-
if (!is_int($iListContextId)) {
|
62 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
63 |
-
}
|
64 |
-
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd( $iListContextId,
|
65 |
-
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_SUBSCRIBE, $blSubscriptionProcessingEnabled );
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscriptionCmd(int, boolean)
|
70 |
-
*/
|
71 |
-
public function createUnsubscriptionCmd( $iListContextId, $blUnsubscriptionProcessingEnabled )
|
72 |
-
{
|
73 |
-
if (!is_int($iListContextId)) {
|
74 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
75 |
-
}
|
76 |
-
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd( $iListContextId,
|
77 |
-
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE, $blUnsubscriptionProcessingEnabled );
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscribeAllCmd()
|
82 |
-
*/
|
83 |
-
public function createUnsubscribeAllCmd()
|
84 |
-
{
|
85 |
-
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd(
|
86 |
-
Inx_Apiimpl_Constants::SYSTEM_LIST_CONTEXT_ID,
|
87 |
-
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE_ALL, false );
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSubscriptionCmd2(int, boolean)
|
95 |
-
*/
|
96 |
-
public function createSubscriptionCmd2( $iListContextId, $blSubscriptionProcessingEnabled )
|
97 |
-
{
|
98 |
-
if (!is_int($iListContextId)) {
|
99 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
100 |
-
}
|
101 |
-
return new Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd( $iListContextId,
|
102 |
-
Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd::CMD_TYPE_SUBSCRIBE, $blSubscriptionProcessingEnabled );
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscriptionCmd2(int, boolean)
|
107 |
-
*/
|
108 |
-
public function createUnsubscriptionCmd2( $iListContextId, $blUnsubscriptionProcessingEnabled )
|
109 |
-
{
|
110 |
-
if (!is_int($iListContextId)) {
|
111 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
112 |
-
}
|
113 |
-
return new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd( $iListContextId,
|
114 |
-
Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE, $blUnsubscriptionProcessingEnabled );
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscribeAllCmd2()
|
119 |
-
*/
|
120 |
-
public function createUnsubscribeAllCmd2()
|
121 |
-
{
|
122 |
-
return new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd(
|
123 |
-
Inx_Apiimpl_Constants::SYSTEM_LIST_CONTEXT_ID,
|
124 |
-
Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE_ALL, false );
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
/**
|
130 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSendLastNewsletterCmd(int)
|
131 |
-
*/
|
132 |
-
public function createSendLastNewsletterCmd( $iListContextId )
|
133 |
-
{
|
134 |
-
if (!is_int($iListContextId)) {
|
135 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
136 |
-
}
|
137 |
-
return new Inx_Apiimpl_Action_CommandImpl_SendMailCmd( $iListContextId );
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* @see com.inxmail.xpro.api.action.CommandFactory#createSendMailCmd(int, int)
|
142 |
-
*/
|
143 |
-
public function createSendMailCmd( $iListContextId, $iMailingId )
|
144 |
-
{
|
145 |
-
if (!is_int($iListContextId)) {
|
146 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
147 |
-
}
|
148 |
-
return new Inx_Apiimpl_Action_CommandImpl_SendMailCmd( $iListContextId, $iMailingId );
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* @see Inx_Api_Action_CommandFactory::createSendActionMailCmd
|
153 |
-
*/
|
154 |
-
public function createSendActionMailCmd( $iListContextId, $iActionMailingId )
|
155 |
-
{
|
156 |
-
return new Inx_Apiimpl_Action_CommandImpl_SendActionMailCmd($iListContextId, $iActionMailingId);
|
157 |
-
}
|
158 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* <code>CommandFactoryImpl</code>
|
5 |
+
*
|
6 |
+
* @since API 1.2.0
|
7 |
+
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
+
*/
|
9 |
+
class Inx_Apiimpl_Action_CommandFactoryImpl implements Inx_Api_Action_CommandFactory
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createDeleteRecipientCmd()
|
14 |
+
*/
|
15 |
+
public function createDeleteRecipientCmd()
|
16 |
+
{
|
17 |
+
return new Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSetValueCmd(int, java.lang.String)
|
22 |
+
*/
|
23 |
+
public function createSetValueCmd( $iAttributeId, $sExpression )
|
24 |
+
{
|
25 |
+
if (!is_int($iAttributeId)) {
|
26 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
27 |
+
}
|
28 |
+
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
29 |
+
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_FREE_EXPRESSION, $sExpression );
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSetAbsoluteValueCmd(int, java.lang.String)
|
34 |
+
*/
|
35 |
+
public function createSetAbsoluteValueCmd( $iAttributeId, $sAbsoluteValue )
|
36 |
+
{
|
37 |
+
if (!is_int($iAttributeId)) {
|
38 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
39 |
+
}
|
40 |
+
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
41 |
+
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_ABSOLUTE, $sAbsoluteValue );
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSetRelativeValueCmd(int, java.lang.String)
|
46 |
+
*/
|
47 |
+
public function createSetRelativeValueCmd( $iAttributeId, $sRelativeValue )
|
48 |
+
{
|
49 |
+
if (!is_int($iAttributeId)) {
|
50 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iAttributeId argument expected');
|
51 |
+
}
|
52 |
+
return new Inx_Apiimpl_Action_CommandImpl_SetValueCmd( $iAttributeId,
|
53 |
+
Inx_Apiimpl_Action_CommandImpl_SetValueCmd::CMD_TYPE_RELATIVE, $sRelativeValue );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSubscriptionCmd(int, boolean)
|
58 |
+
*/
|
59 |
+
public function createSubscriptionCmd( $iListContextId, $blSubscriptionProcessingEnabled )
|
60 |
+
{
|
61 |
+
if (!is_int($iListContextId)) {
|
62 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
63 |
+
}
|
64 |
+
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd( $iListContextId,
|
65 |
+
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_SUBSCRIBE, $blSubscriptionProcessingEnabled );
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscriptionCmd(int, boolean)
|
70 |
+
*/
|
71 |
+
public function createUnsubscriptionCmd( $iListContextId, $blUnsubscriptionProcessingEnabled )
|
72 |
+
{
|
73 |
+
if (!is_int($iListContextId)) {
|
74 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
75 |
+
}
|
76 |
+
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd( $iListContextId,
|
77 |
+
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE, $blUnsubscriptionProcessingEnabled );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscribeAllCmd()
|
82 |
+
*/
|
83 |
+
public function createUnsubscribeAllCmd()
|
84 |
+
{
|
85 |
+
return new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd(
|
86 |
+
Inx_Apiimpl_Constants::SYSTEM_LIST_CONTEXT_ID,
|
87 |
+
Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE_ALL, false );
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSubscriptionCmd2(int, boolean)
|
95 |
+
*/
|
96 |
+
public function createSubscriptionCmd2( $iListContextId, $blSubscriptionProcessingEnabled )
|
97 |
+
{
|
98 |
+
if (!is_int($iListContextId)) {
|
99 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
100 |
+
}
|
101 |
+
return new Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd( $iListContextId,
|
102 |
+
Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd::CMD_TYPE_SUBSCRIBE, $blSubscriptionProcessingEnabled );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscriptionCmd2(int, boolean)
|
107 |
+
*/
|
108 |
+
public function createUnsubscriptionCmd2( $iListContextId, $blUnsubscriptionProcessingEnabled )
|
109 |
+
{
|
110 |
+
if (!is_int($iListContextId)) {
|
111 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
112 |
+
}
|
113 |
+
return new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd( $iListContextId,
|
114 |
+
Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE, $blUnsubscriptionProcessingEnabled );
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createUnsubscribeAllCmd2()
|
119 |
+
*/
|
120 |
+
public function createUnsubscribeAllCmd2()
|
121 |
+
{
|
122 |
+
return new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd(
|
123 |
+
Inx_Apiimpl_Constants::SYSTEM_LIST_CONTEXT_ID,
|
124 |
+
Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd::CMD_TYPE_UNSUBSCRIBE_ALL, false );
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSendLastNewsletterCmd(int)
|
131 |
+
*/
|
132 |
+
public function createSendLastNewsletterCmd( $iListContextId )
|
133 |
+
{
|
134 |
+
if (!is_int($iListContextId)) {
|
135 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
136 |
+
}
|
137 |
+
return new Inx_Apiimpl_Action_CommandImpl_SendMailCmd( $iListContextId );
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* @see com.inxmail.xpro.api.action.CommandFactory#createSendMailCmd(int, int)
|
142 |
+
*/
|
143 |
+
public function createSendMailCmd( $iListContextId, $iMailingId )
|
144 |
+
{
|
145 |
+
if (!is_int($iListContextId)) {
|
146 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iListContextId argument expected');
|
147 |
+
}
|
148 |
+
return new Inx_Apiimpl_Action_CommandImpl_SendMailCmd( $iListContextId, $iMailingId );
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* @see Inx_Api_Action_CommandFactory::createSendActionMailCmd
|
153 |
+
*/
|
154 |
+
public function createSendActionMailCmd( $iListContextId, $iActionMailingId )
|
155 |
+
{
|
156 |
+
return new Inx_Apiimpl_Action_CommandImpl_SendActionMailCmd($iListContextId, $iActionMailingId);
|
157 |
+
}
|
158 |
+
}
|
lib/Inx/Apiimpl/Action/CommandImpl.php
CHANGED
@@ -1,177 +1,177 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* <code>CommandImpl</code>
|
5 |
-
*
|
6 |
-
* @since API 1.2.0
|
7 |
-
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
-
*/
|
9 |
-
abstract class Inx_Apiimpl_Action_CommandImpl implements Inx_Api_Action_Command
|
10 |
-
{
|
11 |
-
|
12 |
-
const EMTPY_CMDS = null;
|
13 |
-
|
14 |
-
|
15 |
-
/** Action: Set value */
|
16 |
-
const SET_VALUE_CMD_TYPE = 1;
|
17 |
-
|
18 |
-
/** Action: Change subscription */
|
19 |
-
const CHANGE_SUBSCRIPTION_CMD_TYPE = 2;
|
20 |
-
|
21 |
-
/** Action: Send a mail */
|
22 |
-
const SEND_MAIL_CMD_TYPE = 3;
|
23 |
-
|
24 |
-
/** Action: Delete member */
|
25 |
-
const DELETE_MEMBER_CMD_TYPE = 4;
|
26 |
-
|
27 |
-
|
28 |
-
/** Action: subscribe member */
|
29 |
-
const SUBSCRIBE_MEMBER_CMD_TYPE = 5;
|
30 |
-
|
31 |
-
/** Action: unsubscribe member */
|
32 |
-
const UNSUBSCRIBE_MEMBER_CMD_TYPE = 6;
|
33 |
-
|
34 |
-
/** Action: Send an action mail */
|
35 |
-
const SEND_ACTION_MAIL_CMD_TYPE = 7;
|
36 |
-
|
37 |
-
const ONE = 1;
|
38 |
-
|
39 |
-
const TWO = 2;
|
40 |
-
|
41 |
-
const THREE = 3;
|
42 |
-
|
43 |
-
|
44 |
-
protected $_oCommandData;
|
45 |
-
|
46 |
-
protected $_aParams;
|
47 |
-
|
48 |
-
|
49 |
-
public function __construct( $oCommandData )
|
50 |
-
{
|
51 |
-
$this->_oCommandData = $oCommandData;
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return
|
57 |
-
*/
|
58 |
-
public function getCmdType()
|
59 |
-
{
|
60 |
-
return $this->_oCommandData->type;
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
* @param parameterKey
|
66 |
-
* @return
|
67 |
-
*/
|
68 |
-
protected function getInteger( $iParameterKey )
|
69 |
-
{
|
70 |
-
if (!is_int($iParameterKey)) {
|
71 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iParameterKey argument expected');
|
72 |
-
}
|
73 |
-
$sTmp = $this->getParameter( $iParameterKey );
|
74 |
-
if( $sTmp==null || strlen($sTmp) == 0 )
|
75 |
-
return null;
|
76 |
-
else
|
77 |
-
return (int)$sTmp;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @param parameterKey
|
82 |
-
* @return
|
83 |
-
*/
|
84 |
-
protected function getParameter( $iParameterKey )
|
85 |
-
{
|
86 |
-
if (!is_int($iParameterKey)) {
|
87 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iParameterKey argument expected');
|
88 |
-
}
|
89 |
-
if( !isset($this->_aParams) )
|
90 |
-
{
|
91 |
-
$this->_aParams = array();
|
92 |
-
$aKeys = Inx_Apiimpl_TConvert::TArrToArr($this->_oCommandData->keys);
|
93 |
-
$aValues = Inx_Apiimpl_TConvert::TArrToArr($this->_oCommandData->values);
|
94 |
-
|
95 |
-
foreach($aKeys as $key => $val) {
|
96 |
-
$this->_aParams[$val] = $aValues[$key];
|
97 |
-
}
|
98 |
-
}
|
99 |
-
return (string)$this->_aParams[$iParameterKey];
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @return
|
104 |
-
*/
|
105 |
-
protected function getCommandData()
|
106 |
-
{
|
107 |
-
return $this->_oCommandData;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
/**
|
112 |
-
* @param datas CommandData[] datas
|
113 |
-
* @return array of Inx_Api_Action_Command
|
114 |
-
*/
|
115 |
-
public static function convertDtArr( $aDatas )
|
116 |
-
{
|
117 |
-
if( $aDatas === null || count($aDatas) == 0 )
|
118 |
-
return self::EMTPY_CMDS;
|
119 |
-
|
120 |
-
$cs = array();
|
121 |
-
foreach($aDatas as $key => $val) {
|
122 |
-
switch ($val->type) {
|
123 |
-
case self::SET_VALUE_CMD_TYPE:
|
124 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SetValueCmd($val);
|
125 |
-
break;
|
126 |
-
case self::CHANGE_SUBSCRIPTION_CMD_TYPE:
|
127 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd($val);
|
128 |
-
break;
|
129 |
-
case self::SEND_MAIL_CMD_TYPE:
|
130 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SendMailCmd($val);
|
131 |
-
break;
|
132 |
-
case self::DELETE_MEMBER_CMD_TYPE:
|
133 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd($val);
|
134 |
-
break;
|
135 |
-
case self::SUBSCRIBE_MEMBER_CMD_TYPE:
|
136 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd($val);
|
137 |
-
break;
|
138 |
-
case self::UNSUBSCRIBE_MEMBER_CMD_TYPE:
|
139 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd($val);
|
140 |
-
break;
|
141 |
-
default:
|
142 |
-
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_UnknownCmd($val);
|
143 |
-
break;
|
144 |
-
}
|
145 |
-
|
146 |
-
}
|
147 |
-
|
148 |
-
return $cs;
|
149 |
-
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* @param cmds
|
154 |
-
* @return
|
155 |
-
*/
|
156 |
-
public static function convertCmdArr( $aCmds )
|
157 |
-
{
|
158 |
-
if( $aCmds === null )
|
159 |
-
return null;
|
160 |
-
$cs = array();
|
161 |
-
|
162 |
-
foreach($aCmds as $key => $val) {
|
163 |
-
$cs[$key] = $val->getCommandData();
|
164 |
-
}
|
165 |
-
|
166 |
-
return $cs;
|
167 |
-
}
|
168 |
-
|
169 |
-
public static function createCommandData()
|
170 |
-
{
|
171 |
-
$oRet = new stdClass;
|
172 |
-
$oRet->type = null;
|
173 |
-
$oRet->keys = array();
|
174 |
-
$oRet->values = array();
|
175 |
-
}
|
176 |
-
|
177 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* <code>CommandImpl</code>
|
5 |
+
*
|
6 |
+
* @since API 1.2.0
|
7 |
+
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
8 |
+
*/
|
9 |
+
abstract class Inx_Apiimpl_Action_CommandImpl implements Inx_Api_Action_Command
|
10 |
+
{
|
11 |
+
|
12 |
+
const EMTPY_CMDS = null;
|
13 |
+
|
14 |
+
|
15 |
+
/** Action: Set value */
|
16 |
+
const SET_VALUE_CMD_TYPE = 1;
|
17 |
+
|
18 |
+
/** Action: Change subscription */
|
19 |
+
const CHANGE_SUBSCRIPTION_CMD_TYPE = 2;
|
20 |
+
|
21 |
+
/** Action: Send a mail */
|
22 |
+
const SEND_MAIL_CMD_TYPE = 3;
|
23 |
+
|
24 |
+
/** Action: Delete member */
|
25 |
+
const DELETE_MEMBER_CMD_TYPE = 4;
|
26 |
+
|
27 |
+
|
28 |
+
/** Action: subscribe member */
|
29 |
+
const SUBSCRIBE_MEMBER_CMD_TYPE = 5;
|
30 |
+
|
31 |
+
/** Action: unsubscribe member */
|
32 |
+
const UNSUBSCRIBE_MEMBER_CMD_TYPE = 6;
|
33 |
+
|
34 |
+
/** Action: Send an action mail */
|
35 |
+
const SEND_ACTION_MAIL_CMD_TYPE = 7;
|
36 |
+
|
37 |
+
const ONE = 1;
|
38 |
+
|
39 |
+
const TWO = 2;
|
40 |
+
|
41 |
+
const THREE = 3;
|
42 |
+
|
43 |
+
|
44 |
+
protected $_oCommandData;
|
45 |
+
|
46 |
+
protected $_aParams;
|
47 |
+
|
48 |
+
|
49 |
+
public function __construct( $oCommandData )
|
50 |
+
{
|
51 |
+
$this->_oCommandData = $oCommandData;
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @return
|
57 |
+
*/
|
58 |
+
public function getCmdType()
|
59 |
+
{
|
60 |
+
return $this->_oCommandData->type;
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @param parameterKey
|
66 |
+
* @return
|
67 |
+
*/
|
68 |
+
protected function getInteger( $iParameterKey )
|
69 |
+
{
|
70 |
+
if (!is_int($iParameterKey)) {
|
71 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iParameterKey argument expected');
|
72 |
+
}
|
73 |
+
$sTmp = $this->getParameter( $iParameterKey );
|
74 |
+
if( $sTmp==null || strlen($sTmp) == 0 )
|
75 |
+
return null;
|
76 |
+
else
|
77 |
+
return (int)$sTmp;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @param parameterKey
|
82 |
+
* @return
|
83 |
+
*/
|
84 |
+
protected function getParameter( $iParameterKey )
|
85 |
+
{
|
86 |
+
if (!is_int($iParameterKey)) {
|
87 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iParameterKey argument expected');
|
88 |
+
}
|
89 |
+
if( !isset($this->_aParams) )
|
90 |
+
{
|
91 |
+
$this->_aParams = array();
|
92 |
+
$aKeys = Inx_Apiimpl_TConvert::TArrToArr($this->_oCommandData->keys);
|
93 |
+
$aValues = Inx_Apiimpl_TConvert::TArrToArr($this->_oCommandData->values);
|
94 |
+
|
95 |
+
foreach($aKeys as $key => $val) {
|
96 |
+
$this->_aParams[$val] = $aValues[$key];
|
97 |
+
}
|
98 |
+
}
|
99 |
+
return (string)$this->_aParams[$iParameterKey];
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @return
|
104 |
+
*/
|
105 |
+
protected function getCommandData()
|
106 |
+
{
|
107 |
+
return $this->_oCommandData;
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @param datas CommandData[] datas
|
113 |
+
* @return array of Inx_Api_Action_Command
|
114 |
+
*/
|
115 |
+
public static function convertDtArr( $aDatas )
|
116 |
+
{
|
117 |
+
if( $aDatas === null || count($aDatas) == 0 )
|
118 |
+
return self::EMTPY_CMDS;
|
119 |
+
|
120 |
+
$cs = array();
|
121 |
+
foreach($aDatas as $key => $val) {
|
122 |
+
switch ($val->type) {
|
123 |
+
case self::SET_VALUE_CMD_TYPE:
|
124 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SetValueCmd($val);
|
125 |
+
break;
|
126 |
+
case self::CHANGE_SUBSCRIPTION_CMD_TYPE:
|
127 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd($val);
|
128 |
+
break;
|
129 |
+
case self::SEND_MAIL_CMD_TYPE:
|
130 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SendMailCmd($val);
|
131 |
+
break;
|
132 |
+
case self::DELETE_MEMBER_CMD_TYPE:
|
133 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd($val);
|
134 |
+
break;
|
135 |
+
case self::SUBSCRIBE_MEMBER_CMD_TYPE:
|
136 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd($val);
|
137 |
+
break;
|
138 |
+
case self::UNSUBSCRIBE_MEMBER_CMD_TYPE:
|
139 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd($val);
|
140 |
+
break;
|
141 |
+
default:
|
142 |
+
$cs[$key] = new Inx_Apiimpl_Action_CommandImpl_UnknownCmd($val);
|
143 |
+
break;
|
144 |
+
}
|
145 |
+
|
146 |
+
}
|
147 |
+
|
148 |
+
return $cs;
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* @param cmds
|
154 |
+
* @return
|
155 |
+
*/
|
156 |
+
public static function convertCmdArr( $aCmds )
|
157 |
+
{
|
158 |
+
if( $aCmds === null )
|
159 |
+
return null;
|
160 |
+
$cs = array();
|
161 |
+
|
162 |
+
foreach($aCmds as $key => $val) {
|
163 |
+
$cs[$key] = $val->getCommandData();
|
164 |
+
}
|
165 |
+
|
166 |
+
return $cs;
|
167 |
+
}
|
168 |
+
|
169 |
+
public static function createCommandData()
|
170 |
+
{
|
171 |
+
$oRet = new stdClass;
|
172 |
+
$oRet->type = null;
|
173 |
+
$oRet->keys = array();
|
174 |
+
$oRet->values = array();
|
175 |
+
}
|
176 |
+
|
177 |
+
}
|
lib/Inx/Apiimpl/Action/CommandImpl/RemoveRecipientCmd.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd
|
4 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
-
implements Inx_Api_Action_DeleteRecipientCommand
|
6 |
-
{
|
7 |
-
public function __construct( $oCommandData = null )
|
8 |
-
{
|
9 |
-
|
10 |
-
if (isset($oCommandData)) {
|
11 |
-
return parent::__construct($oCommandData);
|
12 |
-
}
|
13 |
-
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
14 |
-
$this->_oCommandData = new stdClass;
|
15 |
-
$this->_oCommandData->type = self::DELETE_MEMBER_CMD_TYPE;
|
16 |
-
}
|
17 |
-
|
18 |
-
|
19 |
-
public function toString()
|
20 |
-
{
|
21 |
-
return "RemoveCommand";
|
22 |
-
}
|
23 |
-
|
24 |
-
public function __toString()
|
25 |
-
{
|
26 |
-
return $this->toString();
|
27 |
-
}
|
28 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Action_CommandImpl_RemoveRecipientCmd
|
4 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
+
implements Inx_Api_Action_DeleteRecipientCommand
|
6 |
+
{
|
7 |
+
public function __construct( $oCommandData = null )
|
8 |
+
{
|
9 |
+
|
10 |
+
if (isset($oCommandData)) {
|
11 |
+
return parent::__construct($oCommandData);
|
12 |
+
}
|
13 |
+
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
14 |
+
$this->_oCommandData = new stdClass;
|
15 |
+
$this->_oCommandData->type = self::DELETE_MEMBER_CMD_TYPE;
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
public function toString()
|
20 |
+
{
|
21 |
+
return "RemoveCommand";
|
22 |
+
}
|
23 |
+
|
24 |
+
public function __toString()
|
25 |
+
{
|
26 |
+
return $this->toString();
|
27 |
+
}
|
28 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/SendActionMailCmd.php
CHANGED
@@ -1,60 +1,60 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Action_CommandImpl_SendActionMailCmd
|
3 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
4 |
-
implements Inx_Api_Action_SendActionMailCommand
|
5 |
-
{
|
6 |
-
public function __construct( $mFirstParam, $iActionMailingId = null )
|
7 |
-
{
|
8 |
-
//first parameter is either the command data (and therefore an object) or
|
9 |
-
//it is the list context id (and therefore no object).
|
10 |
-
if (is_object($mFirstParam))
|
11 |
-
{
|
12 |
-
parent::__construct($mFirstParam);
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
17 |
-
$this->_oCommandData = new stdClass();
|
18 |
-
$this->_oCommandData->type = self::SEND_ACTION_MAIL_CMD_TYPE;
|
19 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array( self::ONE, self::TWO ) );
|
20 |
-
|
21 |
-
if ($iActionMailingId === null)
|
22 |
-
{
|
23 |
-
throw new Inx_Api_IllegalArgumentException('if first parameter is the list context id, ' .
|
24 |
-
'the second parameter may not be null');
|
25 |
-
}
|
26 |
-
else
|
27 |
-
{
|
28 |
-
if (!is_int($iActionMailingId))
|
29 |
-
{
|
30 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iActionMailingId argument expected');
|
31 |
-
}
|
32 |
-
|
33 |
-
$aValues = array(
|
34 |
-
(string) $mFirstParam,
|
35 |
-
(string) $iActionMailingId,
|
36 |
-
);
|
37 |
-
|
38 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr($aValues);
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
public function getListContextId()
|
44 |
-
{
|
45 |
-
return $this->getInteger( self::ONE );
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
public function getMailingId()
|
50 |
-
{
|
51 |
-
return $this->getInteger( self::TWO );
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
public function __toString()
|
56 |
-
{
|
57 |
-
return "SendActionMailCommand - listContextId: " . $this->getInteger( self::ONE ) .
|
58 |
-
", actionMailingId: " . $this->getInteger( self::TWO );
|
59 |
-
}
|
60 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Action_CommandImpl_SendActionMailCmd
|
3 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
4 |
+
implements Inx_Api_Action_SendActionMailCommand
|
5 |
+
{
|
6 |
+
public function __construct( $mFirstParam, $iActionMailingId = null )
|
7 |
+
{
|
8 |
+
//first parameter is either the command data (and therefore an object) or
|
9 |
+
//it is the list context id (and therefore no object).
|
10 |
+
if (is_object($mFirstParam))
|
11 |
+
{
|
12 |
+
parent::__construct($mFirstParam);
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
|
16 |
+
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
17 |
+
$this->_oCommandData = new stdClass();
|
18 |
+
$this->_oCommandData->type = self::SEND_ACTION_MAIL_CMD_TYPE;
|
19 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array( self::ONE, self::TWO ) );
|
20 |
+
|
21 |
+
if ($iActionMailingId === null)
|
22 |
+
{
|
23 |
+
throw new Inx_Api_IllegalArgumentException('if first parameter is the list context id, ' .
|
24 |
+
'the second parameter may not be null');
|
25 |
+
}
|
26 |
+
else
|
27 |
+
{
|
28 |
+
if (!is_int($iActionMailingId))
|
29 |
+
{
|
30 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iActionMailingId argument expected');
|
31 |
+
}
|
32 |
+
|
33 |
+
$aValues = array(
|
34 |
+
(string) $mFirstParam,
|
35 |
+
(string) $iActionMailingId,
|
36 |
+
);
|
37 |
+
|
38 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr($aValues);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
public function getListContextId()
|
44 |
+
{
|
45 |
+
return $this->getInteger( self::ONE );
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
public function getMailingId()
|
50 |
+
{
|
51 |
+
return $this->getInteger( self::TWO );
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
public function __toString()
|
56 |
+
{
|
57 |
+
return "SendActionMailCommand - listContextId: " . $this->getInteger( self::ONE ) .
|
58 |
+
", actionMailingId: " . $this->getInteger( self::TWO );
|
59 |
+
}
|
60 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/SendMailCmd.php
CHANGED
@@ -1,70 +1,70 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Action_CommandImpl_SendMailCmd
|
3 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
4 |
-
implements Inx_Api_Action_SendMailCommand
|
5 |
-
{
|
6 |
-
|
7 |
-
public function __construct( $mFirstParam, $iMailingId = null )
|
8 |
-
{
|
9 |
-
if (is_object($mFirstParam)) {
|
10 |
-
parent::__construct($mFirstParam);
|
11 |
-
return;
|
12 |
-
}
|
13 |
-
|
14 |
-
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
15 |
-
$this->_oCommandData = new stdClass;
|
16 |
-
$this->_oCommandData->type = self::SEND_MAIL_CMD_TYPE;
|
17 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array(self::ONE, self::TWO, self::THREE) );
|
18 |
-
|
19 |
-
if ($iMailingId === null) {
|
20 |
-
$aValues = array(
|
21 |
-
(string) $mFirstParam,
|
22 |
-
'0',
|
23 |
-
(string) self::CMD_TYPE_LAST_MAILING
|
24 |
-
);
|
25 |
-
}
|
26 |
-
else {
|
27 |
-
if (!is_int($iMailingId)) {
|
28 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iMailingId argument or null expected');
|
29 |
-
}
|
30 |
-
$aValues = array(
|
31 |
-
(string) $mFirstParam,
|
32 |
-
(string) $iMailingId,
|
33 |
-
(string) self::CMD_TYPE_SPECIFIC_MAILING
|
34 |
-
);
|
35 |
-
}
|
36 |
-
|
37 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr($aValues);
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
public function getCmdType()
|
42 |
-
{
|
43 |
-
$iType = $this->getInteger( self::THREE );
|
44 |
-
|
45 |
-
if( $iType === null )
|
46 |
-
return self::CMD_TYPE_LAST_MAILING;
|
47 |
-
|
48 |
-
return $iType;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function getListContextId()
|
52 |
-
{
|
53 |
-
return $this->getInteger( self::ONE );
|
54 |
-
}
|
55 |
-
|
56 |
-
public function getMailingId()
|
57 |
-
{
|
58 |
-
return $this->getInteger( self::TWO );
|
59 |
-
}
|
60 |
-
|
61 |
-
public function toString()
|
62 |
-
{
|
63 |
-
return "SendMailCommand - listContextId: " . $this->getInteger( self::ONE )
|
64 |
-
. ", mailingId: " . $this->getInteger( self::TWO );
|
65 |
-
}
|
66 |
-
public function __toString()
|
67 |
-
{
|
68 |
-
return $this->toString();
|
69 |
-
}
|
70 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Action_CommandImpl_SendMailCmd
|
3 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
4 |
+
implements Inx_Api_Action_SendMailCommand
|
5 |
+
{
|
6 |
+
|
7 |
+
public function __construct( $mFirstParam, $iMailingId = null )
|
8 |
+
{
|
9 |
+
if (is_object($mFirstParam)) {
|
10 |
+
parent::__construct($mFirstParam);
|
11 |
+
return;
|
12 |
+
}
|
13 |
+
|
14 |
+
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
15 |
+
$this->_oCommandData = new stdClass;
|
16 |
+
$this->_oCommandData->type = self::SEND_MAIL_CMD_TYPE;
|
17 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array(self::ONE, self::TWO, self::THREE) );
|
18 |
+
|
19 |
+
if ($iMailingId === null) {
|
20 |
+
$aValues = array(
|
21 |
+
(string) $mFirstParam,
|
22 |
+
'0',
|
23 |
+
(string) self::CMD_TYPE_LAST_MAILING
|
24 |
+
);
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
if (!is_int($iMailingId)) {
|
28 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iMailingId argument or null expected');
|
29 |
+
}
|
30 |
+
$aValues = array(
|
31 |
+
(string) $mFirstParam,
|
32 |
+
(string) $iMailingId,
|
33 |
+
(string) self::CMD_TYPE_SPECIFIC_MAILING
|
34 |
+
);
|
35 |
+
}
|
36 |
+
|
37 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr($aValues);
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
public function getCmdType()
|
42 |
+
{
|
43 |
+
$iType = $this->getInteger( self::THREE );
|
44 |
+
|
45 |
+
if( $iType === null )
|
46 |
+
return self::CMD_TYPE_LAST_MAILING;
|
47 |
+
|
48 |
+
return $iType;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getListContextId()
|
52 |
+
{
|
53 |
+
return $this->getInteger( self::ONE );
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getMailingId()
|
57 |
+
{
|
58 |
+
return $this->getInteger( self::TWO );
|
59 |
+
}
|
60 |
+
|
61 |
+
public function toString()
|
62 |
+
{
|
63 |
+
return "SendMailCommand - listContextId: " . $this->getInteger( self::ONE )
|
64 |
+
. ", mailingId: " . $this->getInteger( self::TWO );
|
65 |
+
}
|
66 |
+
public function __toString()
|
67 |
+
{
|
68 |
+
return $this->toString();
|
69 |
+
}
|
70 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/SetValueCmd.php
CHANGED
@@ -1,66 +1,66 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Action_CommandImpl_SetValueCmd
|
4 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
-
implements Inx_Api_Action_SetValueCommand
|
6 |
-
{
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @param mixed $mFirstParam command data object, if the other two values are null, and attributeId otherwise
|
10 |
-
* @param int $iType
|
11 |
-
* @param string $sExpr
|
12 |
-
*/
|
13 |
-
public function __construct( $mFirstParam,$iType = null, $sExpr = null )
|
14 |
-
{
|
15 |
-
if (is_object($mFirstParam) && is_null($iType) && is_null($sExpr)) {
|
16 |
-
return parent::__construct($mFirstParam);
|
17 |
-
}
|
18 |
-
|
19 |
-
if (!is_int($iType)) {
|
20 |
-
throw new Inx_Api_IllegalArgumentException('Integer $iType argument or null expected');
|
21 |
-
}
|
22 |
-
|
23 |
-
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
24 |
-
$this->_oCommandData = new stdClass;
|
25 |
-
$this->_oCommandData->type = self::SET_VALUE_CMD_TYPE ;
|
26 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array(self::ONE, self::TWO, self::THREE) );
|
27 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
28 |
-
array(
|
29 |
-
(string) $mFirstParam,
|
30 |
-
(string) $iType,
|
31 |
-
$sExpr
|
32 |
-
)
|
33 |
-
);
|
34 |
-
}
|
35 |
-
|
36 |
-
public function getAttributeId()
|
37 |
-
{
|
38 |
-
return $this->getInteger( self::ONE );
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getCmdType()
|
42 |
-
{
|
43 |
-
$iType = $this->getInteger( self::TWO );
|
44 |
-
if( $iType==null )
|
45 |
-
return self::CMD_TYPE_ABSOLUTE;
|
46 |
-
|
47 |
-
return $iType;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function getExpression()
|
51 |
-
{
|
52 |
-
return $this->getParameter( self::THREE );
|
53 |
-
}
|
54 |
-
|
55 |
-
public function toString()
|
56 |
-
{
|
57 |
-
return "SetValueCommand - attributeId: " . $this->getInteger( self::ONE )
|
58 |
-
. ", cmdType: " . $this->getInteger( self::TWO ) . ", expression: "
|
59 |
-
. $this->getParameter( self::THREE );
|
60 |
-
}
|
61 |
-
|
62 |
-
public function __toString()
|
63 |
-
{
|
64 |
-
return $this->toString();
|
65 |
-
}
|
66 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Action_CommandImpl_SetValueCmd
|
4 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
+
implements Inx_Api_Action_SetValueCommand
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @param mixed $mFirstParam command data object, if the other two values are null, and attributeId otherwise
|
10 |
+
* @param int $iType
|
11 |
+
* @param string $sExpr
|
12 |
+
*/
|
13 |
+
public function __construct( $mFirstParam,$iType = null, $sExpr = null )
|
14 |
+
{
|
15 |
+
if (is_object($mFirstParam) && is_null($iType) && is_null($sExpr)) {
|
16 |
+
return parent::__construct($mFirstParam);
|
17 |
+
}
|
18 |
+
|
19 |
+
if (!is_int($iType)) {
|
20 |
+
throw new Inx_Api_IllegalArgumentException('Integer $iType argument or null expected');
|
21 |
+
}
|
22 |
+
|
23 |
+
parent::__construct( Inx_Apiimpl_Action_CommandImpl::createCommandData() );
|
24 |
+
$this->_oCommandData = new stdClass;
|
25 |
+
$this->_oCommandData->type = self::SET_VALUE_CMD_TYPE ;
|
26 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr( array(self::ONE, self::TWO, self::THREE) );
|
27 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
28 |
+
array(
|
29 |
+
(string) $mFirstParam,
|
30 |
+
(string) $iType,
|
31 |
+
$sExpr
|
32 |
+
)
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getAttributeId()
|
37 |
+
{
|
38 |
+
return $this->getInteger( self::ONE );
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getCmdType()
|
42 |
+
{
|
43 |
+
$iType = $this->getInteger( self::TWO );
|
44 |
+
if( $iType==null )
|
45 |
+
return self::CMD_TYPE_ABSOLUTE;
|
46 |
+
|
47 |
+
return $iType;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getExpression()
|
51 |
+
{
|
52 |
+
return $this->getParameter( self::THREE );
|
53 |
+
}
|
54 |
+
|
55 |
+
public function toString()
|
56 |
+
{
|
57 |
+
return "SetValueCommand - attributeId: " . $this->getInteger( self::ONE )
|
58 |
+
. ", cmdType: " . $this->getInteger( self::TWO ) . ", expression: "
|
59 |
+
. $this->getParameter( self::THREE );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function __toString()
|
63 |
+
{
|
64 |
+
return $this->toString();
|
65 |
+
}
|
66 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/SubUnsubscriptionCmd.php
CHANGED
@@ -1,65 +1,65 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd
|
4 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
-
implements Inx_Api_Action_SubUnsubscriptionCommand
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
-
* @param int $iType command type
|
10 |
-
* @param bool $blProcessingEnabled
|
11 |
-
*/
|
12 |
-
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
-
{
|
14 |
-
if (is_object($mFirstParam)) {
|
15 |
-
return parent::__construct($mFirstParam);
|
16 |
-
}
|
17 |
-
|
18 |
-
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
-
$this->_oCommandData = new stdClass;
|
20 |
-
$this->_oCommandData->type = self::CHANGE_SUBSCRIPTION_CMD_TYPE;
|
21 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
-
array(self::ONE, self::TWO, self::THREE)
|
23 |
-
);
|
24 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
-
array(
|
26 |
-
(string) $mFirstParam,
|
27 |
-
(string) $iType,
|
28 |
-
$blProcessingEnabled ? '1' : '0'
|
29 |
-
)
|
30 |
-
);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getListContextId()
|
34 |
-
{
|
35 |
-
return $this->getInteger( self::ONE );
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getCmdType()
|
39 |
-
{
|
40 |
-
$iType = $this->getInteger( self::TWO );
|
41 |
-
if( $iType==null )
|
42 |
-
return self::CMD_TYPE_SUBSCRIBE;
|
43 |
-
return $iType;
|
44 |
-
}
|
45 |
-
|
46 |
-
public function isProcessingEnabled()
|
47 |
-
{
|
48 |
-
$bool = $this->getInteger( self::THREE );
|
49 |
-
if( $bool==null )
|
50 |
-
return false;
|
51 |
-
|
52 |
-
return $bool == 1;
|
53 |
-
}
|
54 |
-
|
55 |
-
public function toString()
|
56 |
-
{
|
57 |
-
return "SubUnsubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
-
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
-
. $this->getInteger( self::THREE );
|
60 |
-
}
|
61 |
-
|
62 |
-
public function __toString() {
|
63 |
-
return $this->toString();
|
64 |
-
}
|
65 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Action_CommandImpl_SubUnsubscriptionCmd
|
4 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
+
implements Inx_Api_Action_SubUnsubscriptionCommand
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
+
* @param int $iType command type
|
10 |
+
* @param bool $blProcessingEnabled
|
11 |
+
*/
|
12 |
+
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
+
{
|
14 |
+
if (is_object($mFirstParam)) {
|
15 |
+
return parent::__construct($mFirstParam);
|
16 |
+
}
|
17 |
+
|
18 |
+
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
+
$this->_oCommandData = new stdClass;
|
20 |
+
$this->_oCommandData->type = self::CHANGE_SUBSCRIPTION_CMD_TYPE;
|
21 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
+
array(self::ONE, self::TWO, self::THREE)
|
23 |
+
);
|
24 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
+
array(
|
26 |
+
(string) $mFirstParam,
|
27 |
+
(string) $iType,
|
28 |
+
$blProcessingEnabled ? '1' : '0'
|
29 |
+
)
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getListContextId()
|
34 |
+
{
|
35 |
+
return $this->getInteger( self::ONE );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getCmdType()
|
39 |
+
{
|
40 |
+
$iType = $this->getInteger( self::TWO );
|
41 |
+
if( $iType==null )
|
42 |
+
return self::CMD_TYPE_SUBSCRIBE;
|
43 |
+
return $iType;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function isProcessingEnabled()
|
47 |
+
{
|
48 |
+
$bool = $this->getInteger( self::THREE );
|
49 |
+
if( $bool==null )
|
50 |
+
return false;
|
51 |
+
|
52 |
+
return $bool == 1;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function toString()
|
56 |
+
{
|
57 |
+
return "SubUnsubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
+
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
+
. $this->getInteger( self::THREE );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function __toString() {
|
63 |
+
return $this->toString();
|
64 |
+
}
|
65 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/SubscriptionCmd.php
CHANGED
@@ -1,65 +1,65 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd
|
4 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
-
implements Inx_Api_Action_SubscriptionCommand
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
-
* @param int $iType command type
|
10 |
-
* @param bool $blProcessingEnabled
|
11 |
-
*/
|
12 |
-
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
-
{
|
14 |
-
if (is_object($mFirstParam)) {
|
15 |
-
return parent::__construct($mFirstParam);
|
16 |
-
}
|
17 |
-
|
18 |
-
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
-
$this->_oCommandData = new stdClass;
|
20 |
-
$this->_oCommandData->type = self::SUBSCRIBE_MEMBER_CMD_TYPE;
|
21 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
-
array(self::ONE, self::TWO, self::THREE)
|
23 |
-
);
|
24 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
-
array(
|
26 |
-
(string) $mFirstParam,
|
27 |
-
(string) $iType,
|
28 |
-
$blProcessingEnabled ? '1' : '0'
|
29 |
-
)
|
30 |
-
);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getListContextId()
|
34 |
-
{
|
35 |
-
return $this->getInteger( self::ONE );
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getCmdType()
|
39 |
-
{
|
40 |
-
$iType = $this->getInteger( self::TWO );
|
41 |
-
if( $iType==null )
|
42 |
-
return self::CMD_TYPE_SUBSCRIBE;
|
43 |
-
return $iType;
|
44 |
-
}
|
45 |
-
|
46 |
-
public function isProcessingEnabled()
|
47 |
-
{
|
48 |
-
$bool = $this->getInteger( self::THREE );
|
49 |
-
if( $bool==null )
|
50 |
-
return false;
|
51 |
-
|
52 |
-
return $bool == 1;
|
53 |
-
}
|
54 |
-
|
55 |
-
public function toString()
|
56 |
-
{
|
57 |
-
return "SubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
-
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
-
. $this->getInteger( self::THREE );
|
60 |
-
}
|
61 |
-
|
62 |
-
public function __toString() {
|
63 |
-
return $this->toString();
|
64 |
-
}
|
65 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Action_CommandImpl_SubscriptionCmd
|
4 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
+
implements Inx_Api_Action_SubscriptionCommand
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
+
* @param int $iType command type
|
10 |
+
* @param bool $blProcessingEnabled
|
11 |
+
*/
|
12 |
+
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
+
{
|
14 |
+
if (is_object($mFirstParam)) {
|
15 |
+
return parent::__construct($mFirstParam);
|
16 |
+
}
|
17 |
+
|
18 |
+
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
+
$this->_oCommandData = new stdClass;
|
20 |
+
$this->_oCommandData->type = self::SUBSCRIBE_MEMBER_CMD_TYPE;
|
21 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
+
array(self::ONE, self::TWO, self::THREE)
|
23 |
+
);
|
24 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
+
array(
|
26 |
+
(string) $mFirstParam,
|
27 |
+
(string) $iType,
|
28 |
+
$blProcessingEnabled ? '1' : '0'
|
29 |
+
)
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getListContextId()
|
34 |
+
{
|
35 |
+
return $this->getInteger( self::ONE );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getCmdType()
|
39 |
+
{
|
40 |
+
$iType = $this->getInteger( self::TWO );
|
41 |
+
if( $iType==null )
|
42 |
+
return self::CMD_TYPE_SUBSCRIBE;
|
43 |
+
return $iType;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function isProcessingEnabled()
|
47 |
+
{
|
48 |
+
$bool = $this->getInteger( self::THREE );
|
49 |
+
if( $bool==null )
|
50 |
+
return false;
|
51 |
+
|
52 |
+
return $bool == 1;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function toString()
|
56 |
+
{
|
57 |
+
return "SubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
+
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
+
. $this->getInteger( self::THREE );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function __toString() {
|
63 |
+
return $this->toString();
|
64 |
+
}
|
65 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/UnknownCmd.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Action_CommandImpl_UnknownCmd extends Inx_Apiimpl_Action_CommandImpl
|
3 |
-
{
|
4 |
-
|
5 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Action_CommandImpl_UnknownCmd extends Inx_Apiimpl_Action_CommandImpl
|
3 |
+
{
|
4 |
+
|
5 |
}
|
lib/Inx/Apiimpl/Action/CommandImpl/UnsubscriptionCmd.php
CHANGED
@@ -1,65 +1,65 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd
|
4 |
-
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
-
implements Inx_Api_Action_UnsubscriptionCommand
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
-
* @param int $iType command type
|
10 |
-
* @param bool $blProcessingEnabled
|
11 |
-
*/
|
12 |
-
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
-
{
|
14 |
-
if (is_object($mFirstParam)) {
|
15 |
-
return parent::__construct($mFirstParam);
|
16 |
-
}
|
17 |
-
|
18 |
-
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
-
$this->_oCommandData = new stdClass;
|
20 |
-
$this->_oCommandData->type = self::UNSUBSCRIBE_MEMBER_CMD_TYPE;
|
21 |
-
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
-
array(self::ONE, self::TWO, self::THREE)
|
23 |
-
);
|
24 |
-
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
-
array(
|
26 |
-
(string) $mFirstParam,
|
27 |
-
(string) $iType,
|
28 |
-
$blProcessingEnabled ? '1' : '0'
|
29 |
-
)
|
30 |
-
);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getListContextId()
|
34 |
-
{
|
35 |
-
return $this->getInteger( self::ONE );
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getCmdType()
|
39 |
-
{
|
40 |
-
$iType = $this->getInteger( self::TWO );
|
41 |
-
if( $iType==null )
|
42 |
-
return self::CMD_TYPE_UNSUBSCRIBE;
|
43 |
-
return $iType;
|
44 |
-
}
|
45 |
-
|
46 |
-
public function isProcessingEnabled()
|
47 |
-
{
|
48 |
-
$bool = $this->getInteger( self::THREE );
|
49 |
-
if( $bool==null )
|
50 |
-
return false;
|
51 |
-
|
52 |
-
return $bool == 1;
|
53 |
-
}
|
54 |
-
|
55 |
-
public function toString()
|
56 |
-
{
|
57 |
-
return "UnsubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
-
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
-
. $this->getInteger( self::THREE );
|
60 |
-
}
|
61 |
-
|
62 |
-
public function __toString() {
|
63 |
-
return $this->toString();
|
64 |
-
}
|
65 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Action_CommandImpl_UnsubscriptionCmd
|
4 |
+
extends Inx_Apiimpl_Action_CommandImpl
|
5 |
+
implements Inx_Api_Action_UnsubscriptionCommand
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @param mixed $mFirstParam if this is integer, than - listcontextid, else command data from service
|
9 |
+
* @param int $iType command type
|
10 |
+
* @param bool $blProcessingEnabled
|
11 |
+
*/
|
12 |
+
public function __construct( $mFirstParam, $iType=null, $blProcessingEnabled = null )
|
13 |
+
{
|
14 |
+
if (is_object($mFirstParam)) {
|
15 |
+
return parent::__construct($mFirstParam);
|
16 |
+
}
|
17 |
+
|
18 |
+
parent::__construct(Inx_Apiimpl_Action_CommandImpl::createCommandData());
|
19 |
+
$this->_oCommandData = new stdClass;
|
20 |
+
$this->_oCommandData->type = self::UNSUBSCRIBE_MEMBER_CMD_TYPE;
|
21 |
+
$this->_oCommandData->keys = Inx_Apiimpl_TConvert::arrToTArr(
|
22 |
+
array(self::ONE, self::TWO, self::THREE)
|
23 |
+
);
|
24 |
+
$this->_oCommandData->values = Inx_Apiimpl_TConvert::arrToTArr(
|
25 |
+
array(
|
26 |
+
(string) $mFirstParam,
|
27 |
+
(string) $iType,
|
28 |
+
$blProcessingEnabled ? '1' : '0'
|
29 |
+
)
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getListContextId()
|
34 |
+
{
|
35 |
+
return $this->getInteger( self::ONE );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getCmdType()
|
39 |
+
{
|
40 |
+
$iType = $this->getInteger( self::TWO );
|
41 |
+
if( $iType==null )
|
42 |
+
return self::CMD_TYPE_UNSUBSCRIBE;
|
43 |
+
return $iType;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function isProcessingEnabled()
|
47 |
+
{
|
48 |
+
$bool = $this->getInteger( self::THREE );
|
49 |
+
if( $bool==null )
|
50 |
+
return false;
|
51 |
+
|
52 |
+
return $bool == 1;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function toString()
|
56 |
+
{
|
57 |
+
return "UnsubscriptionCommand - listContextId: " . $this->getInteger( self::ONE )
|
58 |
+
. ", cmdType: " . $this->getInteger( self::TWO ) . ", processingEnabled: "
|
59 |
+
. $this->getInteger( self::THREE );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function __toString() {
|
63 |
+
return $this->toString();
|
64 |
+
}
|
65 |
}
|
lib/Inx/Apiimpl/Approval/ApproverImpl.php
CHANGED
@@ -1,144 +1,144 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* ApproverImpl
|
5 |
-
*
|
6 |
-
* @version
|
7 |
-
*/
|
8 |
-
class Inx_Apiimpl_Approval_ApproverImpl implements Inx_Api_Approval_Approver
|
9 |
-
{
|
10 |
-
|
11 |
-
protected $_oSc;
|
12 |
-
|
13 |
-
protected $_oData;
|
14 |
-
|
15 |
-
private $service;
|
16 |
-
|
17 |
-
|
18 |
-
public function __construct( $oSc, stdClass $oData )
|
19 |
-
{
|
20 |
-
$this->_oSc = $oSc;
|
21 |
-
$this->_oData = $oData;
|
22 |
-
$this->service = $oSc->getService( Inx_Apiimpl_SessionContext::APPROVER_SERVICE );
|
23 |
-
}
|
24 |
-
|
25 |
-
|
26 |
-
public function commitUpdate()
|
27 |
-
{
|
28 |
-
if( empty($this->_oData->comment) || empty($this->_oData->email) || empty($this->_oData->listIds) ||
|
29 |
-
empty($this->_oData->name) )
|
30 |
-
throw new Inx_Api_UpdateException( "Commiting wrong values", Inx_Api_UpdateException::ERROR_TYPE_ILLEGAL_VALUE,
|
31 |
-
Inx_Api_UpdateException::ERROR_SOURCE_NOT_SPECIFIED );
|
32 |
-
try
|
33 |
-
{
|
34 |
-
$adh = $this->service->update( $this->_oSc->createCxt(), $this->_oData );
|
35 |
-
if( !empty($adh->excDesc) )
|
36 |
-
throw new Inx_Api_UpdateException( $adh->excDesc->msg, $adh->excDesc->type, $adh->excDesc->source );
|
37 |
-
|
38 |
-
if( !empty($adh->value) )
|
39 |
-
{
|
40 |
-
$this->_oData = $adh->value;
|
41 |
-
}
|
42 |
-
else
|
43 |
-
throw new Inx_Api_DataException( "deleted object" );
|
44 |
-
}
|
45 |
-
catch( Inx_Api_RemoteException $e )
|
46 |
-
{
|
47 |
-
$this->_oSc->notify( $e );
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
public function getId()
|
53 |
-
{
|
54 |
-
return $this->_oData->id;
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
public function reload()
|
59 |
-
{
|
60 |
-
try
|
61 |
-
{
|
62 |
-
$this->_oData = $this->service->get( $this->_oSc->createCxt(), $this->_oData->id );
|
63 |
-
if( empty($this->_oData) )
|
64 |
-
throw new Inx_Api_DataException( "approver deleted" );
|
65 |
-
}
|
66 |
-
catch( Inx_Api_RemoteException $e )
|
67 |
-
{
|
68 |
-
$this->_oSc->notify( $e );
|
69 |
-
}
|
70 |
-
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
public function convert( Inx_Apiimpl_SessionContext $sc, $approverData )
|
75 |
-
{
|
76 |
-
if( $approverData === null )
|
77 |
-
return null;
|
78 |
-
|
79 |
-
return new Inx_Apiimpl_Approval_ApproverImpl( $sc, $approverData );
|
80 |
-
}
|
81 |
-
|
82 |
-
|
83 |
-
public function convertArr( Inx_Apiimpl_SessionContext $sc, $data )
|
84 |
-
{
|
85 |
-
if( empty($data) )
|
86 |
-
return array();
|
87 |
-
|
88 |
-
$rs = array();
|
89 |
-
foreach ($data as $i => $entryValue ) {
|
90 |
-
if ($entryValue) {
|
91 |
-
$rs[$i] = new Inx_Apiimpl_Approval_ApproverImpl( $sc, $entryValue );
|
92 |
-
}
|
93 |
-
}
|
94 |
-
return $rs;
|
95 |
-
}
|
96 |
-
|
97 |
-
|
98 |
-
public function getComment()
|
99 |
-
{
|
100 |
-
return $this->_oData->comment;
|
101 |
-
}
|
102 |
-
|
103 |
-
|
104 |
-
public function getEmail()
|
105 |
-
{
|
106 |
-
return $this->_oData->email;
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
-
public function getLists()
|
111 |
-
{
|
112 |
-
return $this->_oData->listIds;
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
public function getName()
|
117 |
-
{
|
118 |
-
return $this->_oData->name;
|
119 |
-
}
|
120 |
-
|
121 |
-
|
122 |
-
public function updateComment( $sComment )
|
123 |
-
{
|
124 |
-
$this->_oData->comment = $sComment;
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
public function updateEmail( $sEmail )
|
129 |
-
{
|
130 |
-
$this->_oData->email = $sEmail;
|
131 |
-
}
|
132 |
-
|
133 |
-
|
134 |
-
public function updateLists( $lists )
|
135 |
-
{
|
136 |
-
$this->_oData->listIds = $lists;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
public function updateName( $sName )
|
141 |
-
{
|
142 |
-
$this->_oData->name = $sName;
|
143 |
-
}
|
144 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ApproverImpl
|
5 |
+
*
|
6 |
+
* @version
|
7 |
+
*/
|
8 |
+
class Inx_Apiimpl_Approval_ApproverImpl implements Inx_Api_Approval_Approver
|
9 |
+
{
|
10 |
+
|
11 |
+
protected $_oSc;
|
12 |
+
|
13 |
+
protected $_oData;
|
14 |
+
|
15 |
+
private $service;
|
16 |
+
|
17 |
+
|
18 |
+
public function __construct( $oSc, stdClass $oData )
|
19 |
+
{
|
20 |
+
$this->_oSc = $oSc;
|
21 |
+
$this->_oData = $oData;
|
22 |
+
$this->service = $oSc->getService( Inx_Apiimpl_SessionContext::APPROVER_SERVICE );
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
public function commitUpdate()
|
27 |
+
{
|
28 |
+
if( empty($this->_oData->comment) || empty($this->_oData->email) || empty($this->_oData->listIds) ||
|
29 |
+
empty($this->_oData->name) )
|
30 |
+
throw new Inx_Api_UpdateException( "Commiting wrong values", Inx_Api_UpdateException::ERROR_TYPE_ILLEGAL_VALUE,
|
31 |
+
Inx_Api_UpdateException::ERROR_SOURCE_NOT_SPECIFIED );
|
32 |
+
try
|
33 |
+
{
|
34 |
+
$adh = $this->service->update( $this->_oSc->createCxt(), $this->_oData );
|
35 |
+
if( !empty($adh->excDesc) )
|
36 |
+
throw new Inx_Api_UpdateException( $adh->excDesc->msg, $adh->excDesc->type, $adh->excDesc->source );
|
37 |
+
|
38 |
+
if( !empty($adh->value) )
|
39 |
+
{
|
40 |
+
$this->_oData = $adh->value;
|
41 |
+
}
|
42 |
+
else
|
43 |
+
throw new Inx_Api_DataException( "deleted object" );
|
44 |
+
}
|
45 |
+
catch( Inx_Api_RemoteException $e )
|
46 |
+
{
|
47 |
+
$this->_oSc->notify( $e );
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
public function getId()
|
53 |
+
{
|
54 |
+
return $this->_oData->id;
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
public function reload()
|
59 |
+
{
|
60 |
+
try
|
61 |
+
{
|
62 |
+
$this->_oData = $this->service->get( $this->_oSc->createCxt(), $this->_oData->id );
|
63 |
+
if( empty($this->_oData) )
|
64 |
+
throw new Inx_Api_DataException( "approver deleted" );
|
65 |
+
}
|
66 |
+
catch( Inx_Api_RemoteException $e )
|
67 |
+
{
|
68 |
+
$this->_oSc->notify( $e );
|
69 |
+
}
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
public function convert( Inx_Apiimpl_SessionContext $sc, $approverData )
|
75 |
+
{
|
76 |
+
if( $approverData === null )
|
77 |
+
return null;
|
78 |
+
|
79 |
+
return new Inx_Apiimpl_Approval_ApproverImpl( $sc, $approverData );
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
public function convertArr( Inx_Apiimpl_SessionContext $sc, $data )
|
84 |
+
{
|
85 |
+
if( empty($data) )
|
86 |
+
return array();
|
87 |
+
|
88 |
+
$rs = array();
|
89 |
+
foreach ($data as $i => $entryValue ) {
|
90 |
+
if ($entryValue) {
|
91 |
+
$rs[$i] = new Inx_Apiimpl_Approval_ApproverImpl( $sc, $entryValue );
|
92 |
+
}
|
93 |
+
}
|
94 |
+
return $rs;
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
public function getComment()
|
99 |
+
{
|
100 |
+
return $this->_oData->comment;
|
101 |
+
}
|
102 |
+
|
103 |
+
|
104 |
+
public function getEmail()
|
105 |
+
{
|
106 |
+
return $this->_oData->email;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
public function getLists()
|
111 |
+
{
|
112 |
+
return $this->_oData->listIds;
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
public function getName()
|
117 |
+
{
|
118 |
+
return $this->_oData->name;
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
public function updateComment( $sComment )
|
123 |
+
{
|
124 |
+
$this->_oData->comment = $sComment;
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
public function updateEmail( $sEmail )
|
129 |
+
{
|
130 |
+
$this->_oData->email = $sEmail;
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
public function updateLists( $lists )
|
135 |
+
{
|
136 |
+
$this->_oData->listIds = $lists;
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
public function updateName( $sName )
|
141 |
+
{
|
142 |
+
$this->_oData->name = $sName;
|
143 |
+
}
|
144 |
+
}
|
lib/Inx/Apiimpl/Approval/ApproverManagerImpl.php
CHANGED
@@ -1,124 +1,124 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* ApproverManagerImpl
|
5 |
-
*
|
6 |
-
* @version
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
class Inx_Apiimpl_Approval_ApproverManagerImpl implements Inx_Api_Approval_ApproverManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
11 |
-
{
|
12 |
-
|
13 |
-
protected $_oSc;
|
14 |
-
|
15 |
-
protected $_oService;
|
16 |
-
|
17 |
-
|
18 |
-
public function __construct( $oSc )
|
19 |
-
{
|
20 |
-
$this->_oSc = $oSc;
|
21 |
-
$this->_oService = $oSc->getService( Inx_Apiimpl_SessionContext::APPROVER_SERVICE );
|
22 |
-
}
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
public function select( $listContext )
|
27 |
-
{
|
28 |
-
|
29 |
-
try
|
30 |
-
{
|
31 |
-
$rs = $this->_oService->selectApprover( $this->_oSc->createCxt(), $listContext->getId() );
|
32 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
33 |
-
Inx_Apiimpl_Approval_ApproverImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
34 |
-
catch( Inx_Api_RemoteException $x )
|
35 |
-
{
|
36 |
-
$this->_oSc->notify( $x );
|
37 |
-
return null;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
public function get( $id )
|
43 |
-
{
|
44 |
-
|
45 |
-
if (!is_int($id)) {
|
46 |
-
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
47 |
-
}
|
48 |
-
try
|
49 |
-
{
|
50 |
-
$entry = Inx_Apiimpl_Approval_ApproverImpl::convert( $this->_oSc, $this->_oService->get( $this->_oSc->createCxt(), $id ) );
|
51 |
-
if( $entry === null )
|
52 |
-
throw new DataException( "approver deleted" );
|
53 |
-
return $entry;
|
54 |
-
}
|
55 |
-
catch( Inx_Api_RemoteException $e )
|
56 |
-
{
|
57 |
-
$this->_oSc->notify( $e );
|
58 |
-
return null;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
public function remove( $id )
|
64 |
-
{
|
65 |
-
if (!is_int($id)) {
|
66 |
-
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
67 |
-
}
|
68 |
-
try
|
69 |
-
{
|
70 |
-
return $this->_oService->remove( $this->_oSc->createCxt(), $id );
|
71 |
-
}
|
72 |
-
catch( Inx_Api_RemoteException $e )
|
73 |
-
{
|
74 |
-
$this->_oSc->notify( $e );
|
75 |
-
return false;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
81 |
-
{
|
82 |
-
return $this->_oService->removeSelection( $oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
87 |
-
{
|
88 |
-
return Inx_Apiimpl_Approval_ApproverImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
89 |
-
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
public function createApprover()
|
96 |
-
{
|
97 |
-
$oData = new stdClass();
|
98 |
-
$oData->id = null;
|
99 |
-
$oData->listIds = array();
|
100 |
-
$oData->name = null;
|
101 |
-
$oData->email = null;
|
102 |
-
$oData->comment = null;
|
103 |
-
|
104 |
-
return new Inx_Apiimpl_Approval_ApproverImpl( $this->_oSc, $oData );
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
public function selectAll()
|
109 |
-
{
|
110 |
-
try
|
111 |
-
{
|
112 |
-
|
113 |
-
$rs = $this->_oService->selectAll( $this->_oSc->createCxt() );
|
114 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
115 |
-
Inx_Apiimpl_Approval_ApproverImpl::convertArr( $this->_oSc, $rs->data ) );
|
116 |
-
}
|
117 |
-
catch( Inx_Api_RemoteException $e )
|
118 |
-
{
|
119 |
-
$this->_oSc->notify( $e );
|
120 |
-
return null;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ApproverManagerImpl
|
5 |
+
*
|
6 |
+
* @version
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
class Inx_Apiimpl_Approval_ApproverManagerImpl implements Inx_Api_Approval_ApproverManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
11 |
+
{
|
12 |
+
|
13 |
+
protected $_oSc;
|
14 |
+
|
15 |
+
protected $_oService;
|
16 |
+
|
17 |
+
|
18 |
+
public function __construct( $oSc )
|
19 |
+
{
|
20 |
+
$this->_oSc = $oSc;
|
21 |
+
$this->_oService = $oSc->getService( Inx_Apiimpl_SessionContext::APPROVER_SERVICE );
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
public function select( $listContext )
|
27 |
+
{
|
28 |
+
|
29 |
+
try
|
30 |
+
{
|
31 |
+
$rs = $this->_oService->selectApprover( $this->_oSc->createCxt(), $listContext->getId() );
|
32 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
33 |
+
Inx_Apiimpl_Approval_ApproverImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
34 |
+
catch( Inx_Api_RemoteException $x )
|
35 |
+
{
|
36 |
+
$this->_oSc->notify( $x );
|
37 |
+
return null;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
public function get( $id )
|
43 |
+
{
|
44 |
+
|
45 |
+
if (!is_int($id)) {
|
46 |
+
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
47 |
+
}
|
48 |
+
try
|
49 |
+
{
|
50 |
+
$entry = Inx_Apiimpl_Approval_ApproverImpl::convert( $this->_oSc, $this->_oService->get( $this->_oSc->createCxt(), $id ) );
|
51 |
+
if( $entry === null )
|
52 |
+
throw new DataException( "approver deleted" );
|
53 |
+
return $entry;
|
54 |
+
}
|
55 |
+
catch( Inx_Api_RemoteException $e )
|
56 |
+
{
|
57 |
+
$this->_oSc->notify( $e );
|
58 |
+
return null;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
public function remove( $id )
|
64 |
+
{
|
65 |
+
if (!is_int($id)) {
|
66 |
+
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
67 |
+
}
|
68 |
+
try
|
69 |
+
{
|
70 |
+
return $this->_oService->remove( $this->_oSc->createCxt(), $id );
|
71 |
+
}
|
72 |
+
catch( Inx_Api_RemoteException $e )
|
73 |
+
{
|
74 |
+
$this->_oSc->notify( $e );
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
81 |
+
{
|
82 |
+
return $this->_oService->removeSelection( $oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
87 |
+
{
|
88 |
+
return Inx_Apiimpl_Approval_ApproverImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
89 |
+
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
public function createApprover()
|
96 |
+
{
|
97 |
+
$oData = new stdClass();
|
98 |
+
$oData->id = null;
|
99 |
+
$oData->listIds = array();
|
100 |
+
$oData->name = null;
|
101 |
+
$oData->email = null;
|
102 |
+
$oData->comment = null;
|
103 |
+
|
104 |
+
return new Inx_Apiimpl_Approval_ApproverImpl( $this->_oSc, $oData );
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
public function selectAll()
|
109 |
+
{
|
110 |
+
try
|
111 |
+
{
|
112 |
+
|
113 |
+
$rs = $this->_oService->selectAll( $this->_oSc->createCxt() );
|
114 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
115 |
+
Inx_Apiimpl_Approval_ApproverImpl::convertArr( $this->_oSc, $rs->data ) );
|
116 |
+
}
|
117 |
+
catch( Inx_Api_RemoteException $e )
|
118 |
+
{
|
119 |
+
$this->_oSc->notify( $e );
|
120 |
+
return null;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
}
|
lib/Inx/Apiimpl/Blacklist/BlacklistConstants.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
* @author sbn, 10.09.2007
|
7 |
-
* @copyright Inxmail GmbH
|
8 |
-
* @version $Revision: 9352 $ $Date: 2007-12-10 09:36:59 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
9 |
-
*/
|
10 |
-
class Inx_Apiimpl_Blacklist_BlacklistConstants
|
11 |
-
{
|
12 |
-
const MAX_ATTRIBUTES = 3;
|
13 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @author sbn, 10.09.2007
|
7 |
+
* @copyright Inxmail GmbH
|
8 |
+
* @version $Revision: 9352 $ $Date: 2007-12-10 09:36:59 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
9 |
+
*/
|
10 |
+
class Inx_Apiimpl_Blacklist_BlacklistConstants
|
11 |
+
{
|
12 |
+
const MAX_ATTRIBUTES = 3;
|
13 |
+
}
|
lib/Inx/Apiimpl/Blacklist/BlacklistEntryImpl.php
CHANGED
@@ -1,150 +1,150 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* BlacklistEntryImpl
|
5 |
-
*
|
6 |
-
* @version $Revision: 9352 $ $Date: 2007-12-10 09:36:59 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
7 |
-
*/
|
8 |
-
class Inx_Apiimpl_Blacklist_BlacklistEntryImpl implements Inx_Api_Blacklist_BlacklistEntry
|
9 |
-
{
|
10 |
-
protected $_oSc;
|
11 |
-
|
12 |
-
protected $_oData;
|
13 |
-
|
14 |
-
protected $_aChangedAttrs;
|
15 |
-
|
16 |
-
|
17 |
-
public function __construct( $oSc, stdClass $oData )
|
18 |
-
{
|
19 |
-
$this->_oSc = $oSc;
|
20 |
-
$this->_oData = $oData;
|
21 |
-
}
|
22 |
-
|
23 |
-
public function getId()
|
24 |
-
{
|
25 |
-
return $this->_oData->id;
|
26 |
-
}
|
27 |
-
|
28 |
-
public function getPattern()
|
29 |
-
{
|
30 |
-
return$this->_oData->pattern;
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getDescription()
|
34 |
-
{
|
35 |
-
return $this->_oData->description->value;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getHitCount()
|
39 |
-
{
|
40 |
-
return $this->_oData->hitCount;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Enter description here...
|
45 |
-
*
|
46 |
-
* @param string $pattern
|
47 |
-
*/
|
48 |
-
public function updatePattern( $pattern )
|
49 |
-
{
|
50 |
-
$this->writeAccess( Inx_Api_Blacklist_BlacklistEntry::ATTRIBUTE_PATTERN );
|
51 |
-
$this->_oData->pattern = $pattern;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Enter description here...
|
56 |
-
*
|
57 |
-
* @param string $desc
|
58 |
-
*/
|
59 |
-
public function updateDescription( $desc )
|
60 |
-
{
|
61 |
-
$this->writeAccess( Inx_Api_Blacklist_BlacklistEntry::ATTRIBUTE_DESCRIPTION );
|
62 |
-
$this->_oData->description = new stdClass();
|
63 |
-
$this->_oData->description->value = $desc;
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
public function commitUpdate()
|
68 |
-
{
|
69 |
-
try
|
70 |
-
{
|
71 |
-
$service = $this->_oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
72 |
-
try {
|
73 |
-
$r = $service->update( $this->_oSc->createCxt(), $this->_oData, Inx_Apiimpl_TConvert::arrToTArr( $this->_aChangedAttrs ) );
|
74 |
-
} catch (Inx_Api_RemoteException $e) {
|
75 |
-
throw new Inx_Api_UpdateException( $e->getMessage(), $e->getCode(), $e);
|
76 |
-
}
|
77 |
-
|
78 |
-
$this->_oData = $r->value;
|
79 |
-
$this->_aChangedAttrs = null;
|
80 |
-
|
81 |
-
if( $this->_oData === null )
|
82 |
-
throw new Inx_Api_DataException( "blacklist entry deleted" );
|
83 |
-
}
|
84 |
-
catch( Inx_Api_RemoteException $e )
|
85 |
-
{
|
86 |
-
$this->_oSc->notify( $e );
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
public function reload()
|
92 |
-
{
|
93 |
-
try
|
94 |
-
{
|
95 |
-
$service = $this->_oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
96 |
-
$this->_oData = $service->get( $this->_oSc->createCxt(), $this->_oData->id );
|
97 |
-
$this->_aChangedAttrs = null;
|
98 |
-
|
99 |
-
if( empty($this->_oData) )
|
100 |
-
throw new Inx_Api_DataException( "blacklist entry deleted" );
|
101 |
-
}
|
102 |
-
catch( Inx_Api_RemoteException $e )
|
103 |
-
{
|
104 |
-
$this->_oSc->notify( $e );
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
protected function writeAccess( $iAttrIndex )
|
110 |
-
{
|
111 |
-
if( empty($this->_aChangedAttrs) )
|
112 |
-
$this->_aChangedAttrs = array();
|
113 |
-
$this->_aChangedAttrs[ $iAttrIndex ] = true;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Enter description here...
|
118 |
-
*
|
119 |
-
* @param BlacklistData $this
|
120 |
-
* @return Inx_Api_Blacklist_BlacklistEntry
|
121 |
-
*/
|
122 |
-
public static function convert( Inx_Apiimpl_SessionContext $oSc, /*stdClass*/ $oData )
|
123 |
-
{
|
124 |
-
if( $oData === null )
|
125 |
-
return null;
|
126 |
-
|
127 |
-
return new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $oSc, $oData );
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Enter description here...
|
132 |
-
*
|
133 |
-
* @param Inx_Apiimpl_SessionContext $oSc
|
134 |
-
* @param array $aData
|
135 |
-
*/
|
136 |
-
public static function convertArr( $oSc, $aData )
|
137 |
-
{
|
138 |
-
|
139 |
-
if( empty($aData) )
|
140 |
-
return array();
|
141 |
-
|
142 |
-
$rs = array(); // new BlacklistEntry[ $this->_oData.length ];
|
143 |
-
foreach ($aData as $i => $entryValue ) {
|
144 |
-
if ($entryValue) {
|
145 |
-
$rs[$i] = new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $oSc, $entryValue );
|
146 |
-
}
|
147 |
-
}
|
148 |
-
return $rs;
|
149 |
-
}
|
150 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BlacklistEntryImpl
|
5 |
+
*
|
6 |
+
* @version $Revision: 9352 $ $Date: 2007-12-10 09:36:59 +0200 (Pr, 10 Grd 2007) $ $Author: aurimas $
|
7 |
+
*/
|
8 |
+
class Inx_Apiimpl_Blacklist_BlacklistEntryImpl implements Inx_Api_Blacklist_BlacklistEntry
|
9 |
+
{
|
10 |
+
protected $_oSc;
|
11 |
+
|
12 |
+
protected $_oData;
|
13 |
+
|
14 |
+
protected $_aChangedAttrs;
|
15 |
+
|
16 |
+
|
17 |
+
public function __construct( $oSc, stdClass $oData )
|
18 |
+
{
|
19 |
+
$this->_oSc = $oSc;
|
20 |
+
$this->_oData = $oData;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getId()
|
24 |
+
{
|
25 |
+
return $this->_oData->id;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPattern()
|
29 |
+
{
|
30 |
+
return$this->_oData->pattern;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getDescription()
|
34 |
+
{
|
35 |
+
return $this->_oData->description->value;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getHitCount()
|
39 |
+
{
|
40 |
+
return $this->_oData->hitCount;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Enter description here...
|
45 |
+
*
|
46 |
+
* @param string $pattern
|
47 |
+
*/
|
48 |
+
public function updatePattern( $pattern )
|
49 |
+
{
|
50 |
+
$this->writeAccess( Inx_Api_Blacklist_BlacklistEntry::ATTRIBUTE_PATTERN );
|
51 |
+
$this->_oData->pattern = $pattern;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Enter description here...
|
56 |
+
*
|
57 |
+
* @param string $desc
|
58 |
+
*/
|
59 |
+
public function updateDescription( $desc )
|
60 |
+
{
|
61 |
+
$this->writeAccess( Inx_Api_Blacklist_BlacklistEntry::ATTRIBUTE_DESCRIPTION );
|
62 |
+
$this->_oData->description = new stdClass();
|
63 |
+
$this->_oData->description->value = $desc;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
public function commitUpdate()
|
68 |
+
{
|
69 |
+
try
|
70 |
+
{
|
71 |
+
$service = $this->_oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
72 |
+
try {
|
73 |
+
$r = $service->update( $this->_oSc->createCxt(), $this->_oData, Inx_Apiimpl_TConvert::arrToTArr( $this->_aChangedAttrs ) );
|
74 |
+
} catch (Inx_Api_RemoteException $e) {
|
75 |
+
throw new Inx_Api_UpdateException( $e->getMessage(), $e->getCode(), $e);
|
76 |
+
}
|
77 |
+
|
78 |
+
$this->_oData = $r->value;
|
79 |
+
$this->_aChangedAttrs = null;
|
80 |
+
|
81 |
+
if( $this->_oData === null )
|
82 |
+
throw new Inx_Api_DataException( "blacklist entry deleted" );
|
83 |
+
}
|
84 |
+
catch( Inx_Api_RemoteException $e )
|
85 |
+
{
|
86 |
+
$this->_oSc->notify( $e );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
public function reload()
|
92 |
+
{
|
93 |
+
try
|
94 |
+
{
|
95 |
+
$service = $this->_oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
96 |
+
$this->_oData = $service->get( $this->_oSc->createCxt(), $this->_oData->id );
|
97 |
+
$this->_aChangedAttrs = null;
|
98 |
+
|
99 |
+
if( empty($this->_oData) )
|
100 |
+
throw new Inx_Api_DataException( "blacklist entry deleted" );
|
101 |
+
}
|
102 |
+
catch( Inx_Api_RemoteException $e )
|
103 |
+
{
|
104 |
+
$this->_oSc->notify( $e );
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
protected function writeAccess( $iAttrIndex )
|
110 |
+
{
|
111 |
+
if( empty($this->_aChangedAttrs) )
|
112 |
+
$this->_aChangedAttrs = array();
|
113 |
+
$this->_aChangedAttrs[ $iAttrIndex ] = true;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Enter description here...
|
118 |
+
*
|
119 |
+
* @param BlacklistData $this
|
120 |
+
* @return Inx_Api_Blacklist_BlacklistEntry
|
121 |
+
*/
|
122 |
+
public static function convert( Inx_Apiimpl_SessionContext $oSc, /*stdClass*/ $oData )
|
123 |
+
{
|
124 |
+
if( $oData === null )
|
125 |
+
return null;
|
126 |
+
|
127 |
+
return new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $oSc, $oData );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Enter description here...
|
132 |
+
*
|
133 |
+
* @param Inx_Apiimpl_SessionContext $oSc
|
134 |
+
* @param array $aData
|
135 |
+
*/
|
136 |
+
public static function convertArr( $oSc, $aData )
|
137 |
+
{
|
138 |
+
|
139 |
+
if( empty($aData) )
|
140 |
+
return array();
|
141 |
+
|
142 |
+
$rs = array(); // new BlacklistEntry[ $this->_oData.length ];
|
143 |
+
foreach ($aData as $i => $entryValue ) {
|
144 |
+
if ($entryValue) {
|
145 |
+
$rs[$i] = new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $oSc, $entryValue );
|
146 |
+
}
|
147 |
+
}
|
148 |
+
return $rs;
|
149 |
+
}
|
150 |
+
}
|
lib/Inx/Apiimpl/Blacklist/BlacklistManagerImpl.php
CHANGED
@@ -1,211 +1,211 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
/**
|
6 |
-
* BlacklistManagerImpl
|
7 |
-
*
|
8 |
-
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
9 |
-
*/
|
10 |
-
class Inx_Apiimpl_Blacklist_BlacklistManagerImpl implements Inx_Api_Blacklist_BlacklistManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
11 |
-
{
|
12 |
-
|
13 |
-
protected $_oSc;
|
14 |
-
|
15 |
-
protected $_oService;
|
16 |
-
|
17 |
-
|
18 |
-
public function __construct( $oSc )
|
19 |
-
{
|
20 |
-
$this->_oSc = $oSc;
|
21 |
-
$this->_oService = $oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
22 |
-
}
|
23 |
-
|
24 |
-
|
25 |
-
public function createBlacklistEntry()
|
26 |
-
{
|
27 |
-
$blData = new stdClass();
|
28 |
-
$blData->id = null;
|
29 |
-
$blData->pattern = null;
|
30 |
-
$blData->hitCount = null;
|
31 |
-
return new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $this->_oSc, $blData);
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Enter description here...
|
37 |
-
*
|
38 |
-
* @param unknown_type $id
|
39 |
-
* @return unknown
|
40 |
-
*/
|
41 |
-
public function get( $id )
|
42 |
-
{
|
43 |
-
if (!is_int($id)) {
|
44 |
-
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
45 |
-
}
|
46 |
-
try
|
47 |
-
{
|
48 |
-
$entry = Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convert( $this->_oSc, $this->_oService->get( $this->_oSc->createCxt(), $id ) );
|
49 |
-
if( $entry === null )
|
50 |
-
throw new DataException( "blacklist entry deleted" );
|
51 |
-
return $entry;
|
52 |
-
}
|
53 |
-
catch( Inx_Api_RemoteException $e )
|
54 |
-
{
|
55 |
-
$this->_oSc->notify( $e );
|
56 |
-
return null;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Enter description here...
|
63 |
-
*
|
64 |
-
* @param int $id
|
65 |
-
* @return boolean
|
66 |
-
*/
|
67 |
-
public function remove( $id )
|
68 |
-
{
|
69 |
-
if (!is_int($id)) {
|
70 |
-
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
71 |
-
}
|
72 |
-
try
|
73 |
-
{
|
74 |
-
return $this->_oService->remove( $this->_oSc->createCxt(), $id );
|
75 |
-
}
|
76 |
-
catch( Inx_Api_RemoteException $e )
|
77 |
-
{
|
78 |
-
$this->_oSc->notify( $e );
|
79 |
-
return false;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Enter description here...
|
86 |
-
*
|
87 |
-
* @return Inx_Api_BOResultSet
|
88 |
-
*/
|
89 |
-
public function selectAll( $iOrderAttribute = null, $iOrderType = null )
|
90 |
-
{
|
91 |
-
if (isset($iOrderAttribute) && isset($iOrderType) && (!is_int($iOrderAttribute) || !is_int($iOrderType)))
|
92 |
-
{
|
93 |
-
throw new Inx_Api_IllegalArgumentException('Wrong parameters, integers expected');
|
94 |
-
}
|
95 |
-
|
96 |
-
if ($iOrderAttribute==null && $iOrderType === null) {
|
97 |
-
try
|
98 |
-
{
|
99 |
-
/**
|
100 |
-
* @var stdClass
|
101 |
-
*/
|
102 |
-
$rs = $this->_oService->selectAll( $this->_oSc->createCxt(), -1, -1 );
|
103 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
104 |
-
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
105 |
-
}
|
106 |
-
catch( Inx_Api_RemoteException $e )
|
107 |
-
{
|
108 |
-
$this->_oSc->notify( $e );
|
109 |
-
return null;
|
110 |
-
}
|
111 |
-
} else {
|
112 |
-
try
|
113 |
-
{
|
114 |
-
$rs = $this->_oService->selectAll( $this->_oSc->createCxt(), $iOrderAttribute, $iOrderType );
|
115 |
-
|
116 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
117 |
-
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
118 |
-
}
|
119 |
-
catch( Inx_Api_RemoteException $e )
|
120 |
-
{
|
121 |
-
$this->_oSc->notify( $e );
|
122 |
-
return null;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Enter description here...
|
130 |
-
*
|
131 |
-
* @param string $pattern
|
132 |
-
* @return Inx_Api_Blacklist_BlacklistEntry
|
133 |
-
*/
|
134 |
-
public function findByPattern( $pattern )
|
135 |
-
{
|
136 |
-
try
|
137 |
-
{
|
138 |
-
return Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convert( $this->_oSc, $this->_oService->findByPattern(
|
139 |
-
$this->_oSc->createCxt(), $pattern ) );
|
140 |
-
}
|
141 |
-
catch( Inx_Api_RemoteException $e )
|
142 |
-
{
|
143 |
-
$this->_oSc->notify( $e );
|
144 |
-
return null;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Enter description here...
|
151 |
-
*
|
152 |
-
* @return unknown
|
153 |
-
*/
|
154 |
-
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
155 |
-
{
|
156 |
-
return $this->_oService->removeSelection( $oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
157 |
-
}
|
158 |
-
|
159 |
-
|
160 |
-
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
161 |
-
{
|
162 |
-
return Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
163 |
-
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
164 |
-
}
|
165 |
-
|
166 |
-
public function selectAfter( $searchDate )
|
167 |
-
{
|
168 |
-
try
|
169 |
-
{
|
170 |
-
$rs = $this->_oService->selectAfter( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $searchDate ) );
|
171 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
172 |
-
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
173 |
-
}
|
174 |
-
catch( Inx_Api_RemoteException $x )
|
175 |
-
{
|
176 |
-
$this->_oSc->notify( $x );
|
177 |
-
return null;
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
|
182 |
-
public function selectBefore( $searchDate )
|
183 |
-
{
|
184 |
-
try
|
185 |
-
{
|
186 |
-
$rs = $this->_oService->selectBefore( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $searchDate ) );
|
187 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
188 |
-
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
189 |
-
catch( Inx_Api_RemoteException $x )
|
190 |
-
{
|
191 |
-
$this->_oSc->notify( $x );
|
192 |
-
return null;
|
193 |
-
}
|
194 |
-
}
|
195 |
-
|
196 |
-
|
197 |
-
public function selectBetween( $startDate, $stopDate )
|
198 |
-
{
|
199 |
-
try
|
200 |
-
{
|
201 |
-
$rs = $this->_oService->selectBetween( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $startDate ),
|
202 |
-
Inx_Apiimpl_TConvert::TConvert( $stopDate ) );
|
203 |
-
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
204 |
-
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
205 |
-
catch( Inx_Api_RemoteException $x )
|
206 |
-
{
|
207 |
-
$this->_oSc->notify( $x );
|
208 |
-
return null;
|
209 |
-
}
|
210 |
-
}
|
211 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
/**
|
6 |
+
* BlacklistManagerImpl
|
7 |
+
*
|
8 |
+
* @version $Revision: 9739 $ $Date: 2008-01-23 14:44:04 +0200 (Tr, 23 Sau 2008) $ $Author: aurimas $
|
9 |
+
*/
|
10 |
+
class Inx_Apiimpl_Blacklist_BlacklistManagerImpl implements Inx_Api_Blacklist_BlacklistManager, Inx_Apiimpl_Core_BOResultSetDelegate
|
11 |
+
{
|
12 |
+
|
13 |
+
protected $_oSc;
|
14 |
+
|
15 |
+
protected $_oService;
|
16 |
+
|
17 |
+
|
18 |
+
public function __construct( $oSc )
|
19 |
+
{
|
20 |
+
$this->_oSc = $oSc;
|
21 |
+
$this->_oService = $oSc->getService( Inx_Apiimpl_SessionContext::BLACKLIST_SERVICE );
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
public function createBlacklistEntry()
|
26 |
+
{
|
27 |
+
$blData = new stdClass();
|
28 |
+
$blData->id = null;
|
29 |
+
$blData->pattern = null;
|
30 |
+
$blData->hitCount = null;
|
31 |
+
return new Inx_Apiimpl_Blacklist_BlacklistEntryImpl( $this->_oSc, $blData);
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Enter description here...
|
37 |
+
*
|
38 |
+
* @param unknown_type $id
|
39 |
+
* @return unknown
|
40 |
+
*/
|
41 |
+
public function get( $id )
|
42 |
+
{
|
43 |
+
if (!is_int($id)) {
|
44 |
+
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
45 |
+
}
|
46 |
+
try
|
47 |
+
{
|
48 |
+
$entry = Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convert( $this->_oSc, $this->_oService->get( $this->_oSc->createCxt(), $id ) );
|
49 |
+
if( $entry === null )
|
50 |
+
throw new DataException( "blacklist entry deleted" );
|
51 |
+
return $entry;
|
52 |
+
}
|
53 |
+
catch( Inx_Api_RemoteException $e )
|
54 |
+
{
|
55 |
+
$this->_oSc->notify( $e );
|
56 |
+
return null;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Enter description here...
|
63 |
+
*
|
64 |
+
* @param int $id
|
65 |
+
* @return boolean
|
66 |
+
*/
|
67 |
+
public function remove( $id )
|
68 |
+
{
|
69 |
+
if (!is_int($id)) {
|
70 |
+
throw new Inx_Api_IllegalArgumentException('Integer parameter $id expected');
|
71 |
+
}
|
72 |
+
try
|
73 |
+
{
|
74 |
+
return $this->_oService->remove( $this->_oSc->createCxt(), $id );
|
75 |
+
}
|
76 |
+
catch( Inx_Api_RemoteException $e )
|
77 |
+
{
|
78 |
+
$this->_oSc->notify( $e );
|
79 |
+
return false;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Enter description here...
|
86 |
+
*
|
87 |
+
* @return Inx_Api_BOResultSet
|
88 |
+
*/
|
89 |
+
public function selectAll( $iOrderAttribute = null, $iOrderType = null )
|
90 |
+
{
|
91 |
+
if (isset($iOrderAttribute) && isset($iOrderType) && (!is_int($iOrderAttribute) || !is_int($iOrderType)))
|
92 |
+
{
|
93 |
+
throw new Inx_Api_IllegalArgumentException('Wrong parameters, integers expected');
|
94 |
+
}
|
95 |
+
|
96 |
+
if ($iOrderAttribute==null && $iOrderType === null) {
|
97 |
+
try
|
98 |
+
{
|
99 |
+
/**
|
100 |
+
* @var stdClass
|
101 |
+
*/
|
102 |
+
$rs = $this->_oService->selectAll( $this->_oSc->createCxt(), -1, -1 );
|
103 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
104 |
+
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
105 |
+
}
|
106 |
+
catch( Inx_Api_RemoteException $e )
|
107 |
+
{
|
108 |
+
$this->_oSc->notify( $e );
|
109 |
+
return null;
|
110 |
+
}
|
111 |
+
} else {
|
112 |
+
try
|
113 |
+
{
|
114 |
+
$rs = $this->_oService->selectAll( $this->_oSc->createCxt(), $iOrderAttribute, $iOrderType );
|
115 |
+
|
116 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
117 |
+
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
118 |
+
}
|
119 |
+
catch( Inx_Api_RemoteException $e )
|
120 |
+
{
|
121 |
+
$this->_oSc->notify( $e );
|
122 |
+
return null;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Enter description here...
|
130 |
+
*
|
131 |
+
* @param string $pattern
|
132 |
+
* @return Inx_Api_Blacklist_BlacklistEntry
|
133 |
+
*/
|
134 |
+
public function findByPattern( $pattern )
|
135 |
+
{
|
136 |
+
try
|
137 |
+
{
|
138 |
+
return Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convert( $this->_oSc, $this->_oService->findByPattern(
|
139 |
+
$this->_oSc->createCxt(), $pattern ) );
|
140 |
+
}
|
141 |
+
catch( Inx_Api_RemoteException $e )
|
142 |
+
{
|
143 |
+
$this->_oSc->notify( $e );
|
144 |
+
return null;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Enter description here...
|
151 |
+
*
|
152 |
+
* @return unknown
|
153 |
+
*/
|
154 |
+
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges )
|
155 |
+
{
|
156 |
+
return $this->_oService->removeSelection( $oResultSetRef->createCxt(), $oResultSetRef->refId(), $aIndexRanges );
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection )
|
161 |
+
{
|
162 |
+
return Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $oResultSetRef, $this->_oService->fetch(
|
163 |
+
$oResultSetRef->createCxt(), $oResultSetRef->refId(), $iIndex, $iDirection ) );
|
164 |
+
}
|
165 |
+
|
166 |
+
public function selectAfter( $searchDate )
|
167 |
+
{
|
168 |
+
try
|
169 |
+
{
|
170 |
+
$rs = $this->_oService->selectAfter( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $searchDate ) );
|
171 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
172 |
+
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) );
|
173 |
+
}
|
174 |
+
catch( Inx_Api_RemoteException $x )
|
175 |
+
{
|
176 |
+
$this->_oSc->notify( $x );
|
177 |
+
return null;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
public function selectBefore( $searchDate )
|
183 |
+
{
|
184 |
+
try
|
185 |
+
{
|
186 |
+
$rs = $this->_oService->selectBefore( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $searchDate ) );
|
187 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
188 |
+
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
189 |
+
catch( Inx_Api_RemoteException $x )
|
190 |
+
{
|
191 |
+
$this->_oSc->notify( $x );
|
192 |
+
return null;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
public function selectBetween( $startDate, $stopDate )
|
198 |
+
{
|
199 |
+
try
|
200 |
+
{
|
201 |
+
$rs = $this->_oService->selectBetween( $this->_oSc->createCxt(), Inx_Apiimpl_TConvert::TConvert( $startDate ),
|
202 |
+
Inx_Apiimpl_TConvert::TConvert( $stopDate ) );
|
203 |
+
return new Inx_Apiimpl_Core_DelegateBOResultSet( $this->_oSc, $this, $rs->remoteRefId, $rs->size,
|
204 |
+
Inx_Apiimpl_Blacklist_BlacklistEntryImpl::convertArr( $this->_oSc, $rs->data ) ); }
|
205 |
+
catch( Inx_Api_RemoteException $x )
|
206 |
+
{
|
207 |
+
$this->_oSc->notify( $x );
|
208 |
+
return null;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/AttrGetter.php
CHANGED
@@ -1,75 +1,75 @@
|
|
1 |
-
<?php
|
2 |
-
abstract class Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
3 |
-
{
|
4 |
-
public $typedIndex;
|
5 |
-
|
6 |
-
|
7 |
-
public static function create( Inx_Api_Recipient_Attribute $oAttr )
|
8 |
-
{
|
9 |
-
$g = null;
|
10 |
-
switch( $oAttr->getDataType() )
|
11 |
-
{
|
12 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN:
|
13 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_BooleanGetter();
|
14 |
-
break;
|
15 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_DATE:
|
16 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateGetter();
|
17 |
-
break;
|
18 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_DATETIME:
|
19 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateTimeGetter();
|
20 |
-
break;
|
21 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_DOUBLE:
|
22 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DoubleGetter();
|
23 |
-
break;
|
24 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER:
|
25 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_IntegerGetter();
|
26 |
-
break;
|
27 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_STRING:
|
28 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_StringGetter();
|
29 |
-
break;
|
30 |
-
case Inx_Api_Recipient_Attribute::DATA_TYPE_TIME:
|
31 |
-
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_TimeGetter();
|
32 |
-
break;
|
33 |
-
}
|
34 |
-
return $g;
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getDateTime( $oCurrentClick )
|
38 |
-
{
|
39 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
40 |
-
}
|
41 |
-
|
42 |
-
public function getTime( $oCurrentClick )
|
43 |
-
{
|
44 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
45 |
-
}
|
46 |
-
|
47 |
-
public function getString( $oCurrentClick )
|
48 |
-
{
|
49 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
50 |
-
}
|
51 |
-
|
52 |
-
public function getDouble( $oCurrentClick )
|
53 |
-
{
|
54 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
55 |
-
}
|
56 |
-
|
57 |
-
public function getDate( $oCurrentClick )
|
58 |
-
{
|
59 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
60 |
-
}
|
61 |
-
|
62 |
-
public abstract function getObject( $oData );
|
63 |
-
|
64 |
-
public function getInteger( $oData )
|
65 |
-
{
|
66 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
67 |
-
}
|
68 |
-
|
69 |
-
public function getBoolean( $oData )
|
70 |
-
{
|
71 |
-
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
}
|
1 |
+
<?php
|
2 |
+
abstract class Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
3 |
+
{
|
4 |
+
public $typedIndex;
|
5 |
+
|
6 |
+
|
7 |
+
public static function create( Inx_Api_Recipient_Attribute $oAttr )
|
8 |
+
{
|
9 |
+
$g = null;
|
10 |
+
switch( $oAttr->getDataType() )
|
11 |
+
{
|
12 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_BOOLEAN:
|
13 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_BooleanGetter();
|
14 |
+
break;
|
15 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_DATE:
|
16 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateGetter();
|
17 |
+
break;
|
18 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_DATETIME:
|
19 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateTimeGetter();
|
20 |
+
break;
|
21 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_DOUBLE:
|
22 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_DoubleGetter();
|
23 |
+
break;
|
24 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_INTEGER:
|
25 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_IntegerGetter();
|
26 |
+
break;
|
27 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_STRING:
|
28 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_StringGetter();
|
29 |
+
break;
|
30 |
+
case Inx_Api_Recipient_Attribute::DATA_TYPE_TIME:
|
31 |
+
$g = new Inx_Apiimpl_Bounce_BounceDelegateResultSet_TimeGetter();
|
32 |
+
break;
|
33 |
+
}
|
34 |
+
return $g;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getDateTime( $oCurrentClick )
|
38 |
+
{
|
39 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getTime( $oCurrentClick )
|
43 |
+
{
|
44 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getString( $oCurrentClick )
|
48 |
+
{
|
49 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getDouble( $oCurrentClick )
|
53 |
+
{
|
54 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getDate( $oCurrentClick )
|
58 |
+
{
|
59 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
60 |
+
}
|
61 |
+
|
62 |
+
public abstract function getObject( $oData );
|
63 |
+
|
64 |
+
public function getInteger( $oData )
|
65 |
+
{
|
66 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getBoolean( $oData )
|
70 |
+
{
|
71 |
+
throw new Inx_Api_IllegalStateException( "attribute type mismatch" );
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/BooleanGetter.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_BooleanGetter
|
3 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
-
{
|
5 |
-
public function getObject( $oData )
|
6 |
-
{
|
7 |
-
return $this->getBoolean( $oData );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getBoolean( $oData )
|
11 |
-
{
|
12 |
-
return Inx_Apiimpl_TConvert::convert( $oData->booleanData[$this->typedIndex] );
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_BooleanGetter
|
3 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
+
{
|
5 |
+
public function getObject( $oData )
|
6 |
+
{
|
7 |
+
return $this->getBoolean( $oData );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getBoolean( $oData )
|
11 |
+
{
|
12 |
+
return Inx_Apiimpl_TConvert::convert( $oData->booleanData[$this->typedIndex] );
|
13 |
+
}
|
14 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DateGetter.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateGetter
|
3 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
-
{
|
5 |
-
public function getObject( $oData )
|
6 |
-
{
|
7 |
-
return $this->getDate( $oData );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getDate( $oData )
|
11 |
-
{
|
12 |
-
return Inx_Apiimpl_TConvert::convert( $oData->dateData[$this->typedIndex] );
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateGetter
|
3 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
+
{
|
5 |
+
public function getObject( $oData )
|
6 |
+
{
|
7 |
+
return $this->getDate( $oData );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getDate( $oData )
|
11 |
+
{
|
12 |
+
return Inx_Apiimpl_TConvert::convert( $oData->dateData[$this->typedIndex] );
|
13 |
+
}
|
14 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DateTimeGetter.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateTimeGetter
|
3 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
-
{
|
5 |
-
public function getObject( $oData )
|
6 |
-
{
|
7 |
-
return $this->getDateTime( $oData );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getDateTime( $oData )
|
11 |
-
{
|
12 |
-
return Inx_Apiimpl_TConvert::convert( $oData->datetimeData[$this->typedIndex] );
|
13 |
-
}
|
14 |
-
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DateTimeGetter
|
3 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
+
{
|
5 |
+
public function getObject( $oData )
|
6 |
+
{
|
7 |
+
return $this->getDateTime( $oData );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getDateTime( $oData )
|
11 |
+
{
|
12 |
+
return Inx_Apiimpl_TConvert::convert( $oData->datetimeData[$this->typedIndex] );
|
13 |
+
}
|
14 |
+
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/DoubleGetter.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DoubleGetter
|
4 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
5 |
-
{
|
6 |
-
public function getObject( $oData )
|
7 |
-
{
|
8 |
-
return $this->getDouble( $oData );
|
9 |
-
}
|
10 |
-
|
11 |
-
public function getDouble( $oData )
|
12 |
-
{
|
13 |
-
return Inx_Apiimpl_TConvert::convert( $oData->doubleData[$this->typedIndex] );
|
14 |
-
}
|
15 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_DoubleGetter
|
4 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
5 |
+
{
|
6 |
+
public function getObject( $oData )
|
7 |
+
{
|
8 |
+
return $this->getDouble( $oData );
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getDouble( $oData )
|
12 |
+
{
|
13 |
+
return Inx_Apiimpl_TConvert::convert( $oData->doubleData[$this->typedIndex] );
|
14 |
+
}
|
15 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/IntegerGetter.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_IntegerGetter
|
4 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
5 |
-
{
|
6 |
-
public function getObject( $oData )
|
7 |
-
{
|
8 |
-
return $this->getInteger( $oData );
|
9 |
-
}
|
10 |
-
|
11 |
-
public function getInteger( $oData )
|
12 |
-
{
|
13 |
-
return Inx_Apiimpl_TConvert::convert( $oData->integerData[$this->typedIndex] );
|
14 |
-
}
|
15 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_IntegerGetter
|
4 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
5 |
+
{
|
6 |
+
public function getObject( $oData )
|
7 |
+
{
|
8 |
+
return $this->getInteger( $oData );
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getInteger( $oData )
|
12 |
+
{
|
13 |
+
return Inx_Apiimpl_TConvert::convert( $oData->integerData[$this->typedIndex] );
|
14 |
+
}
|
15 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/StringGetter.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_StringGetter
|
3 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
-
{
|
5 |
-
public function getObject( $oData )
|
6 |
-
{
|
7 |
-
return $this->getString( $oData );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getString( $oData )
|
11 |
-
{
|
12 |
-
return Inx_Apiimpl_TConvert::convert( $oData->stringData[$this->typedIndex] );
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_StringGetter
|
3 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
+
{
|
5 |
+
public function getObject( $oData )
|
6 |
+
{
|
7 |
+
return $this->getString( $oData );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getString( $oData )
|
11 |
+
{
|
12 |
+
return Inx_Apiimpl_TConvert::convert( $oData->stringData[$this->typedIndex] );
|
13 |
+
}
|
14 |
}
|
lib/Inx/Apiimpl/Bounce/BounceDelegateResultSet/TimeGetter.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_TimeGetter
|
3 |
-
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
-
{
|
5 |
-
public function getObject( $oData )
|
6 |
-
{
|
7 |
-
return $this->getTime( $oData );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getTime( $oData )
|
11 |
-
{
|
12 |
-
return Inx_Apiimpl_TConvert::convert( $oData->timeData[$this->typedIndex] );
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
class Inx_Apiimpl_Bounce_BounceDelegateResultSet_TimeGetter
|
3 |
+
extends Inx_Apiimpl_Bounce_BounceDelegateResultSet_AttrGetter
|
4 |
+
{
|
5 |
+
public function getObject( $oData )
|
6 |
+
{
|
7 |
+
return $this->getTime( $oData );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getTime( $oData )
|
11 |
+
{
|
12 |
+
return Inx_Apiimpl_TConvert::convert( $oData->timeData[$this->typedIndex] );
|
13 |
+
}
|
14 |
}
|
lib/Inx/Apiimpl/Constants.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
interface Inx_Apiimpl_Constants
|
4 |
-
{
|
5 |
-
|
6 |
-
const ID_UNSPECIFIED = 0;
|
7 |
-
|
8 |
-
const FETCH_FORWARD_DIRECTION = 1;
|
9 |
-
|
10 |
-
const FETCH_BACKWARD_DIRECTION = -1;
|
11 |
-
|
12 |
-
|
13 |
-
const SYSTEM_LIST_CONTEXT_ID = 1;
|
14 |
-
|
15 |
-
|
16 |
-
const SERVER_RUNTIME_EXCEPTION = "SERVER_RUNTIME_EXCEPTION";
|
17 |
-
|
18 |
-
const SERVER_INACTIVE_EXCEPTION = "SERVER_INACTIVE_EXCEPTION";
|
19 |
-
|
20 |
-
const ILLEGAL_SESSION_EXCEPTION = "ILLEGAL_SESSION_EXCEPTION";
|
21 |
-
|
22 |
-
const ILLEGAL_REFERENCE_EXCEPTION = "ILLEGAL_REFERENCE_EXCEPTION";
|
23 |
-
|
24 |
-
const SECURITY_EXCEPTION = "SECURITY_EXCEPTION";
|
25 |
-
|
26 |
-
const MEMORY_EXCEPTION = "MEMORY_EXCEPTION";
|
27 |
-
|
28 |
-
|
29 |
-
/**
|
30 |
-
* the array index of list type of list context bo
|
31 |
-
*/
|
32 |
-
const LIST_ATTR_LIST_TYPE = 0;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* the array index of list type of list context bo
|
36 |
-
*/
|
37 |
-
const LIST_ATTR_CREATION_DATETIME = 3;
|
38 |
-
|
39 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
interface Inx_Apiimpl_Constants
|
4 |
+
{
|
5 |
+
|
6 |
+
const ID_UNSPECIFIED = 0;
|
7 |
+
|
8 |
+
const FETCH_FORWARD_DIRECTION = 1;
|
9 |
+
|
10 |
+
const FETCH_BACKWARD_DIRECTION = -1;
|
11 |
+
|
12 |
+
|
13 |
+
const SYSTEM_LIST_CONTEXT_ID = 1;
|
14 |
+
|
15 |
+
|
16 |
+
const SERVER_RUNTIME_EXCEPTION = "SERVER_RUNTIME_EXCEPTION";
|
17 |
+
|
18 |
+
const SERVER_INACTIVE_EXCEPTION = "SERVER_INACTIVE_EXCEPTION";
|
19 |
+
|
20 |
+
const ILLEGAL_SESSION_EXCEPTION = "ILLEGAL_SESSION_EXCEPTION";
|
21 |
+
|
22 |
+
const ILLEGAL_REFERENCE_EXCEPTION = "ILLEGAL_REFERENCE_EXCEPTION";
|
23 |
+
|
24 |
+
const SECURITY_EXCEPTION = "SECURITY_EXCEPTION";
|
25 |
+
|
26 |
+
const MEMORY_EXCEPTION = "MEMORY_EXCEPTION";
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* the array index of list type of list context bo
|
31 |
+
*/
|
32 |
+
const LIST_ATTR_LIST_TYPE = 0;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* the array index of list type of list context bo
|
36 |
+
*/
|
37 |
+
const LIST_ATTR_CREATION_DATETIME = 3;
|
38 |
+
|
39 |
+
}
|
lib/Inx/Apiimpl/Core/BOResultSetDelegate.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* BOResultSetDelegate
|
5 |
-
*
|
6 |
-
* @version $Revision$ $Date$ $Author$
|
7 |
-
*/
|
8 |
-
interface Inx_Apiimpl_Core_BOResultSetDelegate
|
9 |
-
{
|
10 |
-
|
11 |
-
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges );
|
12 |
-
|
13 |
-
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection );
|
14 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BOResultSetDelegate
|
5 |
+
*
|
6 |
+
* @version $Revision$ $Date$ $Author$
|
7 |
+
*/
|
8 |
+
interface Inx_Apiimpl_Core_BOResultSetDelegate
|
9 |
+
{
|
10 |
+
|
11 |
+
public function removeBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $aIndexRanges );
|
12 |
+
|
13 |
+
public function fetchBOs( Inx_Apiimpl_RemoteRef $oResultSetRef, $iIndex, $iDirection );
|
14 |
+
}
|
lib/Inx/Apiimpl/Core/DelegateBOResultSet.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Inx_Apiimpl_Core_DelegateBOResultSet extends Inx_Apiimpl_Core_AbstractBOResultSet
|
4 |
-
{
|
5 |
-
private $_oDelegate;
|
6 |
-
|
7 |
-
|
8 |
-
public function __construct( Inx_Apiimpl_SessionContext $oSc, Inx_Apiimpl_Core_BOResultSetDelegate $oDelegate,
|
9 |
-
$sRemoteRefId, $iSize, $oFirstChunk )
|
10 |
-
{
|
11 |
-
parent::__construct( $oSc, $sRemoteRefId, $iSize, $oF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|