當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById方法代碼示例

本文整理匯總了PHP中ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById方法的具體用法?PHP ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById怎麽用?PHP ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ContactsUtil的用法示例。


在下文中一共展示了ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeActiveCustomerEmailList

 public static function makeActiveCustomerEmailList()
 {
     $contactStateIdsAndNames = ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById();
     $report = new Report();
     $report->setDescription('A report showing active customers who have not opted out of receiving emails');
     $report->setModuleClassName('ContactsModule');
     $report->setName('Active Customer Email List');
     $report->setType(Report::TYPE_ROWS_AND_COLUMNS);
     $report->setOwner(Yii::app()->user->userModel);
     $report->setFiltersStructure('1 AND 2 AND 3');
     $report->setCurrencyConversionType(Report::CURRENCY_CONVERSION_TYPE_BASE);
     $filter = new FilterForReportForm('ContactsModule', 'Contact', $report->getType());
     $filter->attributeIndexOrDerivedType = 'account___type';
     $filter->value = 'Customer';
     $filter->operator = OperatorRules::TYPE_EQUALS;
     $report->addFilter($filter);
     $filter = new FilterForReportForm('ContactsModule', 'Contact', $report->getType());
     $filter->attributeIndexOrDerivedType = 'state';
     $filter->value = array_keys($contactStateIdsAndNames);
     $filter->operator = OperatorRules::TYPE_ONE_OF;
     $report->addFilter($filter);
     $filter = new FilterForReportForm('ContactsModule', 'Contact', $report->getType());
     $filter->attributeIndexOrDerivedType = 'primaryEmail___optOut';
     $filter->value = false;
     $filter->operator = OperatorRules::TYPE_EQUALS;
     $report->addFilter($filter);
     $displayAttribute = new DisplayAttributeForReportForm('ContactsModule', 'Contact', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'FullName';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('ContactsModule', 'Contact', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'account___name';
     $displayAttribute->label = 'Account Name';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('ContactsModule', 'Contact', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'primaryEmail___emailAddress';
     $report->addDisplayAttribute($displayAttribute);
     $savedReport = new SavedReport();
     SavedReportToReportAdapter::resolveReportToSavedReport($report, $savedReport);
     //set explicit
     $saved = $savedReport->save();
     assert('$saved');
     $explicitReadWriteModelPermissions = ExplicitReadWriteModelPermissionsUtil::makeBySecurableItem($savedReport);
     $explicitReadWriteModelPermissions->addReadWritePermitable(Group::getByName(Group::EVERYONE_GROUP_NAME));
     $success = ExplicitReadWriteModelPermissionsUtil::resolveExplicitReadWriteModelPermissions($savedReport, $explicitReadWriteModelPermissions);
     assert('$success');
     $saved = $savedReport->save();
     assert('$saved');
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:48,代碼來源:ReportsDemoDataMaker.php

示例2: resolveStates

 protected function resolveStates()
 {
     return ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById();
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:4,代碼來源:ContactStateSanitizerUtil.php

示例3: testContactStateAdapterReturnsCorrectStatesUponStartingStateChange

 public function testContactStateAdapterReturnsCorrectStatesUponStartingStateChange()
 {
     $this->assertEquals(7, count(ContactState::GetAll()));
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['startingStateId'] = ContactsUtil::getStartingState()->id;
     ContactsModule::setMetadata($metadata);
     $metadata = array('clauses' => array(), 'structure' => '');
     $adapter = new ContactsStateMetadataAdapter($metadata);
     $adaptedMetadata = $adapter->getAdaptedDataProviderMetadata();
     $statesToInclude = ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById();
     $this->assertEquals(7, count($statesToInclude));
     $compareMetadata['clauses'] = array();
     $compareMetadata['structure'] = '(1 or 2 or 3 or 4 or 5 or 6 or 7)';
     $index = 1;
     foreach ($statesToInclude as $stateId => $notUsed) {
         $compareMetadata['clauses'][$index] = array('attributeName' => 'state', 'operatorType' => 'equals', 'value' => $stateId);
         $index++;
     }
     $this->assertEquals($compareMetadata, $adaptedMetadata);
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:20,代碼來源:ContactTest.php


注:本文中的ContactsUtil::getContactStateDataFromStartingStateOnAndKeyedById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。