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


PHP Tinebase_DateTime::addMinute方法代碼示例

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


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

示例1: getApplicationPreferenceDefaults

 /**
  * get preference defaults if no default is found in the database
  *
  * @param string $_preferenceName
  * @param string|Tinebase_Model_User $_accountId
  * @param string $_accountType
  * @return Tinebase_Model_Preference
  */
 public function getApplicationPreferenceDefaults($_preferenceName, $_accountId = NULL, $_accountType = Tinebase_Acl_Rights::ACCOUNT_TYPE_USER)
 {
     $preference = $this->_getDefaultBasePreference($_preferenceName);
     switch ($_preferenceName) {
         case self::DAYSVIEW_STARTTIME:
             $doc = new DomDocument('1.0');
             $options = $doc->createElement('options');
             $doc->appendChild($options);
             $time = new Tinebase_DateTime('@0');
             for ($i = 0; $i < 48; $i++) {
                 $time->addMinute($i ? 30 : 0);
                 $timeString = $time->format('H:i');
                 $value = $doc->createElement('value');
                 $value->appendChild($doc->createTextNode($timeString));
                 $label = $doc->createElement('label');
                 $label->appendChild($doc->createTextNode($timeString));
                 // @todo l10n
                 $option = $doc->createElement('option');
                 $option->appendChild($value);
                 $option->appendChild($label);
                 $options->appendChild($option);
             }
             $preference->value = '08:00';
             $preference->options = $doc->saveXML();
             break;
         case self::DEFAULTCALENDAR:
             $this->_getDefaultContainerPreferenceDefaults($preference, $_accountId);
             break;
         case self::DEFAULTPERSISTENTFILTER:
             $preference->value = Tinebase_PersistentFilter::getPreferenceValues('Calendar', $_accountId, "All my events");
             break;
         case self::NOTIFICATION_LEVEL:
             $translate = Tinebase_Translation::getTranslation($this->_application);
             // need to put the translations strings here because they were not found in the xml below :/
             // _('Never') _('On invitation and cancellation only') _('On time changes') _('On all updates but attendee responses') _('On attendee responses too')
             $preference->value = Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_RESCHEDULE;
             $preference->options = '<?xml version="1.0" encoding="UTF-8"?>
                 <options>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_NONE . '</value>
                         <label>' . $translate->_('Never') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_INVITE_CANCEL . '</value>
                         <label>' . $translate->_('On invitation and cancellation only') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_RESCHEDULE . '</value>
                         <label>' . $translate->_('On time changes') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_UPDATE . '</value>
                         <label>' . $translate->_('On all updates but attendee responses') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_ATTENDEE_STATUS_UPDATE . '</value>
                         <label>' . $translate->_('On attendee responses too') . '</label>
                     </option>
                 </options>';
             break;
         case self::SEND_NOTIFICATION_OF_OWN_ACTIONS:
             $preference->value = 0;
             $preference->options = '<?xml version="1.0" encoding="UTF-8"?>
                 <options>
                     <special>' . Tinebase_Preference_Abstract::YES_NO_OPTIONS . '</special>
                 </options>';
             break;
         default:
             throw new Tinebase_Exception_NotFound('Default preference with name ' . $_preferenceName . ' not found.');
     }
     return $preference;
 }
開發者ID:rodrigofns,項目名稱:ExpressoLivre3,代碼行數:80,代碼來源:Preference.php


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