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


PHP self::setValue方法代码示例

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


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

示例1: construct

 public static function construct($alarm1, $alarm2, $tamper, $battery, $supervision_reports, $restore_reports, $trouble, $ac)
 {
     $status = new self();
     $value = 0x0;
     if ($alarm1) {
         $value |= self::ALARM_1_BITMASK;
     }
     if ($alarm2) {
         $value |= self::ALARM_2_BITMASK;
     }
     if ($tamper) {
         $value |= self::TAMPER_BITMASK;
     }
     if ($battery) {
         $value |= self::BATTERY_BITMASK;
     }
     if ($supervision_reports) {
         $value |= self::SUPERVISION_REPORTS_BITMASK;
     }
     if ($restore_reports) {
         $value |= self::RESTORE_REPORTS_BITMASK;
     }
     if ($trouble) {
         $value |= self::TROUBLE_BITMASK;
     }
     if ($ac) {
         $value |= self::AC_MAINS_BITMASK;
     }
     $status->setValue($value);
     return $status;
 }
开发者ID:CadConsultants,项目名称:zigbee-3,代码行数:31,代码来源:ZoneStatus.php

示例2: loadConfig

 /**
  * Factory method to load form fields from config.
  *
  * Config must return an array: field_id => waContactField OR array of options to specify on existing field with given field_id.
  *
  * @param string|array $file path to config file, or array of config options.
  * @param array $options
  */
 public static function loadConfig($file, $options = array())
 {
     $config = self::readConfig($file);
     $form = new self($config['fields'], $options);
     $form->setValue($config['values']);
     return $form;
 }
开发者ID:cjmaximal,项目名称:webasyst-framework,代码行数:15,代码来源:waContactForm.class.php

示例3: create

 /**
  * @param mixed|null $value
  *
  * @return Item
  */
 public static function create($value = null)
 {
     $item = new self();
     if ($value) {
         $item->setValue($value);
     }
     return $item;
 }
开发者ID:cocur,项目名称:collection,代码行数:13,代码来源:Item.php

示例4: fromArray

 /**
  * @param $arr
  * @return Tree
  */
 private static function fromArray($arr)
 {
     $ret = new self([]);
     foreach ($arr as $key => $value) {
         $ret->setValue($key, $value);
     }
     return $ret;
 }
开发者ID:alex-k,项目名称:jsondiff,代码行数:12,代码来源:Tree.php

示例5: withAttributes

 public static function withAttributes($title, $value, $isShort = true)
 {
     $instance = new self();
     $instance->setTitle($title);
     $instance->setValue($value);
     $instance->setShort($isShort);
     return $instance;
 }
开发者ID:digitalicagroup,项目名称:slack-hook-framework,代码行数:8,代码来源:SlackResultAttachmentField.php

示例6: construct

 public static function construct($attribute_id, $datatype_id, $value)
 {
     $element = new self();
     $element->setAttributeId($attribute_id);
     $element->setDatatypeId($datatype_id);
     $element->setValue($value);
     return $element;
 }
开发者ID:CadConsultants,项目名称:zigbee-3,代码行数:8,代码来源:WriteAttributeRecord.php

示例7: cell

 /**
  * Generates a new table cell
  *
  * @param string $value
  * @param array $attributes
  *
  * @return FTV_Html_Cell
  */
 public function cell($value, array $attributes = null)
 {
     $cell = new self();
     $cell->setValue($value);
     if (null !== $attributes) {
         $cell->setAttributes($attributes);
     }
     return $cell;
 }
开发者ID:schpill,项目名称:thin,代码行数:17,代码来源:Cell.php

示例8: constructSuccess

 public static function constructSuccess($attribute_id, $datatype_id, $value)
 {
     $record = new self();
     $record->setAttributeId($attribute_id);
     $record->setStatus(ZCLStatus::SUCCESS);
     $record->setDatatypeId($datatype_id);
     $record->setValue($value);
     return $record;
 }
开发者ID:CadConsultants,项目名称:zigbee-3,代码行数:9,代码来源:ReadAttributesStatusRecord.php

示例9: factory

 /**
  * @param Schema   $schema
  * @param Property $property
  * @param string $operationType
  * @return Operation
  */
 public static function factory(Schema $schema, Property $property, $operationType)
 {
     $operation = new self();
     $operation->setType($operationType);
     $operation->setSchema($schema);
     $operation->setPath($property->getPath());
     $operation->setValue($property->getValue());
     return $operation;
 }
开发者ID:svn2github,项目名称:rackspace-cloud-files-cdn,代码行数:15,代码来源:Operation.php

示例10: create

 /**
  * Criar Item com campos obrigatórios preenchidos
  *
  * @param string $id - Código do Produto
  * @param string $name - Nome do Produto
  * @param float $value - Valor Unitário
  * @param integer $quantity - Quantidade
  *
  * @return Item
  */
 public static function create($id, $name, $value, $quantity)
 {
     $instance = new self();
     $instance->setId($id);
     $instance->setName($name);
     $instance->setValue($value);
     $instance->setQuantity($quantity);
     return $instance;
 }
开发者ID:lucasmro,项目名称:clearsale,代码行数:19,代码来源:Item.php

示例11: set

 /**
  * @param $name
  * @param $value
  */
 public static function set($name, $value)
 {
     $obj = new self($name);
     $obj->setValue($value);
     if (self::where(array('name' => $name))->hasSets()) {
         $obj->update();
     } else {
         $obj->create();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.arConfig.php

示例12: createFromXML

 /**
  * @param SimpleXMLElement $xml
  *
  * @return Characteristic
  */
 public static function createFromXML(SimpleXMLElement $xml)
 {
     /*
     <characteristic displayValue="Basic (0-500 EUR)" value="1" name="Insurance range code"/>
     */
     $attributes = $xml->attributes();
     $option = new self();
     $option->setDisplayValue($attributes['displayValue']);
     $option->setValue($attributes['value']);
     $option->setName($attributes['name']);
     return $option;
 }
开发者ID:Antidot-be,项目名称:bpost-api-library,代码行数:17,代码来源:Characteristic.php

示例13: getEntry

 /**
  * @return ConfigurationEntry
  */
 static function getEntry(ConfigurationKey $ck)
 {
     try {
         $entry = self::dao()->getEntityById($ck);
     } catch (OrmEntityNotFoundException $e) {
         $entry = new self();
         $entry->setId($ck);
         $entry->setValue('');
         $entry->save();
     }
     return $entry;
 }
开发者ID:phoebius,项目名称:phoebius.com,代码行数:15,代码来源:ConfigurationEntry.class.php

示例14: setForScope

 public static function setForScope($scope, array $settings)
 {
     /** @var \Octo\System\Store\SettingStore $settingStore */
     $settingStore = Store::get('Setting');
     foreach ($settings as $key => $value) {
         $setting = new self();
         $setting->setKey($key);
         $setting->setValue($value);
         $setting->setScope($scope);
         $settingStore->saveByReplace($setting);
     }
 }
开发者ID:dw250100785,项目名称:Octo,代码行数:12,代码来源:Setting.php

示例15: fromArray

 public static function fromArray($data)
 {
     if (!array_key_exists('value', $data) || !array_key_exists('reasons', $data)) {
         throw new \InvalidArgumentException('array does not contain \'value\' or \'reasons\'');
     }
     if (!is_array($data['reasons'])) {
         throw new \InvalidArgumentException('\'reasons\' must be an array');
     }
     $scorePart = new self();
     $scorePart->setValue($data['value']);
     $scorePart->setReasons($data['reasons']);
     return $scorePart;
 }
开发者ID:peterfox,项目名称:graphaware-reco-client-php,代码行数:13,代码来源:ScorePart.php


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