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


PHP Contact::getAll方法代码示例

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


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

示例1: testSuperUserThatContactsAndLeadsShowZeroModelUserInterfaceCorrectly

 public function testSuperUserThatContactsAndLeadsShowZeroModelUserInterfaceCorrectly()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     $this->assertEquals(0, count(Contact::getAll()));
     //At this point the zero model ui should show up for contacts and leads
     $content = $this->runControllerWithNoExceptionsAndGetContent('contacts/default/list');
     $this->assertFalse(strpos($content, 'Arthur Conan') === false);
     $content = $this->runControllerWithNoExceptionsAndGetContent('leads/default/list');
     $this->assertFalse(strpos($content, 'Thomas Paine') === false);
     $contact = ContactTestHelper::createContactByNameForOwner('Jimmy', $super);
     //At this point leads should still show the zero model message
     $content = $this->runControllerWithNoExceptionsAndGetContent('contacts/default/list');
     $this->assertTrue(strpos($content, 'Arthur Conan') === false);
     $content = $this->runControllerWithNoExceptionsAndGetContent('leads/default/list');
     $this->assertFalse(strpos($content, 'Thomas Paine') === false);
     $this->assertTrue($contact->delete());
     $this->assertEquals(0, count(Contact::getAll()));
     //Create lead.
     $lead = LeadTestHelper::createLeadByNameForOwner('Jammy', $super);
     //At this point contacts should still show the zero model message
     $content = $this->runControllerWithNoExceptionsAndGetContent('contacts/default/list');
     $this->assertFalse(strpos($content, 'Arthur Conan') === false);
     $content = $this->runControllerWithNoExceptionsAndGetContent('leads/default/list');
     $this->assertTrue(strpos($content, 'Thomas Paine') === false);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:25,代码来源:ContactsSuperUserZeroModelsWalkthroughTest.php

示例2: populateAutoresponderItem

 public static function populateAutoresponderItem($processed, $processDateTime, $autoresponder = null, $contact = null)
 {
     assert('is_string($processed) || is_int($processed)');
     assert('is_string($processDateTime)');
     assert('is_object($autoresponder) || $autoresponder === null');
     assert('is_object($contact) || $contact === null');
     if (empty($autoresponder)) {
         $autoresponders = Autoresponder::getAll();
         if (!empty($autoresponders)) {
             $autoresponder = RandomDataUtil::getRandomValueFromArray($autoresponders);
         }
     }
     if (empty($contact)) {
         $contacts = Contact::getAll();
         if (!empty($contacts)) {
             $contact = RandomDataUtil::getRandomValueFromArray($contacts);
         }
     }
     $autoresponderItem = new AutoresponderItem();
     $autoresponderItem->processed = $processed;
     $autoresponderItem->processDateTime = $processDateTime;
     $autoresponderItem->autoresponder = $autoresponder;
     $autoresponderItem->contact = $contact;
     return $autoresponderItem;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:25,代码来源:AutoresponderItemTestHelper.php

示例3: testUnlinkContactForAccount

 public function testUnlinkContactForAccount()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     $simpleUser = User::getByUsername('simpleUser');
     Yii::app()->user->userModel = $simpleUser;
     $simpleUser->setRight('AccountsModule', AccountsModule::RIGHT_ACCESS_ACCOUNTS);
     $simpleUser->setRight('AccountsModule', AccountsModule::RIGHT_CREATE_ACCOUNTS);
     $simpleUser->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
     $simpleUser->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
     $this->assertTrue($simpleUser->save());
     $account = AccountTestHelper::createAccountByNameForOwner('simpleUserAccount', $simpleUser);
     $contact = ContactTestHelper::createContactWithAccountByNameForOwner('simpleUserContact', $simpleUser, $account);
     $accounts = Account::getAll();
     $this->assertEquals(1, count($accounts));
     $contacts = Contact::getAll();
     $this->assertEquals(1, count($contacts));
     $superAccountId = self::getModelIdByModelNameAndName('Account', 'simpleUserAccount');
     $this->setGetArray(array('id' => $superAccountId));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('accounts/default/details');
     $contactId = self::getModelIdByModelNameAndName('Contact', 'simpleUserContact simpleUserContactson');
     //unlinking the contact
     $this->setGetArray(array('id' => $contactId, 'relationModelClassName' => 'Account', 'relationModelId' => $superAccountId, 'relationModelRelationName' => 'contacts'));
     $content = $this->runControllerWithNoExceptionsAndGetContent('contacts/default/unlink', true);
     $accounts = Account::getAll();
     $this->assertEquals(1, count($accounts));
     $contacts = Contact::getAll();
     $contactId = $contacts[0]->id;
     $contacts[0]->forget();
     $contact = Contact::getById($contactId);
     $this->assertTrue($contact->account->id < 0);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:32,代码来源:AccountsRegularUserUnlinkWalkthroughTest.php

示例4: testAdditionOfPortletsInEmptyRightPanel

 public function testAdditionOfPortletsInEmptyRightPanel()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     $superLeadId = self::getModelIdByModelNameAndName('Contact', 'superLead superLeadson');
     $marketingListId = self::getModelIdByModelNameAndName('MarketingList', 'MarketingListName');
     $leads = Contact::getAll();
     $this->assertEquals(1, count($leads));
     //Load Model Detail Views
     $this->setGetArray(array('id' => $superLeadId, 'lockPortlets' => '0'));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('leads/default/details');
     $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition('LeadDetailsAndRelationsView', $super->id, array());
     $this->assertEquals(3, count($portlets[1]));
     $this->assertFalse(array_key_exists(3, $portlets));
     $this->assertEquals(2, count($portlets[2]));
     foreach ($portlets[2] as $position => $portlet) {
         $portlet->delete();
     }
     $this->setGetArray(array('modelId' => $superLeadId, 'uniqueLayoutId' => 'LeadDetailsAndRelationsView', 'portletType' => 'MarketingListsForContactRelatedList', 'redirect' => '0'));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('leads/defaultPortlet/add', true);
     $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition('LeadDetailsAndRelationsView', $super->id, array());
     $this->assertEquals(1, count($portlets[2]));
     //Test subscribe to list link
     $portlet = $portlets[2][1];
     $this->setGetArray(array('portletId' => $portlet->id, 'relationAttributeName' => 'lead', 'relationModelId' => $superLeadId, 'relationModuleId' => 'leads', 'uniqueLayoutId' => $portlet->getUniquePortletPageId(), 'relationModelClassName' => null));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('marketingLists/default/selectFromRelatedList');
     //Test subscribe a marketing list
     $this->setGetArray(array('modelId' => $marketingListId, 'portletId' => $portlet->id, 'relationAttributeName' => 'lead', 'relationModelId' => $superLeadId, 'relationModuleId' => 'leads', 'uniqueLayoutId' => $portlet->getUniquePortletPageId(), 'relationModelClassName' => null));
     $this->resetPostArray();
     $content = $this->runControllerWithRedirectExceptionAndGetContent('marketingLists/defaultPortlet/selectFromRelatedListSave');
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:33,代码来源:LeadDetailsAndRelationsPortletViewTest.php

示例5: indexAction

 public function indexAction()
 {
     $this->view->Title = "Danh sách đặt hàng";
     $this->view->headTitle($this->view->Title);
     $page = $this->getRequest()->getParam('page');
     $condition = array();
     list($this->view->Pager, $this->view->Contact) = Contact::getAll($condition, $page);
 }
开发者ID:hoaitn,项目名称:base-zend,代码行数:8,代码来源:ContactController.php

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

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

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

示例9: fillAutoresponderItem

 public static function fillAutoresponderItem($processed, $processDateTime, $autoresponder = null, $contact = null)
 {
     if (empty($autoresponder)) {
         $autoresponders = Autoresponder::getAll();
         if (!empty($autoresponders)) {
             $autoresponder = RandomDataUtil::getRandomValueFromArray($autoresponders);
         }
     }
     if (empty($contact)) {
         $contacts = Contact::getAll();
         if (!empty($contacts)) {
             $contact = RandomDataUtil::getRandomValueFromArray($contacts);
         }
     }
     $autoresponderItem = new AutoresponderItem();
     $autoresponderItem->processed = $processed;
     $autoresponderItem->processDateTime = $processDateTime;
     $autoresponderItem->autoresponder = $autoresponder;
     $autoresponderItem->contact = $contact;
     return $autoresponderItem;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:21,代码来源:AutoresponderItemTestHelper.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: populateCampaignItem

 public static function populateCampaignItem($processed, $campaign = null, $contact = null)
 {
     assert('is_bool($processed)');
     assert('is_object($campaign) || $campaign === null');
     assert('is_object($contact) || $contact === null');
     if (empty($campaign)) {
         $campaigns = Campaign::getAll();
         if (!empty($campaigns)) {
             $campaign = RandomDataUtil::getRandomValueFromArray($campaigns);
         }
     }
     if (empty($contact)) {
         $contacts = Contact::getAll();
         if (!empty($contacts)) {
             $contact = RandomDataUtil::getRandomValueFromArray($contacts);
         }
     }
     $campaignItem = new CampaignItem();
     $campaignItem->processed = $processed;
     $campaignItem->campaign = $campaign;
     $campaignItem->contact = $contact;
     return $campaignItem;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:23,代码来源:CampaignItemTestHelper.php

示例12: indexAction

 public function indexAction()
 {
     $this->view->Title = "Contact list";
     $this->view->headTitle($this->view->Title);
     if ($this->getRequest()->getParam('contact_type')) {
         $params = $this->getRequest()->getParam('contact_type', 'List All');
         if ($params != 'List All') {
             $condition = array('contact_type =?' => $params);
             $_SESSION['contact_type'] = $params;
         } else {
             $condition = array();
             $this->view->contact_type = 'List All';
             $_SESSION['contact_type'] = 'List All';
         }
         $page = $this->getRequest()->getParam('page');
         list($this->view->Pager, $this->view->Contact) = Contact::getAll($condition, $page);
     } else {
         $page = $this->getRequest()->getParam('page');
         $condition = array();
         list($this->view->Pager, $this->view->Contact) = Contact::getAll($condition, $page);
         $_SESSION['contact_type'] = 'List All';
     }
 }
开发者ID:hoaitn,项目名称:base-zend,代码行数:23,代码来源:ContactController.php

示例13: testAccountAndContactIndustries

 public function testAccountAndContactIndustries()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     $values = array('Automotive', 'Adult Entertainment', 'Financial Services', 'Mercenaries & Armaments');
     $industryFieldData = CustomFieldData::getByName('Industries');
     $industryFieldData->defaultValue = $values[0];
     $industryFieldData->serializedData = serialize($values);
     $this->assertTrue($industryFieldData->save());
     unset($industryFieldData);
     $user = UserTestHelper::createBasicUser('Billy');
     $account = new Account();
     $account->name = 'Consoladores-R-Us';
     $account->owner = $user;
     $data = unserialize($account->industry->data->serializedData);
     $this->assertEquals('Automotive', $account->industry->value);
     $account->industry->value = $values[1];
     $this->assertTrue($account->save());
     unset($account);
     ContactsModule::loadStartingData();
     $states = ContactState::GetAll();
     $contact = new Contact();
     $contact->firstName = 'John';
     $contact->lastName = 'Johnson';
     $contact->owner = $user;
     $contact->state = $states[0];
     $values = unserialize($contact->industry->data->serializedData);
     $this->assertEquals(4, count($values));
     $contact->industry->value = $values[3];
     $this->assertTrue($contact->save());
     unset($contact);
     $accounts = Account::getByName('Consoladores-R-Us');
     $account = $accounts[0];
     $this->assertEquals('Adult Entertainment', $account->industry->value);
     $contacts = Contact::getAll();
     $contact = $contacts[0];
     $this->assertEquals('Mercenaries & Armaments', $contact->industry->value);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:37,代码来源:CustomFieldsTest.php

示例14: testGetChartData

 /**
  * @dataProvider dataForTestGetChartData
  */
 public function testGetChartData($activityCreationArray, $emailMessageSentDateTime, $isMultiplierOn)
 {
     $contacts = Contact::getAll();
     $this->addCampaignItem($contacts[0], $emailMessageSentDateTime, $activityCreationArray);
     $this->addAutoresponderItem($contacts[0], $emailMessageSentDateTime, $activityCreationArray);
     if ($isMultiplierOn) {
         $this->addCampaignItem($contacts[1], $emailMessageSentDateTime, $activityCreationArray);
         $this->addAutoresponderItem($contacts[1], $emailMessageSentDateTime, $activityCreationArray);
     }
     $isSent = true;
     if (!isset($emailMessageSentDateTime)) {
         $emailMessageSentDateTime = date('Y-m-d');
         $isSent = false;
     }
     //Test when beginDate < sentDate < endDate
     //Grouping by day
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'between', MarketingOverallMetricsForm::GROUPING_TYPE_DAY, $isSent, $isMultiplierOn);
     //Grouping by week
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'between', MarketingOverallMetricsForm::GROUPING_TYPE_WEEK, $isSent, $isMultiplierOn);
     //Grouping by month
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'between', MarketingOverallMetricsForm::GROUPING_TYPE_MONTH, $isSent, $isMultiplierOn);
     //Test when beginDate < endDate < sentDate
     //Grouping by day
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'after', MarketingOverallMetricsForm::GROUPING_TYPE_DAY, $isSent, $isMultiplierOn);
     //Grouping by week
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'after', MarketingOverallMetricsForm::GROUPING_TYPE_WEEK, $isSent, $isMultiplierOn);
     //Grouping by month
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'after', MarketingOverallMetricsForm::GROUPING_TYPE_MONTH, $isSent, $isMultiplierOn);
     //Test when sentDate < beginDate < endDate
     //Grouping by day
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'before', MarketingOverallMetricsForm::GROUPING_TYPE_DAY, $isSent, $isMultiplierOn);
     //Grouping by week
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'before', MarketingOverallMetricsForm::GROUPING_TYPE_WEEK, $isSent, $isMultiplierOn);
     //Grouping by month
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'before', MarketingOverallMetricsForm::GROUPING_TYPE_MONTH, $isSent, $isMultiplierOn);
     //Test when sentDate = beginDate = endDate
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'equals', MarketingOverallMetricsForm::GROUPING_TYPE_DAY, $isSent, $isMultiplierOn);
     //Grouping by week
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'equals', MarketingOverallMetricsForm::GROUPING_TYPE_WEEK, $isSent, $isMultiplierOn);
     //Grouping by month
     $this->assertChartDataAsExpectedBySentTimeAndConditionAndGroupingBy($activityCreationArray, $emailMessageSentDateTime, 'equals', MarketingOverallMetricsForm::GROUPING_TYPE_MONTH, $isSent, $isMultiplierOn);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:45,代码来源:MarketingEmailsInThisListChartDataProviderTest.php

示例15: array

<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/contact.php";
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
session_start();
if (empty($_SESSION['list_of_contacts'])) {
    $_SESSION['list_of_contacts'] = array();
}
$app->get("/", function () use($app) {
    return $app['twig']->render('home.html.twig', array('all_contacts' => Contact::getAll()));
});
$app->post("/create_contact", function () use($app) {
    $my_contact = new Contact($_POST['name'], $_POST['phone'], $_POST['address']);
    $my_contact->save();
    return $app['twig']->render('create_contact.html.twig', array('new_contact' => $my_contact));
});
$app->post("/delete_contacts", function () use($app) {
    $_SESSION['list_of_contacts'] = array();
    return $app['twig']->render('delete_contacts.html.twig');
});
return $app;
开发者ID:jwuerch,项目名称:Address-Book-PHP,代码行数:23,代码来源:app.php


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