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


PHP MarketingList::getAll方法代码示例

本文整理汇总了PHP中MarketingList::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP MarketingList::getAll方法的具体用法?PHP MarketingList::getAll怎么用?PHP MarketingList::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MarketingList的用法示例。


在下文中一共展示了MarketingList::getAll方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: testMarketingListDashboardGroupByActions

 public function testMarketingListDashboardGroupByActions()
 {
     $portlets = Portlet::getAll();
     foreach ($portlets as $portlet) {
         if ($portlet->viewType = 'MarketingListOverallMetrics') {
             $marketingListPortlet = $portlet;
         }
     }
     $marketingLists = MarketingList::getAll();
     $this->setGetArray(array('portletId' => $portlet->id, 'uniqueLayoutId' => 'MarketingListDetailsAndRelationsViewLeftBottomView', 'portletParams' => array('relationModelId' => $marketingLists[0]->id, 'relationModuleId' => 'marketingLists')));
     $this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_DAY)));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
     $this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_MONTH)));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
     $this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_WEEK)));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:17,代码来源:MarketingListDefaultControllerSuperUserWalkthroughTest.php

示例12: testSubscribeContactsForContactType

 public function testSubscribeContactsForContactType()
 {
     $type = 'contact';
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount3', $this->user);
     $contact = ContactTestHelper::createContactWithAccountByNameForOwner('superContact6', $this->user, $account);
     $contactId = $contact->id;
     $marketingList = RandomDataUtil::getRandomValueFromArray(MarketingList::getAll());
     $marketingListId = $marketingList->id;
     $this->setGetArray(array('marketingListId' => $marketingListId, 'id' => $contact->id, 'type' => $type));
     $content = $this->runControllerWithNoExceptionsAndGetContent('marketingLists/defaultPortlet/subscribeContacts');
     $contentArray = CJSON::decode($content);
     $this->assertNotEmpty($contentArray);
     $this->assertArrayHasKey('type', $contentArray);
     $this->assertArrayHasKey('message', $contentArray);
     $this->assertEquals('1 subscribed.', $contentArray['message']);
     $this->assertEquals('message', $contentArray['type']);
     $content = $this->runControllerWithNoExceptionsAndGetContent('marketingLists/defaultPortlet/subscribeContacts');
     $contentArray = CJSON::decode($content);
     $this->assertNotEmpty($contentArray);
     $this->assertArrayHasKey('type', $contentArray);
     $this->assertArrayHasKey('message', $contentArray);
     $this->assertEquals('0 subscribed. 1 skipped, already in the list.', $contentArray['message']);
     $this->assertEquals('message', $contentArray['type']);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:24,代码来源:MarketingListDefaultPortletControllerSuperUserWalkthroughTest.php

示例13: testDeleteMarketingList

 /**
  * @depends testCreateAndGetMarketingListById
  */
 public function testDeleteMarketingList()
 {
     $marketingLists = MarketingList::getAll();
     $this->assertEquals(2, count($marketingLists));
     $marketingLists[0]->delete();
     $marketingLists = MarketingList::getAll();
     $this->assertEquals(1, count($marketingLists));
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:MarketingListTest.php

示例14: testDeleteMarketingList

 /**
  * @depends testCreateAndGetMarketingListById
  */
 public function testDeleteMarketingList()
 {
     $marketingLists = MarketingList::getAll();
     $this->assertCount(2, $marketingLists);
     $marketingListId = $marketingLists[0]->id;
     MarketingListMemberTestHelper::createMarketingListMember(0, $marketingLists[0]);
     MarketingListMemberTestHelper::createMarketingListMember(0, $marketingLists[0]);
     MarketingListMemberTestHelper::createMarketingListMember(0, $marketingLists[1]);
     MarketingListMemberTestHelper::createMarketingListMember(0, $marketingLists[1]);
     AutoresponderTestHelper::createAutoresponder('subject 01', 'text content', 'html content', 1, Autoresponder::OPERATION_SUBSCRIBE, true, $marketingLists[0]);
     AutoresponderTestHelper::createAutoresponder('subject 02', 'text content', 'html content', 1, Autoresponder::OPERATION_SUBSCRIBE, true, $marketingLists[1]);
     $autoresponders = Autoresponder::getByOperationTypeAndMarketingListId(Autoresponder::OPERATION_SUBSCRIBE, $marketingListId);
     $this->assertCount(1, $autoresponders);
     $this->assertEquals(2, Autoresponder::getCount());
     $marketingListMembersCount = MarketingListMember::getCountByMarketingListIdAndUnsubscribed($marketingListId, 0);
     $this->assertEquals(2, $marketingListMembersCount);
     $marketingLists[0]->forgetAll();
     $marketingLists = MarketingList::getAll();
     $marketingLists[0]->delete();
     $marketingLists = MarketingList::getAll();
     $this->assertCount(1, $marketingLists);
     $autoresponders = Autoresponder::getByOperationTypeAndMarketingListId(Autoresponder::OPERATION_SUBSCRIBE, $marketingListId);
     $this->assertCount(0, $autoresponders);
     $this->assertEquals(1, Autoresponder::getCount());
     $marketingListMembersCount = MarketingListMember::getCountByMarketingListIdAndUnsubscribed($marketingListId, 0);
     $this->assertEquals(0, $marketingListMembersCount);
     $this->assertEquals(2, MarketingListMember::getCount());
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:31,代码来源:MarketingListTest.php


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