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


PHP Property::setValue方法代碼示例

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


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

示例1: setValue

 /**
  * Updates the current value.
  *
  * This may be either a single, or multiple strings in an array.
  *
  * Instead of strings, you may also use DateTime here.
  *
  * @param string|array|\DateTime $value
  * @return void
  */
 public function setValue($value)
 {
     if ($value instanceof \DateTime) {
         $this->setDateTime($value);
     } else {
         parent::setValue($value);
     }
 }
開發者ID:zhuomingliang,項目名稱:webmail-lite,代碼行數:18,代碼來源:DateAndOrTime.php

示例2: setValue

 /**
  * Updates the current value.
  *
  * This may be either a single, or multiple strings in an array.
  *
  * Instead of strings, you may also use DateTime here.
  *
  * @param string|array|DateTimeInterface $value
  *
  * @return void
  */
 function setValue($value)
 {
     if (is_array($value) && isset($value[0]) && $value[0] instanceof DateTimeInterface) {
         $this->setDateTimes($value);
     } elseif ($value instanceof DateTimeInterface) {
         $this->setDateTimes([$value]);
     } else {
         parent::setValue($value);
     }
 }
開發者ID:linagora,項目名稱:sabre-vobject,代碼行數:21,代碼來源:DateTime.php

示例3: setValue

 /**
  * Updates the current value.
  *
  * This may be either a single, or multiple strings in an array.
  *
  * Instead of strings, you may also use DateTime here.
  *
  * @param string|array|\DateTime $value
  * @return void
  */
 public function setValue($value)
 {
     if (is_array($value) && isset($value[0]) && $value[0] instanceof \DateTime) {
         $this->setDateTimes($value);
     } elseif ($value instanceof \DateTime) {
         $this->setDateTimes(array($value));
     } else {
         parent::setValue($value);
     }
 }
開發者ID:MetallianFR68,項目名稱:myroundcube,代碼行數:20,代碼來源:DateTime.php

示例4: decodeProperty

 /**
  * Decode properties for upgrading from v. 2.1
  *
  * @param \Sabre\VObject\Property $property Reference to a \Sabre\VObject\Property.
  * The only encoding allowed in version 3.0 is 'b' for binary. All encoded strings
  * must therefore be decoded and the parameters removed.
  */
 protected function decodeProperty(&$property)
 {
     foreach ($property->parameters as $key => &$parameter) {
         // Check for values without names which Sabre interprets
         // as names without values.
         if (trim($parameter->getValue()) === '') {
             $parameter->setValue($parameter->name);
             $parameter->name = $this->paramName($parameter->name);
         }
         // Check out for encoded string and decode them :-[
         if (strtoupper($parameter->name) == 'ENCODING') {
             if (strtoupper($parameter->getValue()) == 'QUOTED-PRINTABLE') {
                 $property->setValue(str_replace("\r\n", "\n", VObject\StringUtil::convertToUTF8(quoted_printable_decode($property->getValue()))));
                 unset($property->parameters[$key]);
             } elseif (strtoupper($parameter->getValue()) == 'BASE64') {
                 $parameter->setValue('b');
             }
         } elseif (strtoupper($parameter->name) == 'CHARSET') {
             unset($property->parameters[$key]);
         }
     }
 }
開發者ID:ChrisPHL,項目名稱:contacts,代碼行數:29,代碼來源:vcard.php


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