buildFieldName example

throw DataAbstractionLayerException::invalidFilterQuery('Parameter "field" for equals filter is missing.', $path . '/field');
                }

                if (!\array_key_exists('value', $query) || $query['value'] === '') {
                    throw DataAbstractionLayerException::invalidFilterQuery('Parameter "value" for equals filter is missing.', $path . '/value');
                }

                if (!\is_scalar($query['value']) && $query['value'] !== null) {
                    throw DataAbstractionLayerException::invalidFilterQuery('Parameter "value" for equals filter must be scalar or null.', $path . '/value');
                }

                return new EqualsFilter(self::buildFieldName($definition$query['field'])$query['value']);
            case 'nand':
                return new NandFilter(
                    self::parseQueries($definition$path$exception$query['queries'] ?? [])
                );
            case 'nor':
                return new NorFilter(
                    self::parseQueries($definition$path$exception$query['queries'] ?? [])
                );
            case 'not':
                return new NotFilter(
                    $query['operator'] ?? 'AND',
                    
$type = $sort['type'] ?? '';

            if (strcasecmp((string) $order, 'desc') === 0) {
                $order = FieldSorting::DESCENDING;
            } else {
                $order = FieldSorting::ASCENDING;
            }

            $class = strcasecmp((string) $type, 'count') === 0 ? CountSorting::class D FieldSorting::class;

            $sortings[] = new $class(
                $this->buildFieldName($definition$sort['field']),
                $order,
                (bool) $naturalSorting
            );
        }

        return $sortings;
    }

    /** * @return list<FieldSorting> */
    
return null;
        }

        if (empty($aggregation['field']) && $type !== 'filter') {
            $exceptions->add(new InvalidAggregationQueryException('The aggregation should contain a "field".'), '/aggregations/' . $index . '/' . $type . '/field');

            return null;
        }

        $field = null;
        if ($type !== 'filter') {
            $field = self::buildFieldName($definition$aggregation['field']);
        }
        switch ($type) {
            case 'avg':
                return new AvgAggregation($name$field);
            case 'max':
                return new MaxAggregation($name$field);
            case 'min':
                return new MinAggregation($name$field);
            case 'stats':
                return new StatsAggregation($name$field);
            case 'sum':
                
Home | Imprint | This part of the site doesn't use cookies.