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


PHP ContactsModule::getMetadata方法代码示例

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


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

示例1: loadStartingData

 /**
  * Used on first load to install ContactState data
  * and the startingState for the Contacts module.
  * @return true/false if data was in fact loaded.
  */
 public static function loadStartingData()
 {
     if (count(ContactState::GetAll()) != 0) {
         return false;
     }
     $data = array(Zurmo::t('Core', 'New'), Zurmo::t('Core', 'In Progress'), Zurmo::t('ContactsModule', 'Recycled'), Zurmo::t('ContactsModule', 'Dead'), Zurmo::t('ContactsModule', 'Qualified'), Zurmo::t('ZurmoModule', 'Customer'));
     $order = 0;
     $startingStateId = null;
     foreach ($data as $stateName) {
         $state = new ContactState();
         $state->name = $stateName;
         $state->order = $order;
         $saved = $state->save();
         assert('$saved');
         if ($stateName == Zurmo::t('ContactsModule', 'Qualified')) {
             $startingStateId = $state->id;
         }
         $order++;
     }
     if ($startingStateId == null) {
         throw new NotSupportedException();
     }
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['startingStateId'] = $startingStateId;
     ContactsModule::setMetadata($metadata);
     assert('count(ContactState::GetAll()) == 6');
     return true;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:33,代码来源:ContactsModule.php

示例2: setStartingStateById

 public static function setStartingStateById($startingStateId)
 {
     assert('is_int($startingStateId)');
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['startingStateId'] = $startingStateId;
     ContactsModule::setMetadata($metadata);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:7,代码来源:ContactsUtil.php

示例3: testLeadsStateMetadataAdapterWithNoStates

 public function testLeadsStateMetadataAdapterWithNoStates()
 {
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['startingStateId'] = LeadsUtil::getStartingState()->id;
     ContactsModule::setMetadata($metadata);
     $adapter = new LeadsStateMetadataAdapter(array('clauses' => array(), 'structure' => ''));
     $adaptedMetadata = $adapter->getAdaptedDataProviderMetadata();
     $compareMetadata = array('clauses' => array(1 => array('attributeName' => 'state', 'operatorType' => 'equals', 'value' => '-1')), 'structure' => '(1)');
     $this->assertEquals($compareMetadata, $adaptedMetadata);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:LeadTest.php

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

示例5: testUpdateLatestActivityDateTimeMethods

 public function testUpdateLatestActivityDateTimeMethods()
 {
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast();
     $this->assertTrue($value);
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['updateLatestActivityDateTimeWhenATaskIsCompleted'] = false;
     ContactsModule::setMetadata($metadata);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast();
     $this->assertTrue($value);
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['updateLatestActivityDateTimeWhenANoteIsCreated'] = false;
     ContactsModule::setMetadata($metadata);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived();
     $this->assertTrue($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast();
     $this->assertTrue($value);
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived'] = false;
     ContactsModule::setMetadata($metadata);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast();
     $this->assertTrue($value);
     $metadata = ContactsModule::getMetadata();
     $metadata['global']['updateLatestActivityDateTimeWhenAMeetingIsInThePast'] = false;
     ContactsModule::setMetadata($metadata);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived();
     $this->assertFalse($value);
     $value = ContactsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast();
     $this->assertFalse($value);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:55,代码来源:ContactsModuleTest.php


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