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


PHP LogicHook::refreshHooks方法代碼示例

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


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

示例1: testrefreshHooks

 public function testrefreshHooks()
 {
     //execute the method and test if it doesn't throws an exception
     try {
         LogicHook::refreshHooks();
         $this->assertTrue(true);
     } catch (Exception $e) {
         $this->fail();
     }
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:10,代碼來源:LogicHookTest.php

示例2: tearDown

 public function tearDown()
 {
     foreach ($this->renames as $file) {
         rename($file . ".bak", $file);
     }
     foreach ($this->deletes as $file) {
         unlink($file);
     }
     unset($GLOBALS['logic_hook']);
     LogicHook::refreshHooks();
 }
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:11,代碼來源:Bug46850Test.php

示例3: setUp

 public function setUp()
 {
     $this->user = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user'] = $this->user;
     //Setup logichook files
     if (file_exists($this->casesHookFile)) {
         $this->hasCustomCasesLogicHookFile = true;
         copy($this->casesHookFile, $this->casesHookFile . '.bak');
     }
     $hook_array['after_relationship_add'][] = array(1, 'Cases increment count', $this->casesCountFile, 'CaseCount', 'countMe');
     write_array_to_file("hook_array", $hook_array, $this->casesHookFile);
     $this->useOutputBuffering = false;
     LogicHook::refreshHooks();
     //now  write out the script that the logichook executes.  This will keep track of times called
     global $hookRunCount;
     $hookRunCount = 0;
     $fileCont = '<?php class CaseCount {
         function countMe($bean, $event, $arguments){
             global $hookRunCount;
             if($event =="after_relationship_add" && $arguments["module"]=="Cases" && $arguments["related_module"]=="Emails")
                 $hookRunCount++;
             }}?>';
     file_put_contents($this->casesCountFile, $fileCont);
     //setup test account for case
     $this->account = new Account();
     $this->account->name = 'test account for bug 39855';
     $this->account->assigned_user_id = 'SugarUser';
     $this->account->save();
     //create case
     $this->case = new aCase();
     $this->case->name = 'test case for unitTest 49784';
     $this->case->account_id = $this->account->id;
     $this->case->status = 'New';
     $this->case->save();
     //retrieve so we have latest info (case number)
     $this->case->retrieve($this->case->id);
     //create email with case in subject
     $this->email = new Email();
     $this->email->type = 'inbound';
     $this->email->status = 'unread';
     $this->email->from_addr_name = $this->email->cleanEmails("sender@domain.eu");
     $this->email->to_addrs_names = $this->email->cleanEmails("to@domain.eu");
     $this->email->cc_addrs_names = $this->email->cleanEmails("cc@domain.eu");
     $this->email->name = 'RE: [CASE:' . $this->case->case_number . '] ' . $this->case->name;
     $this->email->save();
 }
開發者ID:jgera,項目名稱:sugarcrm_dev,代碼行數:46,代碼來源:Bug49784Test.php

示例4: setUp

 public function setUp()
 {
     //Setup mock logic hook files
     if (file_exists($this->modulesHookFile)) {
         $this->hasCustomModulesLogicHookFile = true;
         copy($this->modulesHookFile, $this->modulesHookFile . '.bak');
     } else {
         write_array_to_file("test", array(), $this->modulesHookFile);
     }
     if (file_exists($this->contactsHookFile)) {
         $this->hasCustomContactLogicHookFile = true;
         copy($this->contactsHookFile, $this->contactsHookFile . '.bak');
     } else {
         write_array_to_file("test", array(), $this->contactsHookFile);
     }
     $this->useOutputBuffering = false;
     LogicHook::refreshHooks();
 }
開發者ID:butschster,項目名稱:sugarcrm_dev,代碼行數:18,代碼來源:Bug46122Test.php

示例5: setUp

 public function setUp()
 {
     $this->bean = new Account();
     Bug52113TestHook::$count = 0;
     LogicHook::refreshHooks();
 }
開發者ID:newLoki,項目名稱:sugarcrm_dev,代碼行數:6,代碼來源:Bug52133Test.php


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