private function handleFilter(
        QueryBuilder $queryBuilder,
        ClassMetadata $resourceMetadata,
        array $aliases,
        array $associationsMetadata,
        $property,
        $value,
        $parameter = null
    ) {
        $queryExpr = [];

        /*
         * simple (case 1):
         * $property = name
         *
         * relation (case 2):
         * $property = relatedDummy_name
         * $property = relatedDymmy_id
         * $property = relatedDummy_user_id
         * $property = relatedDummy_user_name
         */
        if (false !== strpos($property, '.')) {
            $explodedProperty = explode('.', $property);
        } else {
            $explodedProperty = explode('_', $property);
        }
        // we are in case 2
        $property = array_pop($explodedProperty);
        $alias = $this->getResourceAliasForProperty($aliases, $explodedProperty);
        $aliasMetadata = $this->getAssociationMetadataForProperty(
            $resourceMetadata,
            $associationsMetadata,
            $explodedProperty
        );

        if (true === $aliasMetadata->hasField($property)) {
            // Entity has the property
            if (is_array($value)) {
                foreach ($value as $operator => $operand) {
                    // Case where there is an operator
                    $queryExpr[] = $this->handleOperator(
                        $queryBuilder,
                        $alias,
                        $aliasMetadata,
                        $property,
                        $operator,
                        $operand,
                        $parameter
                    );
                }
            } else {
                // Simple where
                $value = $this->normalizeValue($aliasMetadata, $property, $value);
                if (null === $value) {
                    $queryExpr[] = $queryBuilder->expr()->isNull(sprintf('%s.%s', $alias, $property));
                } else {
                    if (null === $parameter) {
                        $parameter = $property;
                    }
                    $queryExpr[] = $queryBuilder->expr()->eq(
                        sprintf('%s.%s', $alias, $property),
                        sprintf(':%s', $parameter)
                    );
                    $queryBuilder->setParameter($parameter, $value);
                }
            }
        }

        return $queryExpr;
    }