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


PHP CApi::GetModule方法代碼示例

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


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

示例1: __construct

 /**
  * __construct
  *
  * @return void
  */
 public function __construct()
 {
     $oContactsModule = \CApi::GetModule('Contacts');
     if ($oContactsModule instanceof \AApiModule) {
         $this->oApiContactsManager = $oContactsModule->GetManager('main');
     }
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:12,代碼來源:Plugin.php

示例2: getContactsManager

 public function getContactsManager()
 {
     if (!isset($this->oApiContactsManager)) {
         $oContactsModule = \CApi::GetModule('Contacts');
         if ($oContactsModule instanceof \AApiModule) {
             $this->oApiContactsManager = $oContactsModule->GetManager('main');
         }
     }
     return $this->oApiContactsManager;
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:10,代碼來源:AddressBook.php

示例3: getChildren

 /**
  * @return array
  */
 public function getChildren()
 {
     $oAccount = $this->getUser();
     $aCards = array();
     $oApiCapabilityManager = \CApi::GetSystemManager('capability');
     if ($oAccount instanceof \CAccount && $oApiCapabilityManager->isGlobalContactsSupported($oAccount)) {
         $aContacts = array();
         $oContactsModule = \CApi::GetModule('Contacts');
         if ($oContactsModule instanceof \AApiModule) {
             $oGlobalContactManager = $oContactsModule->GetManager('global');
             if ($oGlobalContactManager) {
                 $aContacts = $oGlobalContactManager->getContactItems($oAccount, \EContactSortField::EMail, \ESortOrder::ASC, 0, 9999);
             }
         }
         foreach ($aContacts as $oContact) {
             $sUID = md5($oContact->Email . '-' . $oContact->Id);
             $vCard = new \Sabre\VObject\Component\VCard(array('VERSION' => '3.0', 'UID' => $sUID, 'FN' => $oContact->Name));
             $vCard->add('EMAIL', $oContact->Email, array('type' => array('work'), 'pref' => 1));
             $aCards[] = new Card(array('uri' => $sUID . '.vcf', 'carddata' => $vCard->serialize(), 'lastmodified' => $oContact->DateModified));
         }
     }
     return $aCards;
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:26,代碼來源:AddressBooks.php

示例4: ExecuteMethod

 public static function ExecuteMethod($sMethodName, $aParameters = array())
 {
     list($sModuleName, $sMethodName) = explode(\AApiModule::$Delimiter, $sMethodName);
     $oModule = CApi::GetModule($sModuleName);
     if ($oModule instanceof AApiModule) {
         return $oModule->CallMethod($sModuleName, $sMethodName, $aParameters);
     }
 }
開發者ID:afterlogic,項目名稱:aurora-core,代碼行數:8,代碼來源:api.php

示例5: Handle

 /**
  * @return void
  */
 public function Handle()
 {
     $mResult = '';
     $bError = false;
     $bIsHtml = false;
     $this->GetVersion();
     $this->CheckApi();
     $this->RedirectToHttps();
     $aPaths = self::GetPaths();
     $aModules = array();
     if (0 < count($aPaths) && !empty($aPaths[0])) {
         $sEntry = strtolower($aPaths[0]);
         $oModule = $this->oModuleManager->GetModuleFromRequest();
         if ($oModule instanceof \AApiModule) {
             if ($oModule->HasEntry($sEntry)) {
                 $aModules[] = $oModule;
             } else {
                 $mResult = '\'' . $sEntry . '\' entry not found in \'' . $oModule->GetName() . '\' module.';
                 $bError = true;
             }
         } else {
             if ($sEntry === 'api') {
                 $oCoreModule = \CApi::GetModule('Core');
                 if ($oCoreModule instanceof \AApiModule) {
                     $aModules[] = $oCoreModule;
                 }
             } else {
                 $aModules = $this->oModuleManager->GetModulesByEntry($sEntry);
             }
         }
         if (!$bError) {
             if (count($aModules) > 0) {
                 foreach ($aModules as $oModule) {
                     $mEntryResult = $oModule->RunEntry($sEntry);
                     if ($mEntryResult !== 'null') {
                         $mResult .= $mEntryResult;
                     }
                 }
             } else {
                 $bIsHtml = true;
             }
         }
     } else {
         $bIsHtml = true;
     }
     if ($bIsHtml) {
         $mResult = $this->generateHTML();
     }
     $oHttp = \MailSo\Base\Http::SingletonInstance();
     if ($oHttp->GetRequest('Format') !== 'Raw') {
         echo $mResult;
     }
 }
開發者ID:afterlogic,項目名稱:aurora-core,代碼行數:56,代碼來源:Service.php

示例6: initialize

 /**
  * 
  * @return boolean
  */
 public function initialize()
 {
     $mResult = true;
     if (!$this->isInitialized()) {
         foreach ($this->aRequireModules as $sModule) {
             $mResult = false;
             $oModule = \CApi::GetModule($sModule);
             if ($oModule) {
                 if (!$oModule->isInitialized()) {
                     $mResult = $oModule->initialize();
                 } else {
                     $mResult = true;
                 }
             }
             if (!$mResult) {
                 break;
             }
         }
         if ($mResult) {
             $this->bInitialized = true;
             $this->init();
         }
     }
     return $mResult;
 }
開發者ID:afterlogic,項目名稱:aurora-core,代碼行數:29,代碼來源:module.php


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