Get material

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

@see getDefaultMaterial()

@return string|null material or null if no material has been set
438919
public function getMaterial() : ?string 
    {
        if ( ! $this->hasMaterial()) {
            $this->setMaterial($this->getDefaultMaterial());
        }
        return $this->material;
    }
136344
public function getValue() {
        if (!is_null($this->value))
            return $this->value;
        $value = $this->getArrayValue($this->form->method == 'POST' ? $_POST : $_GET, $this->getName());
        if ($value) {
            return $value;
        }
        $key = null;
        if (false !== strpos($this->name, '[')){
            $name = explode('[', $this->name, 2);
            $key = substr($name[1], 0, strlen($name[1]) - 1);
            $name = $name[0];
        } else {
            $name = $this->name;
        }
        if ($this->form->model && is_object($this->form->model) && (!$this->form->model->isNewRecord() || $this->form->model->$name)) {
            $val = $this->form->model->$name;
            if (!is_null($key)){
                return isset($val[$key])?$val[$key]:null;
            } else {
                return $val;
            }
        }
        return $this->defaultValue;
    }
201039
public function getDefaultStringFormat()
    {
        if (!$this->defaultStringFormat && $this->getDatabase() && $this->getDatabase()->getDefaultStringFormat()) {
            return $this->getDatabase()->getDefaultStringFormat();
        }

        return $this->defaultStringFormat;
    }
834016
public function get_default_value() {
        $defaultvalue = $this->get_field()->get_configdata_property('defaultvalue');
        if ('' . $defaultvalue !== '') {
            $options = field_controller::get_options_array($this->get_field());
            $key = array_search($defaultvalue, $options);
            if ($key !== false) {
                return $key;
            }
        }
        return 0;
    }
91149
public function getDefaultValues()
    {
        $result = [];

        foreach ($this->getFormFields() as $attribute => $field) {
            if (($value = array_get($field, 'default')) === null) {
                continue;
            }

            $result[$attribute] = $value;
        }

        return $result;
    }
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);
        }
    }
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();
    }
147582
public function getDefaultTheme()
    {
        if (!$this->_defaultTheme) {
            $keys = $this->keys(); /// shame to PHP it can't be done in single line :(
            $this->_defaultTheme = reset($keys);
        }

        return $this->_defaultTheme;
    }
856801
public function get_static_value() {
        $value = $this->get_value();
        if ($value === false) {
            $value = $this->attributes['defaultvalue'];
        }
        if (!empty($value)) {
            if ($this->attributes['type'] === 'date_selector' ||
                    $this->attributes['type'] === 'date_time_selector') {
                return userdate($value);
            }
        }
        return $value;
    }
1367768
public function get_defaultsetting() {
        $adminroot =  admin_get_root(false, false);
        if (!empty($adminroot->custom_defaults)) {
            $plugin = is_null($this->plugin) ? 'moodle' : $this->plugin;
            if (isset($adminroot->custom_defaults[$plugin])) {
                if (array_key_exists($this->name, $adminroot->custom_defaults[$plugin])) { // null is valid value here ;-)
                    return $adminroot->custom_defaults[$plugin][$this->name];
                }
            }
        }
        return $this->defaultsetting;
    }
53247
protected function defaultFormat()
    {
        $format = $this->detectFormatByHeaders($this->getHeaders());
        if ($format === null) {
            $format = $this->detectFormatByContent($this->getContent());
        }

        return $format;
    }
1257446
public function getTemplate() : ?string 
    {
        if ( ! $this->hasTemplate()) {
            $this->setTemplate($this->getDefaultTemplate());
        }
        return $this->template;
    }
381421
public function getDefaultTemplate() {
        if ($this->_defaultTemplate) return $this->_defaultTemplate;
 
		if ($this->template) {
			$path_parts = pathinfo($this->template);
			if ($path_parts['extension'] == 'php') {
				$app = Application::getInstance();
				if (file_exists( $app->getTemplatePath($this->template))) {
					$this->_defaultTemplate = $this->template;
				}
				else {
					$this->_defaultTemplate = $this->parent->getDefaultTemplate();
				}
			}
			else {
				$this->_defaultTemplate = $this->template;
			}
		}
		else {
			$this->_defaultTemplate = $this->parent->getDefaultTemplate();
		}

        return $this->_defaultTemplate;
    }
1162446
function getCurrentStackItem() {
		$topItem = end($this->statements);

		if (!empty($topItem)) {
			return $topItem;
		} else {
			// In case of a empty stack, we are at the root of a PHP file (with no class or function).
			// We return the default values
			return $this->getDefaultItem();
		}
	}
1197560
public function getText() : ?string 
    {
        if ( ! $this->hasText()) {
            $this->setText($this->getDefaultText());
        }
        return $this->text;
    }
803446
public function getDefault()
    {
        $category = $this->getCategory();

        $categoryConfig = $this->getCategoryConfig($category);

        if (!isset($categoryConfig[ModelInterface::DEFAULT_CONTEXT])) {
            throw new DefaultMissingException(
                'ConfigModel requires default to be set'
            );
        }

        return $categoryConfig[ModelInterface::DEFAULT_CONTEXT];
    }
564484
public function getPhpDefaultValue()
    {
        if (null === $this->defaultValue) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
        }

        if (in_array($this->mappingType, [ PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU ])) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->mappingType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }
        if (PropelTypes::SET === $this->mappingType) {
            return $this->getDefaultValueForSet($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }