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


PHP IUser::getEMailAddress方法代码示例

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


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

示例1: updateCard

 /**
  * @param VCard $vCard
  * @param IUser $user
  * @return bool
  */
 public function updateCard(VCard $vCard, IUser $user)
 {
     $uid = $user->getUID();
     $displayName = $user->getDisplayName();
     $displayName = empty($displayName) ? $uid : $displayName;
     $emailAddress = $user->getEMailAddress();
     $cloudId = $user->getCloudId();
     $image = $user->getAvatarImage(-1);
     $updated = false;
     if ($this->propertyNeedsUpdate($vCard, 'FN', $displayName)) {
         $vCard->FN = new Text($vCard, 'FN', $displayName);
         unset($vCard->N);
         $vCard->add(new Text($vCard, 'N', $this->splitFullName($displayName)));
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'EMAIL', $emailAddress)) {
         $vCard->EMAIL = new Text($vCard, 'EMAIL', $emailAddress);
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'CLOUD', $cloudId)) {
         $vCard->CLOUD = new Text($vCard, 'CLOUD', $cloudId);
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'PHOTO', $image)) {
         $vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);
         $updated = true;
     }
     if (empty($emailAddress) && !is_null($vCard->EMAIL)) {
         unset($vCard->EMAIL);
         $updated = true;
     }
     if (empty($cloudId) && !is_null($vCard->CLOUD)) {
         unset($vCard->CLOUD);
         $updated = true;
     }
     if (empty($image) && !is_null($vCard->PHOTO)) {
         unset($vCard->PHOTO);
         $updated = true;
     }
     return $updated;
 }
开发者ID:evanjt,项目名称:core,代码行数:46,代码来源:converter.php

示例2: userToPrincipal

 /**
  * @param IUser $user
  * @return array
  */
 protected function userToPrincipal($user)
 {
     $userId = $user->getUID();
     $displayName = $user->getDisplayName();
     $principal = ['uri' => $this->principalPrefix . '/' . $userId, '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName];
     $email = $user->getEMailAddress();
     if (!empty($email)) {
         $principal['{http://sabredav.org/ns}email-address'] = $email;
         return $principal;
     }
     return $principal;
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:16,代码来源:principal.php

示例3: updateCard

 /**
  * @param VCard $vCard
  * @param IUser $user
  * @return bool
  */
 public function updateCard(VCard $vCard, IUser $user)
 {
     $uid = $user->getUID();
     $displayName = $user->getDisplayName();
     $displayName = empty($displayName) ? $uid : $displayName;
     $emailAddress = $user->getEMailAddress();
     $cloudId = $user->getCloudId();
     $image = $this->getAvatarImage($user);
     $groups = \OC::$server->getGroupManager()->getUserGroups($user);
     $updated = false;
     if ($this->propertyNeedsUpdate($vCard, 'FN', $displayName)) {
         $vCard->FN = new Text($vCard, 'FN', $displayName);
         unset($vCard->N);
         $vCard->add(new Text($vCard, 'N', $this->splitFullName($displayName)));
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'EMAIL', $emailAddress)) {
         $vCard->EMAIL = new Text($vCard, 'EMAIL', $emailAddress);
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'CLOUD', $cloudId)) {
         $vCard->CLOUD = new Text($vCard, 'CLOUD', $cloudId);
         $updated = true;
     }
     if ($this->propertyNeedsUpdate($vCard, 'PHOTO', $image)) {
         $vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);
         $updated = true;
     }
     if (empty($emailAddress) && !is_null($vCard->EMAIL)) {
         unset($vCard->EMAIL);
         $updated = true;
     }
     if (empty($cloudId) && !is_null($vCard->CLOUD)) {
         unset($vCard->CLOUD);
         $updated = true;
     }
     if (empty($image) && !is_null($vCard->PHOTO)) {
         unset($vCard->PHOTO);
         $updated = true;
     }
     /**
      * Sabre\VObject\Property\Text $categories
      */
     $categoriesProperty = $vCard->CATEGORIES;
     if (method_exists($categoriesProperty, 'count')) {
         $categoriesCount = $categoriesProperty->count();
         $categories = [];
         for ($i = 0; $i < $categoriesCount; $i++) {
             $categories[] = $categoriesProperty->getValue();
             $categoriesProperty->getIterator()->next();
             $categoriesProperty = $categoriesProperty->getIterator()->current();
         }
         //            var_dump(array_keys($groups),$categories);
         //            var_dump(array_diff(array_keys($groups), $categories));
         //            exit;
         if (count(array_keys($groups)) != count($categories) || !empty(array_diff(array_keys($groups), $categories))) {
             unset($vCard->CATEGORIES);
             $updated = true;
         }
     } else {
         if ($groups) {
             $updated = true;
         }
     }
     return $updated;
 }
开发者ID:raceface2nd,项目名称:owncollab,代码行数:71,代码来源:converteruser.php


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