Get a constant value from its name.

@param unknown_type $name The name of the constant, as per QTI spec.
@return integer|boolean The constant value or false if not found.
325808
public static function getConstantByName($name)
    {
        switch (strtolower($name)) {
            case 'single':
                return self::SINGLE;
            break;

            case 'multiple':
                return self::MULTIPLE;
            break;

            case 'ordered':
                return self::ORDERED;
            break;

            case 'record':
                return self::RECORD;
            break;

            default:
                return false;
            break;
        }
    }
1295803
public function getFieldValue($name)
    {
        $value = null;
        $field = $this->getField($name);
        if (null !== $this->getField($name)) {
            $value = (array_key_exists('value', $field) && null !== $field['value']) ? $field['value'] : null;
        }
        return $value;
    }
1227075
public function getTemplateName (string $type, string $name) : string
    {
        $component = $this->finder->findComponent($type, $name);

        if (null === $component)
        {
            throw new UnknownComponentException($name, $type);
        }

        return $component->getImportPath();
    }
262634
public static function getType($name, &$type=null) {
		if( !isset(static::$types[$name]) ) {
			throw new Exception('unknownType_'.$name);
		}
		$type	= &static::$types[$name];
		return $type;
	}
1039291
public function getBoolValue($name):?bool
    {
        $value = $this->offsetGet($name);
        if (is_null($value)) {
            return null;
        }

        return (boolean)$value;
    }
776296
public function values($name)
    {
        return $this->map(function (EntityInterface $entity) use ($name) {
            return $entity->getByName($name);
        });
    }
847276
public function getConstant($name, $object = null)
    {
        if ($object !== null) {
            $name = sprintf('%s::%s', get_class($object), $name);
        }

        return constant($name);
    }
590844
public static function getVariableType(string $name): string
    {
        self::loadData();
        $kbEntry = self::getVariable($name);
        if (isset($kbEntry->t)) {
            return Search::$data->varTypes->{$kbEntry->t};
        } else {
            throw new KBException("$name does have a known type !");
        }
    }
52734
public static function get($name)
	{
		return isset(self::$configParams[$name])
			? self::$configParams[$name]
			: null;
	}
1100484
public function getFieldValue($name)
    {
        $fieldValues = $this->toArray();
        return (isset($fieldValues[$name])) ? $fieldValues[$name] : null;
    }
517151
public static function getTypeFromName(string $name): int
    {
        $type = array_search(strtoupper(trim($name)), self::$names);
        if (false === $type || !is_int($type)) {
            throw new \InvalidArgumentException(sprintf('RData type "%s" is not defined.', $name));
        }

        return $type;
    }
319993
public function getValue($name)
    {
        if (! is_string($name)) {
            return null;
        }

        try {
            $Comet = \CometPHP\Comet::getInstance();
        } catch (\CometPHP\Exceptions\CometNotBooted $e) {
            return null;
        }

        $bits = explode('.', $name);
        $postData = $Comet['request']->request->all();

        foreach ($bits as $key) {
            if (is_array($postData) && isset($postData[$key])) {
                $postData = $postData[$key];
            } else {
                return null;
            }
        }

        return $postData;
    }
65401
public function getValue($name = 'key')
    {
        if (!isset($this->rawData[$name])) {
            return null;
        }

        return $this->rawData[$name];
    }
1344477
public function getValueByName(string $name, $default = null)
    {
        if (isset($this->values[$name])) {
            return $this->parseType($this->values[$name]);
        }

        return $default;
    }
732710
public static function consts($name)
    {
        $name = strtoupper($name) . '_';
        $constants = [];
        foreach ((new \ReflectionClass(static::class))->getConstants() as $cName => $cValue) {
            if (strpos($cName, $name) === 0) {
                $constants[$cValue] = strtolower(substr($cName, strlen($name)));
            }
        }

        if (!$constants) {
            throw new MisuseException(['starts with `:1` constants is not exists in `:2` model', $name, static::class]);
        }

        return $constants;
    }
1229102
public function getOptionNameFromDefinition($constant_name)
    {
        if ($this->strStartsWith($constant_name, "'") && $this->strEndsWith($constant_name, "'")) {
            return trim(trim($constant_name, "'")); // single quote
        } else {
            if ($this->strStartsWith($constant_name, '"') && $this->strEndsWith($constant_name, '"')) {
                return trim(trim($constant_name, '"')); // double quote
            } else {
                return $constant_name;
            }
        }
    }
554799
protected function getValue(string $name) : ?string
    {
        $checkName = $this->envPrefix . strtoupper($name);
        return $this->environmentVariables[$checkName] ?? null;
    }