src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php
protected function getMetadata(string $resourceClass, string $property): array
    {
        $noop = [null, null, null, null];

        if (!$this->hasProperty($resourceClass, $property)) {
            return $noop;
        }

        $properties = explode('.', $property);
        $totalProperties = \count($properties);
        $currentResourceClass = $resourceClass;
        $hasAssociation = false;
        $currentProperty = null;
        $type = null;

        foreach ($properties as $index => $currentProperty) {
            try {
                $propertyMetadata = $this->propertyMetadataFactory->create($currentResourceClass, $currentProperty);
            } catch (PropertyNotFoundException $e) {
                return $noop;
            }

            if (null === $type = $propertyMetadata->getType()) {
                return $noop;
            }

            ++$index;
            $builtinType = $type->getBuiltinType();

            if (Type::BUILTIN_TYPE_OBJECT !== $builtinType && Type::BUILTIN_TYPE_ARRAY !== $builtinType) {
                if ($totalProperties === $index) {
                    break;
                }

                return $noop;
            }

            if ($type->isCollection() && null === $type = $type->getCollectionValueType()) {
                return $noop;
            }

            if (Type::BUILTIN_TYPE_ARRAY === $builtinType && Type::BUILTIN_TYPE_OBJECT !== $type->getBuiltinType()) {
                if ($totalProperties === $index) {
                    break;
                }

                return $noop;
            }

            if (null === $className = $type->getClassName()) {
                return $noop;
            }

            if ($isResourceClass = $this->resourceClassResolver->isResourceClass($className)) {
                $currentResourceClass = $className;
            } elseif ($totalProperties !== $index) {
                return $noop;
            }

            $hasAssociation = $totalProperties === $index && $isResourceClass;
        }

        return [$type, $hasAssociation, $currentResourceClass, $currentProperty];
    }
protected function getMetadata(string $resourceClass, string $property): array
    {
        $noop = [null, null, null, null];

        if (!$this->hasProperty($resourceClass, $property)) {
            return $noop;
        }

        $properties = explode('.', $property);
        $totalProperties = \count($properties);
        $currentResourceClass = $resourceClass;
        $hasAssociation = false;
        $currentProperty = null;
        $type = null;

        foreach ($properties as $index => $currentProperty) {
            try {
                $propertyMetadata = $this->propertyMetadataFactory->create($currentResourceClass, $currentProperty);
            } catch (PropertyNotFoundException $e) {
                return $noop;
            }

            if (null === $type = $propertyMetadata->getType()) {
                return $noop;
            }

            ++$index;
            $builtinType = $type->getBuiltinType();

            if (Type::BUILTIN_TYPE_OBJECT !== $builtinType && Type::BUILTIN_TYPE_ARRAY !== $builtinType) {
                if ($totalProperties === $index) {
                    break;
                }

                return $noop;
            }

            if ($type->isCollection() && null === $type = $type->getCollectionValueType()) {
                return $noop;
            }

            if (Type::BUILTIN_TYPE_ARRAY === $builtinType && Type::BUILTIN_TYPE_OBJECT !== $type->getBuiltinType()) {
                if ($totalProperties === $index) {
                    break;
                }

                return $noop;
            }

            if (null === $className = $type->getClassName()) {
                return $noop;
            }

            if ($isResourceClass = $this->resourceClassResolver->isResourceClass($className)) {
                $currentResourceClass = $className;
            } elseif ($totalProperties !== $index) {
                return $noop;
            }

            $hasAssociation = $totalProperties === $index && $isResourceClass;
        }

        return [$type, $hasAssociation, $currentResourceClass, $currentProperty];
    }
protected function getMetadata ( string $ resourceClass , string $ property ) : array { $ noop = [ null , null , null , null ] ; if ( ! $ this -> hasProperty ( $ resourceClass , $ property ) ) { return $ noop ; } $ properties = explode ( '.' , $ property ) ; $ totalProperties = \ count ( $ properties ) ; $ currentResourceClass = $ resourceClass ; $ hasAssociation = false ; $ currentProperty = null ; $ type = null ; foreach ( $ properties as $ index => $ currentProperty ) { try { $ propertyMetadata = $ this -> propertyMetadataFactory -> create ( $ currentResourceClass , $ currentProperty ) ; } catch ( PropertyNotFoundException $ e ) { return $ noop ; } if ( null === $ type = $ propertyMetadata -> getType ( ) ) { return $ noop ; } ++ $ index ; $ builtinType = $ type -> getBuiltinType ( ) ; if ( Type :: BUILTIN_TYPE_OBJECT !== $ builtinType && Type :: BUILTIN_TYPE_ARRAY !== $ builtinType ) { if ( $ totalProperties === $ index ) { break ; } return $ noop ; } if ( $ type -> isCollection ( ) && null === $ type = $ type -> getCollectionValueType ( ) ) { return $ noop ; } if ( Type :: BUILTIN_TYPE_ARRAY === $ builtinType && Type :: BUILTIN_TYPE_OBJECT !== $ type -> getBuiltinType ( ) ) { if ( $ totalProperties === $ index ) { break ; } return $ noop ; } if ( null === $ className = $ type -> getClassName ( ) ) { return $ noop ; } if ( $ isResourceClass = $ this -> resourceClassResolver -> isResourceClass ( $ className ) ) { $ currentResourceClass = $ className ; } elseif ( $ totalProperties !== $ index ) { return $ noop ; } $ hasAssociation = $ totalProperties === $ index && $ isResourceClass ; } return [ $ type , $ hasAssociation , $ currentResourceClass , $ currentProperty ] ; }
Gets info about the decomposed given property for the given resource class.

Returns an array with the following info as values:
- the {@see Type} of the decomposed given property
- is the decomposed given property an association?
- the resource class of the decomposed given property
- the property name of the decomposed given property
Gets info about the decomposed given property for the given resource class .