Get weight

If no "weight" value has been set, this method will
set and return a default "weight" value,
if any such value is available

@see getDefaultWeight()

@return int|null weight or null if no weight has been set
330110
public function getWeight() : ?int 
    {
        if ( ! $this->hasWeight()) {
            $this->setWeight($this->getDefaultWeight());
        }
        return $this->weight;
    }
910678
public function getMeanWeight(): float
    {
        $meanWeight = 0;

        /** @var PackedBox $box */
        foreach ($this->list as $box) {
            $meanWeight += $box->getWeight();
        }

        return $meanWeight / count($this->list);
    }
145770
@Override
	public Object getDefaultValue() {

		Indexed indexedAnnotation = getIndexAnnotation();
		if (indexedAnnotation != null && StringUtils.hasText(indexedAnnotation.defaultValue())) {
			return indexedAnnotation.defaultValue();
		}
		return null;
	}
240651
public function getRow() : ?int 
    {
        if ( ! $this->hasRow()) {
            $this->setRow($this->getDefaultRow());
        }
        return $this->row;
    }
452311
public function value()
    {
        if ($this->values) {
            return end($this->values);
        }
        $cast_method = 'castTo' . ucwords($this->castTo);
        return $this->{$cast_method}(current($this->defaultValue()));
    }
58824
public function get_default_grade() {
        $scaleid = $this->get('scaleid');
        $scaleconfig = $this->get('scaleconfiguration');
        if ($scaleid === null) {
            $scaleconfig = $this->get_framework()->get('scaleconfiguration');
        }
        return competency_framework::get_default_grade_from_scale_configuration($scaleconfig);
    }
661328
public function getDefaultValue()
    {
        return is_array($this->default_value) ? $this->default_value : [
            Carbon::now()->subWeek()->format('Y-m-d'),
            Carbon::now()->format('Y-m-d'),
        ];
    }
405054
public function getClassWeight()
    {
        $weight = 0;

        // Look for a special classname
        $class = $this->getAttribute('class');
        if (trim($class)) {
            if (preg_match(NodeUtility::$regexps['negative'], $class)) {
                $weight -= 25;
            }

            if (preg_match(NodeUtility::$regexps['positive'], $class)) {
                $weight += 25;
            }
        }

        // Look for a special ID
        $id = $this->getAttribute('id');
        if (trim($id)) {
            if (preg_match(NodeUtility::$regexps['negative'], $id)) {
                $weight -= 25;
            }

            if (preg_match(NodeUtility::$regexps['positive'], $id)) {
                $weight += 25;
            }
        }

        return $weight;
    }
589630
public function getValue()
    {

        $value = $this->defaultValue;
        if ($this->existsRequest()) {
        $value = trim($_POST[$this->requestName]);
        }

        return $value;

    }
558525
public function getDefaultValue(): Node\Expr {
        $factory = new BuilderFactory();

        if ($this->nullable || $this->mixed || $this->class) {
            return $factory->val(null);
        }

        switch ($this->name) {
        case 'array':
            return $factory->val([]);

        case 'bool':
            return $factory->val(false);

        case 'float':
            return $factory->val(0.0);

        case 'int':
            return $factory->val(0);

        case 'string':
            return $factory->val('');

        default:
            return $factory->val(null);
        }
    }
842086
public function getLoadValue()
    {
        if ($this->formField->value !== null) {
            return $this->formField->value;
        }

        $defaultValue = !$this->model->exists
            ? $this->formField->getDefaultFromData($this->data ?: $this->model)
            : null;

        return $this->formField->getValueFromData($this->data ?: $this->model, $defaultValue);
    }
226449
protected function initDefault()
    {
        if ($this->isCli()) {
            return null;
        }

        $uri = (empty($_SERVER['HTTPS']) ? 'http' : 'https')
            . '://'
            . $_SERVER['HTTP_HOST']
            . $_SERVER['REQUEST_URI'];
        return  rtrim(preg_replace('/\?.*/', '', $uri), '/');
    }
790730
public function getTotalWeight()
    {
        $totalWeight = 0;

        if ($this->count()) {
            foreach ($this->storage as $id => $item) {
                if (isset($item[ 'subTotal' ][ 'weight' ])) {
                    $totalWeight += (int)$item[ 'weight' ];
                }
            }
        }

        return $totalWeight;
    }
513338
public function getDefaultValue()
    {
        if ($this->hasOption(self::OPTION_DEFAULT_VALUE)) {
            return $this->getSanitizedValue(
                $this->getOption(self::OPTION_DEFAULT_VALUE, $this->getNullValue())
            );
        }

        return $this->getNullValue();
    }
263200
public function getInitialValue()
    {
        if ($this->hasDefaultValue) {
            return $this->defaultValue;
        }

        return $this->isNullable ? null : $this->dataType->getInitialValue();
    }
101095
public function getDefaultValue()
    {
        if ($this->isArray() || $this->isList()) {
            return [];
        }
        return Utils::getValueWithinItsType($this->getMetaValueFirstSet([
            'default',
            'Default',
            'DefaultValue',
            'defaultValue',
            'defaultvalue',
        ]), $this->getType(true));
    }
1185631
public function value() {
		if($this->getOption('disabled'))
			return isset($this->options['default']) ? $this->options['default']:null;
		return $this->value;
	}