当前位置: 首页>>代码示例>>PHP>>正文


PHP MarketingList类代码示例

本文整理汇总了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]);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:28,代码来源:AutorespondersDemoDataMaker.php

示例2: teardown

 public function teardown()
 {
     $marketingLists = MarketingList::getAll();
     $this->assertCount(1, $marketingLists);
     $marketingLists[0]->delete();
     parent::teardown();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:7,代码来源:MarketingListPerformanceChartDataProviderTest.php

示例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;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:26,代码来源:AutoresponderTestHelper.php

示例4: getStringifiedModelForValue

 public function getStringifiedModelForValue()
 {
     if ($this->value != null) {
         try {
             return strval(MarketingList::getById((int) $this->value));
         } catch (NotFoundException $e) {
         }
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:9,代码来源:MarketingListWorkflowActionAttributeForm.php

示例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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:54,代码来源:CampaignTestHelper.php

示例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();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:12,代码来源:DefaultController.php

示例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;
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:18,代码来源:DemoController.php

示例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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:18,代码来源:DemoController.php

示例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;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:18,代码来源:AutoresponderTestHelper.php

示例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);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:19,代码来源:MarketingListMemberTest.php

示例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]);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:22,代码来源:MarketingListsDemoDataMaker.php

示例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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:20,代码来源:MarketingListMemberTestHelper.php

示例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]);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:25,代码来源:MarketingListMembersDemoDataMaker.php

示例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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:28,代码来源:MarketingListGrowthChartDataProvider.php


注:本文中的MarketingList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。