getAssociationPath example

$fields = EntityDefinitionQueryHelper::getFieldsOfAccessor($definition$variable, true);

            /** @var Field|null $lastField */
            $lastField = end($fields);

            $runtime = new Runtime();

            if ($lastField && $lastField->getFlag(Runtime::class)) {
                $associations = array_merge($associations$runtime->getDepends());
            }

            $associations[] = EntityDefinitionQueryHelper::getAssociationPath($variable$definition);
        }

        return array_filter(array_unique($associations));
    }
}
$e = new RenderProductException($e->getMessage());

            $loggingEvent = new ProductExportLoggingEvent($context->getContext()$e->getMessage(), Level::Warning, $e);

            $this->eventDispatcher->dispatch($loggingEvent);

            throw $e;
        }

        $associations = [];
        foreach ($variables as $variable) {
            $associations[] = EntityDefinitionQueryHelper::getAssociationPath($variable$this->productDefinition);
        }

        return array_filter(array_unique($associations));
    }
}
$tokens = $this->tokenizer->tokenize((string) $criteria->getTerm());
        $tokens = $this->tokenFilter->filter($tokens$context);

        foreach ($tokens as $token) {
            $tokenBool = new BoolQuery();

            foreach ($searchConfig as $item) {
                if ($this->elasticsearchHelper->enabledMultilingualIndex()) {
                    $config = new SearchFieldConfig((string) $item['field'](int) $item['ranking'](bool) $item['tokenize']);
                    $field = $this->helper->getField($config->getField()$this->productDefinition, $this->productDefinition->getEntityName(), false);
                    $association = $this->helper->getAssociationPath($config->getField()$this->productDefinition);
                    $root = $association ? explode('.', $association)[0] : null;

                    if ($field instanceof TranslatedField) {
                        $this->buildTranslatedFieldTokenQueries($tokenBool$token$config$context$root);

                        continue;
                    }

                    $this->buildTokenQuery($tokenBool$token$config$root);

                    continue;
                }
Home | Imprint | This part of the site doesn't use cookies.