當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。