Set the default value.

@param float $defaultValue A default value.
@throws \InvalidArgumentException If $defaultValue is not a float value.
487107
public function setDefaultValue($defaultValue)
    {
        if (is_float($defaultValue)) {
            $this->defaultValue = $defaultValue;
        } else {
            $msg = "The defaultValue argument must be a numeric value, '" . gettype($defaultValue) . "'.";
            throw new InvalidArgumentException($msg);
        }
    }
1276220
public function setValue($value, $default = false)
    {
        if ($value != $this->value && !$default) {
            $this->valueChanged = true;
        }

        if (is_string($value) || is_int($value) || is_float($value)) {
            $this->value = (string)$value;
        } else {
            $this->value = null;
        }
    }
557161
protected function _setDefaultPlaceholderValue($value)
    {
        if (!is_null($value)) {
            $value = $this->_normalizeStringable($value);
        }

        $this->defaultPlaceholderValue = $value;
    }
14268
public function setDefaultValue($defaultValue)
    {
        if (!is_string($defaultValue)) {
            throw new \InvalidArgumentException('The attribute defaultValue on the class Attribute has to be string (' . gettype($defaultValue) . ('object' === gettype($defaultValue) ? ' ' . get_class($defaultValue) : '') . ' given).');
        }

        $this->defaultValue = $defaultValue;

        return $this;
    }
194849
public function setSourceValue($sourceValue)
    {
        if (is_int($sourceValue)) {
            $this->sourceValue = $sourceValue;
        } else {
            $msg = "SourceValue must be an integer, '" . gettype($sourceValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1150586
public function setDefaultValue($defaultValue): FieldInterface
    {
        if (!is_scalar($defaultValue) && !is_null($defaultValue)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'defaultValue'; ".
                "expecting either a scalar or null value"
            );
        }
        $this->defaultValue = $defaultValue;
        return $this;
    }
1348931
protected function setState($key, $value, $defaultValue = null) {
		$session = Yii::app()->session;
		$key = $this->getStateKeyPrefix() . $key;
		if ($value === $defaultValue) {
			unset($session[$key]);
		}
		else {
			$session[$key] = $value;
		}
	}
607432
public function setDefaultImage($defaultImage = '')
    {
        if (empty($defaultImage)) {
            $image        = DataRepository::getData('config_image');
            $defaultImage = $image['default_image'];
        }
        $this->defaultImage = $defaultImage;

        return $this;
    }
1099439
public function setDefaultCurrency(IdentifierInterface $identifier)
    {
        if (!$currency = $this->getCurrency($identifier)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Currency '%s' not supported",
                    $identifier
                )
            );
        }

        $this->defaultCurrency = $currency;
    }
1357146
public function setDefaultLocale($defaultLocale = null)
    {
        if (is_null($defaultLocale))
            $defaultLocale = $this->config()->get('app.locale');

        $this->isDefaultLocaleSupported($defaultLocale);
        $this->defaultLocale = $defaultLocale;
        // TODO: Refresh locales & supportedLocales collection [Locale entity => default property]

        return $this;
    }
537777
public function getValue(string $key, $defaultValue = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        } else {
            return $defaultValue;
        }
    }
1286415
public function param(string $name, $defaultValue = null)
    {
        if (array_key_exists($name, $this->parameters)) {
            return $this->parameters[$name];
        }

        return $defaultValue;
    }
219145
public void setDefaultValue(T defaultValue, ProcessCase[] cases) {
        this.defaultValue = OptionalProcessCase.of(defaultValue, cases);
    }
11866
protected function setDefaultValue() : void
    {
        if (empty($this->defaultOptions['default'])) {
            return;
        }

        // If we have a default value from configuration, pass it through
        // processing for magic/dynamic values like dates and usernames.
        $eventName = (string)EventName::FIELD_HANDLER_DEFAULT_VALUE();
        $event = new Event($eventName, $this, [
            'default' => $this->defaultOptions['default']
        ]);

        $view = $this->config->getView();
        $view->getEventManager()->dispatch($event);

        // Only overwrite the default if any events were triggered
        $listeners = $view->getEventManager()->listeners($eventName);
        if (empty($listeners)) {
            return;
        }
        $this->defaultOptions['default'] = $event->result;
    }
1256199
public function setOptionValue($optionName, $optionValue, array $values = [])
    {
        if (!isset($this->options[$optionName])) {
            $this->options[$optionName] = [
                'value' => $optionValue,
                'values' => $values,
            ];
        } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
            throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
        } else {
            $this->options[$optionName]['value'] = $optionValue;
        }
        return $this;
    }
650476
public function setDefaultValues(Array $defaultValues)
    {
        foreach ($defaultValues as $defaultName => $defaultValue) {
            if (array_key_exists($defaultName, $this->_metadata)) {
                $this->_defaultValues[$defaultName] = $defaultValue;
            }
        }
        return $this;
    }
1181201
public function getNullableValue($defaultValue = self::NULLABLE_DEFAULT)
    {
        $isNullable = !$this->isNotNull();

        return $isNullable === $defaultValue ? ($this->isAlwaysNullable() ? $isNullable : null) : $isNullable;
    }