当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::getAccount方法代码示例

本文整理汇总了PHP中Sabre\DAV\Server::getAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::getAccount方法的具体用法?PHP Server::getAccount怎么用?PHP Server::getAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sabre\DAV\Server的用法示例。


在下文中一共展示了Server::getAccount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAccount

 public function getAccount()
 {
     if (!isset($this->oAccount) && isset($this->server)) {
         $this->oAccount = $this->server->getAccount();
     }
     return $this->oAccount;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:7,代码来源:Plugin.php

示例2: afterWriteContent

 function afterWriteContent($path, \Sabre\DAV\IFile $node)
 {
     if ('sabredav' !== \CApi::GetManager()->GetStorageByType('contacts')) {
         if ($node instanceof \Sabre\CardDAV\ICard) {
             $oAccount = $this->server->getAccount();
             if (isset($oAccount)) {
                 $iUserId = $oAccount->IdUser;
                 $iTenantId = $node instanceof \afterlogic\DAV\CardDAV\SharedCard ? $oAccount->IdTenant : null;
                 $sContactFileName = $node->getName();
                 $oContactDb = $this->oApiContactsManager->GetContactByStrId($iUserId, $sContactFileName, $iTenantId);
                 if (!isset($oContactDb)) {
                     $oDavManager = \CApi::Manager('dav');
                     $oVCard = $oDavManager ? $oDavManager->VObjectReaderRead($node->get()) : null;
                     if ($oVCard && $oVCard->UID) {
                         $oContactDb = $this->oApiContactsManager->GetContactByStrId($iUserId, (string) $oVCard->UID . '.vcf', $iTenantId);
                     }
                 }
                 $oContact = new \CContact();
                 $oContact->InitFromVCardStr($iUserId, $node->get());
                 $oContact->IdContactStr = $sContactFileName;
                 $oContact->IdTenant = $iTenantId;
                 if (isset($oContactDb)) {
                     $oContact->IdContact = $oContactDb->IdContact;
                     $oContact->IdDomain = $oContactDb->IdDomain;
                     $oContact->SharedToAll = !!$oContactDb->SharedToAll;
                     $this->oApiContactsManager->UpdateContact($oContact);
                 } else {
                     $this->oApiContactsManager->CreateContact($oContact);
                 }
             }
         }
     }
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:33,代码来源:Plugin.php

示例3: afterWriteContent

 function afterWriteContent($path, \Sabre\DAV\IFile $node)
 {
     if ('sabredav' !== \CApi::GetManager()->GetStorageByType('contacts')) {
         if ($node instanceof \Sabre\CardDAV\ICard) {
             $oAccount = $this->server->getAccount();
             if (isset($oAccount)) {
                 $iUserId = $oAccount->IdUser;
                 $iTenantId = $node instanceof \afterlogic\DAV\CardDAV\SharedCard ? $oAccount->IdTenant : null;
                 $sFileName = $node->getName();
                 $oContactDb = $this->oApiContactsManager->GetContactByStrId($iUserId, $sFileName, $iTenantId);
                 $oContact = new \CContact();
                 $oContact->InitFromVCardStr($iUserId, $node->get());
                 $oContact->IdContact = $oContactDb->IdContact;
                 $oContact->SharedToAll = !!$oContactDb->SharedToAll;
                 $bResult = $this->oApiContactsManager->UpdateContact($oContact);
                 //					\CApi::LogObject($bResult, \ELogLevel::Full, 'contacts-');
             }
         }
     }
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:20,代码来源:Plugin.php


注:本文中的Sabre\DAV\Server::getAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。