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


PHP IManager::getDefaultTypes方法代碼示例

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


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

示例1: getDefaultTypes

 /**
  * Get the default selection of types for a method
  *
  * @param string $method Should be one of 'stream' or 'email'
  * @return array Array of strings
  */
 public function getDefaultTypes($method)
 {
     $settings = array();
     if ($method === 'stream') {
         $settings[] = Data::TYPE_SHARE_CREATED;
         $settings[] = Data::TYPE_SHARE_CHANGED;
         $settings[] = Data::TYPE_SHARE_DELETED;
         //			$settings[] = Data::TYPE_SHARE_RESHARED;
         $settings[] = Data::TYPE_SHARE_RESTORED;
         //			$settings[] = Data::TYPE_SHARE_DOWNLOADED;
     }
     if ($method === 'stream' || $method === 'email') {
         $settings[] = Data::TYPE_SHARED;
         //			$settings[] = Data::TYPE_SHARE_EXPIRED;
         //			$settings[] = Data::TYPE_SHARE_UNSHARED;
         //
         //			$settings[] = Data::TYPE_SHARE_UPLOADED;
         //
         //			$settings[] = Data::TYPE_STORAGE_QUOTA_90;
         //			$settings[] = Data::TYPE_STORAGE_FAILURE;
     }
     // Allow other apps to add notification types to the default setting
     $additionalSettings = $this->manager->getDefaultTypes($method);
     $settings = array_merge($settings, $additionalSettings);
     return $settings;
 }
開發者ID:kebenxiaoming,項目名稱:owncloudRedis,代碼行數:32,代碼來源:usersettings.php

示例2: getDefaultSetting

 /**
  * Get a good default setting for a preference
  *
  * @param string $method Should be one of 'stream', 'email' or 'setting'
  * @param string $type One of the activity types, 'batchtime', 'self' or 'selfemail'
  * @return bool|int
  */
 public function getDefaultSetting($method, $type)
 {
     if ($method === 'setting') {
         if ($type === 'batchtime') {
             return 3600;
         } else {
             if ($type === 'self') {
                 return true;
             } else {
                 if ($type === 'selfemail') {
                     return false;
                 }
             }
         }
     }
     $settings = $this->manager->getDefaultTypes($method);
     return in_array($type, $settings);
 }
開發者ID:Kevin-ZK,項目名稱:vaneDisk,代碼行數:25,代碼來源:usersettings.php


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