当前位置: 首页>>代码示例>>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;未经允许,请勿转载。