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


PHP ContactsModule::setMetadata方法代碼示例

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


在下文中一共展示了ContactsModule::setMetadata方法的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::setMetadata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。