本文整理汇总了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');
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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;
}