/*!
Sets the default value.
17733
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $dataInt = $originalContentObjectAttribute->attribute( 'data_int' );
            $contentObjectAttribute->setAttribute( 'data_int', $dataInt );
        }
        else
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $defaultType = $contentClassAttribute->attribute( self::DEFAULT_FIELD );

            if ( $defaultType == 1 )
            {
                $time = new eZTime();
                $contentObjectAttribute->setAttribute( 'data_int', $time->timeOfDay() );
            }
        }
    }
657617
function setDefaults(model, defaults) {
    if (!defaults) { return; }

    _.each(defaults, function (value, key) {
        if (model[key] === undefined) {
            model[key] = value;
        }
    });
}
24768
private function setToDefault():void
    {
        $this->session = null;
        $this->id = null;
        $this->name = null;
    }
861077
function setDefaults($defaultValues = null, $filter = null)
    {
        if (is_array($defaultValues)) {
            if (isset($filter)) {
                if (is_array($filter) && (2 != count($filter) || !is_callable($filter))) {
                    foreach ($filter as $val) {
                        if (!is_callable($val)) {
                            return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                        } else {
                            $defaultValues = $this->_recursiveFilter($val, $defaultValues);
                        }
                    }
                } elseif (!is_callable($filter)) {
                    return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                } else {
                    $defaultValues = $this->_recursiveFilter($filter, $defaultValues);
                }
            }
            $this->_defaultValues = HTML_QuickForm::arrayMerge($this->_defaultValues, $defaultValues);
            foreach (array_keys($this->_elements) as $key) {
                $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this);
            }
        }
    }
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;
        }
    }
374496
private function setDefaultValueInternal()
    {
        $defaultValue = $this->getDefaultValue();
        if ($defaultValue == 'now') {
            $defaultValue = new DateTimeObject('now');
        }
        $this->setValue($defaultValue);
    }
124501
function set_default($iid)
    {
        if ($this->ID && $iid) {
            $this->db->query(
                "UPDATE ".$this->db->table_name('identities', true).
                " SET `standard` = '0'".
                " WHERE `user_id` = ? AND `identity_id` <> ?",
                $this->ID,
                $iid);

            unset($this->identities[0]);
        }
    }
515350
public function setDefault($default)
    {
        switch ($this->type) {
            case self::TYPE_STRING:
                if (!\is_string($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a string');
                }

                break;
            case self::TYPE_NUMBER:
                if (!\is_numeric($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a number');
                }

                break;
            case self::TYPE_INTEGER:
                if (!\is_numeric($default) || (int) $default != $default) {
                    throw new \InvalidArgumentException('Default parameter is not an integer');
                }

                break;
            case self::TYPE_DATE:
                if (!$default instanceof \DateTimeImmutable) {
                    throw new \InvalidArgumentException('Default parameter is not a dateTime object');
                }

                break;
            case self::TYPE_BOOLEAN:
                if (!\is_bool($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a boolean');
                }

                break;
            case self::TYPE_FILE:
                throw new \InvalidArgumentException('A default value cannot be set for a file');

                break;
        }

        $this->default = $default;
    }
539735
function setValue($value)
    {
        $this->_createElementsIfNotExist();
        foreach (array_keys($this->_elements) as $key) {
            if (!$this->_appendName) {
                $v = $this->_elements[$key]->_findValue($value);
                if (null !== $v) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $v, $this);
                }

            } else {
                $elementName = $this->_elements[$key]->getName();
                $index       = strlen($elementName) ? $elementName : $key;
                if (is_array($value)) {
                    if (isset($value[$index])) {
                        $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
                    }
                } elseif (isset($value)) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value, $this);
                }
            }
        }
    }
1252193
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->defaultValues = $key + $this->defaultValues;
        } else {
            $this->defaultValues[$key] = $value;
        }

        return $this;
    }
965797
protected function setDefaults() {
        if ($this->getAccept() === null) {
            $this->setDefaultAccept();
        }

        if ($this->getContentType() === null) {
            $this->setDefaultContentType();
        }
    }
1078531
public function set_default(): void
    {
        if (!userHasPermission('admin:auth:groups:setDefault')) {
            show404();
        }

        $oUri            = Factory::service('Uri');
        $oUserGroupModel = Factory::model('UserGroup', 'nails/module-auth');
        $oSession        = Factory::service('Session', 'nails/module-auth');

        if ($oUserGroupModel->setAsDefault($oUri->segment(5))) {
            $oSession->setFlashData(
                'success',
                'Group set as default successfully.'
            );
        } else {
            $oSession->setFlashData(
                'error',
                'Failed to set default user group. ' . $oUserGroupModel->lastError()
            );
        }

        redirect('admin/auth/groups');
    }
438217
def setDefault(self, key, value):
        
        if value is None:
            self._defaults.pop(key, None)
        else:
            self._defaults[key] = value
424237
public function setReturnEmpty($value)
    {
        if (is_bool($value)) {
            $this->_params['return-empty'] = ($value?'true':'false');
        } else if ($value != null) {
            $this->_params['return-empty'] = $value;
        } else {
            unset($this->_params['return-empty']);
        }
        return $this;
    }
585224
public function setDefault($key, $value)
    {
        if ($this->saveDefaults) {
            if (! $this->exists($key)) {
                $this->set($key, $value);
            } elseif (is_array($value)) {
                $this[$key]->defaults = $value;
            }
        } else {
            if (! isset($this->defaultData[$key])) {
                $this->defaultData[$key] = $value;
            } elseif (is_array($value)) {
                $this[$key]->defaults = $value;
            }
        }
    }
986792
def set_default(self, value):
        
        if value is None:
            self.__default = value
        elif not isinstance(value, str):
            raise TypeError("Default must be set to a String")
        else:
            self.__default = value
440787
public function set_element_default($element, $defaultvalue) {
        if ($element instanceof HTML_QuickForm_element) {
            $element = $element->getName();
        }
        $this->_form->setDefault($element, $defaultvalue);
    }