Returns a mormalizer that is applied to fields of the given data type.

@param string $data_type
The data type the normalizer is applied to.

@return NormalizerInterface
331659
public function getNormalizer($data_type)
    {
        if (!isset($this->_normalizers[$data_type])) {
            $message = 'Normalizer not attached for data type: ' . $data_type;
            throw new \InvalidArgumentException($message);
        }
        return $this->_normalizers[$data_type];
    }
176404
private function normalizeData($data, \stdClass $schema)
    {
        if (\is_array($data)) {
            return $this->normalizeArray(
                $data,
                $schema
            );
        }

        if ($data instanceof \stdClass) {
            return $this->normalizeObject(
                $data,
                $schema
            );
        }

        return $data;
    }
464500
public static function dataTypeToEavColumn($type)
    {
        switch ($type) {
            case Property::DATA_TYPE_FLOAT:
                return 'value_float';
                break;

            case Property::DATA_TYPE_BOOLEAN:
            case Property::DATA_TYPE_INTEGER:
                return 'value_integer';
                break;

            case Property::DATA_TYPE_TEXT:
            case Property::DATA_TYPE_PACKED_JSON:
            case Property::DATA_TYPE_INVARIANT_STRING:
                return 'value_text';
                break;

            case Property::DATA_TYPE_STRING:
            default:
                return 'value_string';
                break;
        }
    }
1334127
private function determine( $type, $key_type = false ) {
		if ( ! $key_type && $this->non_scalar_type_exists( $type ) ) {
			return $type;
		}

		if ( $scalar_type = $this->determine_scalar( $type ) ) {
			if ( $key_type && (in_array( $scalar_type, array( 'double', 'boolean' ) )) ) {
				throw new InvalidArgumentException( 'This type is not supported as a key.' );
			}

			return $scalar_type;
		}

		throw new InvalidArgumentException( 'This type does not exist.' );
	}
375162
public static function normalizeDataType(string $type): string
    {
        $searchType = strtolower($type);

        return array_key_exists($searchType, self::$normalizations) ? self::$normalizations[$searchType] : $type;
    }
250544
protected function normalizeType(string $type) : string
    {
        $type = ltrim($type, '\\');
        foreach (self::module()->namespaces as $name => $namespace) {
            if (strpos($type, $namespace->getClassNamespace()) !== false) {
                return $name . substr($type, strlen($namespace->getClassNamespace()) + 1);
            }
        }

        return null;
    }
810375
public function supportsDenormalization($data, $type, $format = null)
    {
        return in_array($type, static::$classes) or in_array($type, static::$types)
           and is_string($data) and preg_match(static::REGEX, $data) > 0;
    }
59609
function mapFieldTypeToBindType($field_type)
    {
        switch ($field_type) {
        case MYSQLI_TYPE_DECIMAL:
        case MYSQLI_TYPE_NEWDECIMAL:
        case MYSQLI_TYPE_FLOAT:
        case MYSQLI_TYPE_DOUBLE:
        case MYSQLI_TYPE_BIT:
        case MYSQLI_TYPE_TINY:
        case MYSQLI_TYPE_SHORT:
        case MYSQLI_TYPE_LONG:
        case MYSQLI_TYPE_LONGLONG:
        case MYSQLI_TYPE_INT24:
        case MYSQLI_TYPE_YEAR:
        case MYSQLI_TYPE_ENUM:
            return 'number';

        case MYSQLI_TYPE_DATE:
            return 'date';

        case MYSQLI_TYPE_TIME:
            return 'time';
        case MYSQLI_TYPE_TIMESTAMP:
        case MYSQLI_TYPE_DATETIME:
        case MYSQLI_TYPE_NEWDATE:
            return 'datetime';
        
        case MYSQLI_TYPE_VAR_STRING:
        case MYSQLI_TYPE_STRING:
        case MYSQLI_TYPE_CHAR:
        case MYSQLI_TYPE_GEOMETRY:
        case MYSQLI_TYPE_TINY_BLOB:
        case MYSQLI_TYPE_MEDIUM_BLOB:
        case MYSQLI_TYPE_LONG_BLOB:
        case MYSQLI_TYPE_BLOB:
            return 'string';

        default:
            return 'unknown';
        }
    }
925371
protected function normalizeRelationsData()
    {
        if (is_null($this->data['relationships'])) {
            $this->data['relationships'] = [];
        }

        foreach ([ 'normal', 'reverse', 'image', 'file', 'checkbox', 'category' ] as $key) {

            if (    ! array_key_exists($key, $this->data['relationships'])
                ||  ! is_array($this->data['relationships'][ $key ])
            ) {
                $this->data->relationships[ $key ] = [];
            }
        }

        return $this;
    }
509266
public function getModelFieldType($type)
    {
        $type = preg_replace('/\(.*/', '', strtolower($type)); // remove parenthesis

        if (substr($type, 0, 7) == 'varchar' || substr($type, 0, 4) == 'char' || substr($type, 0, 4) == 'enum') {
            $type = null;
        }

        if ($type == 'tinyint') {
            $type = 'boolean';
        }

        if ($type == 'int') {
            $type = 'integer';
        }

        if ($type == 'decimal') {
            $type = 'float';
        }

        if ($type == 'longtext' || $type == 'longblob') {
            $type = 'text';
        }

        return $type;
    }
976493
public function normalizeColumns($data, $typeOnly = true)
	{
		$results = [];

		// If we only want the type as the value add just that to the list
		if ($typeOnly)
		{
			foreach ($data as $field)
			{
				// @FIXME: should we try to normalize types too?
				$results[$field->name] = $field->type;
			}
		}
		// If we want the whole field data object add that to the list
		else
		{
			foreach ($data as $field)
			{
				$results[$field->name] =
				[
					'name'      => $field->name,
					'type'      => $field->type,
					'allownull' => $field->notnull ? false : true,
					'default'   => $field->dflt_value,
					'pk'        => $field->pk ? true : false
				];
			}
		}

		return $results;
	}
837129
public function getReferencingFields($entity_type, $target_type) {
    $fields = $this->entityQuery->get('field_storage_config')
      ->condition('entity_type', $entity_type)
      ->condition('settings.target_type', $target_type)
      ->execute();
    if (!is_array($fields)) {
      $fields = [$fields];
    }
    return $fields;
  }
727262
public static function parseDocTypeObject($type)
    {
        if ($type instanceof \phpDocumentor\Reflection\Types\Object_) {
            $tmpObject = (string) $type->getFqsen();
            if ($tmpObject) {
                return $tmpObject;
            }

            return 'object';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Compound) {
            $types = [];
            foreach ($type as $subType) {
                $types[] = self::parseDocTypeObject($subType);
            }

            return $types;
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Array_) {
            $valueTypeTmp = $type->getValueType() . '';
            if ($valueTypeTmp !== 'mixed') {
                return $valueTypeTmp . '[]';
            }

            return 'array';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Null_) {
            return 'null';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Mixed_) {
            return 'mixed';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Scalar) {
            return 'string|int|float|bool';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Boolean) {
            return 'bool';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Callable_) {
            return 'callable';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Float_) {
            return 'float';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\String_) {
            return 'string';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Integer) {
            return 'int';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Void_) {
            return 'void';
        }

        if ($type instanceof \phpDocumentor\Reflection\Types\Resource_) {
            return 'resource';
        }

        return $type . '';
    }
154568
protected static function extractColumnInfoFromDataTypes(
        $dataTypes,
        QuoteInterface $db,
        &$modifiers,
        &$modifiersInitial = array(),
        &$sequences = array(),
        &$defaults = array(),
        $cast = false
    )
    {

        $modifiers = array();
        $modifiersInitial = array();
        $sequences = array();
        $defaults = array();

        foreach( $dataTypes as $name => $dataType ) {

            $modifiers[$name] = $dataType->getQueryModifier( $db, $cast );

            // we got initial data we need to check
            if( $dataType->isInitialProperty() and $dataType->isPrimaryKey() ) {
                $modifiersInitial[$name] = $modifiers[$name];
            }

            // we got default?
            if( $default = $dataType->getDefault() ) {

                if( $dataType->isSequence( $sequenceName ) ) {
                    $sequences[$name] = $sequenceName;
                } else {
                    $defaults[$name] = $default;
                }

            }

        }

    }
827827
protected function createConfiguration($dataType)
    {
        if (!isset($this->generatedPropertyMappingConfigurations[$dataType])) {
            $propertyMappingConfiguration = new PropertyMappingConfiguration();
            $propertyMappingConfiguration->allowAllProperties();

            $parsedType = [
                'elementType' => null,
                'type' => $dataType
            ];
            // Special handling for "reference(s)", should be deprecated and normlized to array<NodeInterface>
            if ($dataType !== 'references' && $dataType !== 'reference') {
                $parsedType = TypeHandling::parseType($dataType);
            }

            if ($this->setTypeConverterForType($propertyMappingConfiguration, $dataType) === false) {
                $this->setTypeConverterForType($propertyMappingConfiguration, $parsedType['type']);
            }

            $elementConfiguration = $propertyMappingConfiguration->forProperty('*');
            $this->setTypeConverterForType($elementConfiguration, $parsedType['elementType']);

            $this->generatedPropertyMappingConfigurations[$dataType] = $propertyMappingConfiguration;
        }

        return $this->generatedPropertyMappingConfigurations[$dataType];
    }
461256
public function supportsDenormalization($data, $type, $format = null)
    {
        return in_array($type, static::$types)
           and is_string($data) and preg_match(static::SIMPLE_REGEX, $data) > 0;
    }
647041
private function getFiltersNormalizer(): Closure
    {
        return function(Options $options, $data) {
            $normalizedData = [];

            foreach ($data as $name => $field) {
                if (is_string($field)) {
                    $field = [
                        'type' => $field,
                        'options' => [],
                    ];
                }
                $field['name'] = $name;

                $resolver = new OptionsResolver();
                $filterConfiguration = new FilterConfiguration();
                $filterConfiguration->configureOptions($resolver);
                $filterConfiguration->setParameters($resolver->resolve($field));

                $normalizedData[$name] = $filterConfiguration->getParameters();
            }

            return $normalizedData;
        };
    }