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