本文整理汇总了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;
}
示例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;
}
示例3: create
/**
* @param mixed|null $value
*
* @return Item
*/
public static function create($value = null)
{
$item = new self();
if ($value) {
$item->setValue($value);
}
return $item;
}
示例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;
}
示例5: withAttributes
public static function withAttributes($title, $value, $isShort = true)
{
$instance = new self();
$instance->setTitle($title);
$instance->setValue($value);
$instance->setShort($isShort);
return $instance;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}