本文整理汇总了PHP中MarketingList类的典型用法代码示例。如果您正苦于以下问题:PHP MarketingList类的具体用法?PHP MarketingList怎么用?PHP MarketingList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MarketingList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeAll
public function makeAll(&$demoDataHelper)
{
assert('$demoDataHelper instanceof DemoDataHelper');
assert('$demoDataHelper->isSetRange("MarketingList")');
$autoresponders = array();
if ($this->loadMagnitude >= 100) {
foreach (MarketingList::getAll() as $marketingList) {
for ($this->index = 0; $this->index < 2; $this->index++) {
$autoresponder = new Autoresponder();
$autoresponder->marketingList = $marketingList;
$this->populateModel($autoresponder);
$saved = $autoresponder->save();
assert('$saved');
$autoresponders[] = $autoresponder->id;
}
}
} else {
for ($this->index = 0; $this->index < 4; $this->index++) {
$autoresponder = new Autoresponder();
$autoresponder->marketingList = $demoDataHelper->getRandomByModelName('MarketingList');
$this->populateModel($autoresponder);
$saved = $autoresponder->save();
assert('$saved');
$autoresponders[] = $autoresponder->id;
}
}
$demoDataHelper->setRangeByModelName('Autoresponder', $autoresponders[0], $autoresponders[count($autoresponders) - 1]);
}
示例2: teardown
public function teardown()
{
$marketingLists = MarketingList::getAll();
$this->assertCount(1, $marketingLists);
$marketingLists[0]->delete();
parent::teardown();
}
示例3: populateAutoresponder
public static function populateAutoresponder($subject, $textContent, $htmlContent, $fromOperationDurationInterval, $operationType, $enableTracking = false, $marketingList = null)
{
assert('is_string($subject)');
assert('is_string($textContent)');
assert('is_string($htmlContent) || $htmlContent === null');
assert('is_int($fromOperationDurationInterval)');
assert('is_int($operationType)');
assert('is_bool($enableTracking) || is_int($enableTracking)');
assert('is_object($marketingList) || $marketingList === null');
if (empty($marketingList)) {
$marketingLists = MarketingList::getAll();
if (!empty($marketingLists)) {
$marketingList = RandomDataUtil::getRandomValueFromArray($marketingLists);
}
}
$autoresponder = new Autoresponder();
$autoresponder->subject = $subject;
$autoresponder->textContent = $textContent;
$autoresponder->htmlContent = $htmlContent;
$autoresponder->fromOperationDurationInterval = $fromOperationDurationInterval;
$autoresponder->fromOperationDurationType = TimeDurationUtil::DURATION_TYPE_DAY;
$autoresponder->operationType = $operationType;
$autoresponder->enableTracking = $enableTracking;
$autoresponder->marketingList = $marketingList;
return $autoresponder;
}
示例4: getStringifiedModelForValue
public function getStringifiedModelForValue()
{
if ($this->value != null) {
try {
return strval(MarketingList::getById((int) $this->value));
} catch (NotFoundException $e) {
}
}
}
示例5: setUp
public function setUp()
{
parent::setUp();
$this->user = User::getByUsername('super');
Yii::app()->user->userModel = $this->user;
Campaign::deleteAll();
CampaignItem::deleteAll();
Contact::deleteAll();
MarketingList::deleteAll();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:CampaignQueueMessagesInOutboxJobBenchmarkTest.php
示例6: populateCampaign
public static function populateCampaign($name, $subject, $textContent, $htmlContent = null, $fromName = null, $fromAddress = null, $supportsRichText = null, $status = null, $sendOnDateTime = null, $enableTracking = null, $marketingList = null)
{
assert('is_string($name)');
assert('is_string($subject)');
assert('is_string($textContent) || $textContent === null');
assert('is_string($htmlContent) || $htmlContent === null');
assert('is_string($fromName) || $fromName === null');
assert('is_string($fromAddress) || $fromAddress === null');
assert('is_bool($supportsRichText) || is_int($supportsRichText) || $supportsRichText === null');
assert('is_string($status) || is_int($status) || $status === null');
assert('is_string($sendOnDateTime) || is_int($sendOnDateTime) || $sendOnDateTime === null');
assert('is_bool($enableTracking) || is_int($enableTracking) || $enableTracking === null');
assert('is_object($marketingList) || $marketingList === null');
if ($supportsRichText === null) {
$supportsRichText = 1;
if ($htmlContent === null) {
$htmlContent = 'test html content';
}
}
if ($sendOnDateTime === null) {
$sendOnDateTime = '0000-00-00 00:00:00';
}
if ($status === null) {
$status = Campaign::STATUS_ACTIVE;
}
if ($enableTracking === null) {
$enableTracking = 1;
}
if ($fromName === null) {
$fromName = 'Support Team';
}
if ($fromAddress === null) {
$fromAddress = 'support@zurmo.com';
}
if (empty($marketingList)) {
$marketingLists = MarketingList::getAll();
if (!empty($marketingLists)) {
$marketingList = RandomDataUtil::getRandomValueFromArray($marketingLists);
}
}
$campaign = new Campaign();
$campaign->name = $name;
$campaign->subject = $subject;
$campaign->textContent = $textContent;
$campaign->htmlContent = $htmlContent;
$campaign->status = $status;
$campaign->fromName = $fromName;
$campaign->fromAddress = $fromAddress;
$campaign->supportsRichText = $supportsRichText;
$campaign->enableTracking = $enableTracking;
$campaign->sendOnDateTime = $sendOnDateTime;
$campaign->marketingList = $marketingList;
return $campaign;
}
示例7: actionCreate
public function actionCreate($marketingListId, $redirectUrl)
{
$autoresponder = new Autoresponder();
$autoresponder->marketingList = MarketingList::getById(intval($marketingListId));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($autoresponder->marketingList);
$model = $this->attemptToSaveModelFromPost($autoresponder, $redirectUrl);
$editAndDetailsView = $this->makeEditAndDetailsView($model, 'Edit');
$breadcrumbLinks = static::getDetailsAndEditBreadcrumbLinks($autoresponder->marketingList);
$breadcrumbLinks[] = Zurmo::t('AutorespondersModule', 'Create');
$view = new AutorespondersPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editAndDetailsView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
echo $view->render();
}
示例8: actionGenerateManageSubscriptionHash
/**
* Method for testing creating a simple notification for the current user.
*/
public function actionGenerateManageSubscriptionHash()
{
if (Yii::app()->user->userModel->username != 'super') {
throw new NotSupportedException();
}
$contact = RandomDataUtil::getRandomValueFromArray(Contact::getAll());
$personId = $contact->getClassId('Person');
$marketingList = RandomDataUtil::getRandomValueFromArray(MarketingList::getAll());
$marketingListId = $marketingList->id;
$model = RandomDataUtil::getRandomValueFromArray(CampaignItem::getAll());
$modelId = $model->id;
$modelType = get_class($model);
$hash = EmailMessageActivityUtil::resolveHashForUnsubscribeAndManageSubscriptionsUrls($personId, $marketingListId, $modelId, $modelType, false);
echo 'index.php/marketingLists/external/manageSubscriptions?hash=' . $hash;
}
示例9: actionGenerateManageSubscriptionHash
/**
* Method for testing creating a simple notification for the current user.
*/
public function actionGenerateManageSubscriptionHash()
{
if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
throw new NotSupportedException();
}
$contact = RandomDataUtil::getRandomValueFromArray(Contact::getAll());
$personId = $contact->getClassId('Person');
$marketingList = RandomDataUtil::getRandomValueFromArray(MarketingList::getAll());
$marketingListId = $marketingList->id;
$model = RandomDataUtil::getRandomValueFromArray(CampaignItem::getAll());
$modelId = $model->id;
$modelType = get_class($model);
$hash = GlobalMarketingFooterUtil::resolveHash($personId, $marketingListId, $modelId, $modelType, false);
echo 'index.php/marketingLists/external/manageSubscriptions?hash=' . $hash;
}
示例10: fillAutoresponder
public static function fillAutoresponder($name, $subject, $textContent, $htmlContent, $secondsFromOperation, $operationType, $marketingList = null)
{
if (empty($marketingList)) {
$marketingLists = MarketingList::getAll();
if (!empty($marketingLists)) {
$marketingList = RandomDataUtil::getRandomValueFromArray($marketingLists);
}
}
$autoresponder = new Autoresponder();
$autoresponder->name = $name;
$autoresponder->subject = $subject;
$autoresponder->textContent = $textContent;
$autoresponder->htmlContent = $htmlContent;
$autoresponder->secondsFromOperation = $secondsFromOperation;
$autoresponder->operationType = $operationType;
$autoresponder->marketingList = $marketingList;
return $autoresponder;
}
示例11: testCreateAndGetMarketingListMemberById
public function testCreateAndGetMarketingListMemberById()
{
$marketingList = RandomDataUtil::getRandomValueFromArray(MarketingList::getAll());
$this->assertNotNull($marketingList);
$contact = RandomDataUtil::getRandomValueFromArray(Contact::getAll());
$this->assertNotNull($contact);
$marketingListMember = new MarketingListMember();
$marketingListMember->unsubscribed = 0;
$marketingListMember->marketingList = $marketingList;
$marketingListMember->contact = $contact;
$this->assertTrue($marketingListMember->unrestrictedSave());
$id = $marketingListMember->id;
$this->assertTrue($id > 0);
unset($marketingListMember);
$marketingListMember = MarketingListMember::getById($id);
$this->assertEquals(0, $marketingListMember->unsubscribed);
$this->assertEquals($contact, $marketingListMember->contact);
$this->assertEquals($marketingList, $marketingListMember->marketingList);
}
示例12: makeAll
/**
* @param DemoDataHelper $demoDataHelper
*/
public function makeAll(&$demoDataHelper)
{
assert('$demoDataHelper instanceof DemoDataHelper');
assert('$demoDataHelper->isSetRange("User")');
$marketingLists = array();
for ($this->index = 0; $this->index < 5; $this->index++) {
$marketingList = new MarketingList();
$marketingList->owner = $demoDataHelper->getRandomByModelName('User');
$this->populateModel($marketingList);
$marketingList->addPermissions(Group::getByName(Group::EVERYONE_GROUP_NAME), Permission::READ_WRITE_CHANGE_PERMISSIONS_CHANGE_OWNER);
$saved = $marketingList->save();
assert('$saved');
$marketingList = MarketingList::getById($marketingList->id);
AllPermissionsOptimizationUtil::securableItemGivenPermissionsForGroup($marketingList, Group::getByName(Group::EVERYONE_GROUP_NAME));
$marketingList->save();
$marketingLists[] = $marketingList->id;
}
$demoDataHelper->setRangeByModelName('MarketingList', $marketingLists[0], $marketingLists[count($marketingLists) - 1]);
}
示例13: populateMarketingListMember
public static function populateMarketingListMember($unsubscribed = 0, $marketingList = null, $contact = null)
{
if (empty($marketingList)) {
$marketingLists = MarketingList::getAll();
if (!empty($marketingLists)) {
$marketingList = RandomDataUtil::getRandomValueFromArray($marketingLists);
}
}
if (empty($contact)) {
$contacts = Contact::getAll();
if (!empty($contacts)) {
$contact = RandomDataUtil::getRandomValueFromArray($contacts);
}
}
$marketingListMember = new MarketingListMember();
$marketingListMember->unsubscribed = $unsubscribed;
$marketingListMember->contact = $contact;
$marketingListMember->marketingList = $marketingList;
return $marketingListMember;
}
示例14: makeAll
/**
* @param DemoDataHelper $demoDataHelper
*/
public function makeAll(&$demoDataHelper)
{
assert('$demoDataHelper instanceof DemoDataHelper');
assert('$demoDataHelper->isSetRange("Contact")');
assert('$demoDataHelper->isSetRange("MarketingList")');
$members = array();
foreach (MarketingList::getAll() as $marketingList) {
foreach (Contact::getAll() as $contact) {
$interval = mt_rand(1, 30) * 86400;
$member = new MarketingListMember();
$member->setScenario('importModel');
$member->createdDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time() - $interval);
$member->contact = $contact;
$member->marketingList = $marketingList;
$this->populateModel($member);
$saved = $member->unrestrictedSave();
assert('$saved');
$members[] = $member->id;
}
}
$demoDataHelper->setRangeByModelName('MarketingListMember', $members[0], $members[count($members) - 1]);
}
示例15: makeColumnSqlQuery
/**
* @param string $beginDateTime
* @param array $searchAttributeData
* @return string
*/
protected static function makeColumnSqlQuery($beginDateTime, $searchAttributeData)
{
assert('is_string($beginDateTime)');
$quote = DatabaseCompatibilityUtil::getQuote();
$where = null;
$selectDistinct = false;
$marketingListTableName = MarketingList::getTableName();
$marketingListMemberTableName = MarketingListMember::getTableName();
$createdDateTimeColumnName = MarketingListMember::getColumnNameByAttribute('createdDateTime');
$unsubscribedColumnName = MarketingListMember::getColumnNameByAttribute('unsubscribed');
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('MarketingList');
$where = RedBeanModelDataProvider::makeWhere('MarketingList', $searchAttributeData, $joinTablesAdapter);
MarketingList::resolveReadPermissionsOptimizationToSqlQuery(Yii::app()->user->userModel, $joinTablesAdapter, $where, $selectDistinct);
$selectQueryAdapter = new RedBeanModelSelectQueryAdapter($selectDistinct);
$newSubscriberSelectPart = "sum(CASE WHEN {$quote}{$marketingListMemberTableName}{$quote}.{$quote}{$createdDateTimeColumnName}" . $quote . " >= '{$beginDateTime}' THEN 1 ELSE 0 END)";
$existingSubscriberSelectPart = "sum(CASE WHEN {$quote}{$marketingListMemberTableName}{$quote}.{$quote}{$createdDateTimeColumnName}" . $quote . " < '{$beginDateTime}' AND " . "{$quote}{$marketingListMemberTableName}{$quote}.{$quote}" . "{$unsubscribedColumnName}{$quote}=0 THEN 1 ELSE 0 END)";
// Not Coding Standard
$selectQueryAdapter->addClauseByQueryString($newSubscriberSelectPart, static::NEW_SUBSCRIBERS_COUNT);
$selectQueryAdapter->addClauseByQueryString($existingSubscriberSelectPart, static::EXISTING_SUBSCRIBERS_COUNT);
$joinTablesAdapter->addLeftTableAndGetAliasName($marketingListMemberTableName, 'id', $marketingListTableName, 'marketinglist_id');
$sql = SQLQueryUtil::makeQuery($marketingListTableName, $selectQueryAdapter, $joinTablesAdapter, null, null, $where);
return $sql;
}