当前位置: 首页>>代码示例>>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;未经允许,请勿转载。