getReferenceColumn example

array_keys($parameters),
                array_values($parameters),
                '#source# = #alias#.#reference_column# '
                . $this->buildMappingVersionWhere($field$context->getDefinition())
            )
        );

        $parameters = [
            '#mapping#' => EntityDefinitionQueryHelper::escape($mappingAlias),
            '#source_column#' => EntityDefinitionQueryHelper::escape($field->getMappingReferenceColumn()),
            '#alias#' => EntityDefinitionQueryHelper::escape($alias),
            '#reference_column#' => $this->getReferenceColumn($context$field),
        ];

        $context->getQuery()->leftJoin(
            EntityDefinitionQueryHelper::escape($mappingAlias),
            EntityDefinitionQueryHelper::escape($field->getToManyReferenceDefinition()->getEntityName()),
            EntityDefinitionQueryHelper::escape($alias),
            str_replace(
                array_keys($parameters),
                array_values($parameters),
                '#mapping#.#source_column# = #alias#.#reference_column# '
                . $this->buildVersionWhere($field->getToManyReferenceDefinition()$field)
            )
$context->getQuery()->addState(EntityDefinitionQueryHelper::HAS_TO_MANY_JOIN);

        $alias = $context->getAlias() . '.' . $field->getPropertyName();
        if ($context->getQuery()->hasState($alias)) {
            return $alias;
        }

        $context->getQuery()->addState($alias);

        $source = $this->getSourceColumn($context$field);

        $referenceColumn = $this->getReferenceColumn($context$field);

        $parameters = [
            '#source#' => $source,
            '#alias#' => EntityDefinitionQueryHelper::escape($alias),
            '#reference_column#' => $referenceColumn,
            '#root#' => EntityDefinitionQueryHelper::escape($context->getAlias()),
        ];

        $versionWhere = $this->buildVersionWhere($context$field);

        $context->getQuery()->leftJoin(
            

        $context->getQuery()->addState($alias);

        $reference = $field->getReferenceDefinition();

        $table = $reference->getEntityName();

        $versionAware = $context->getDefinition()->isVersionAware() && $reference->isVersionAware();

        $source = $this->getSourceColumn($context->getDefinition()$field$context->getAlias()$context->getContext());

        $referenceColumn = $this->getReferenceColumn($field$context->getContext());

        // specified version requested, use sub version call to solve live version or specified         if ($versionAware && $context->getContext()->getVersionId() !== Defaults::LIVE_VERSION) {
            $this->joinVersion($field$context->getAlias()$alias$context->getQuery()$context->getContext()$source$referenceColumn);

            return $alias;
        }

        // No Blacklisting Whitelisting for ManyToOne Association because of possible Dependencies on subentities         $parameters = [
            '#source#' => $source,
            
if ($definition->isVersionAware()) {
            $query->addSelect(self::accessor($mappingAlias$definition->getEntityName() . '_version_id'));
        }

        $query->from(self::escape($reference->getEntityName()), self::escape($mappingAlias));
        $query->addState($alias);

        $parameters = [
            '#mapping#' => self::escape($mappingAlias),
            '#source_column#' => self::escape($field->getMappingReferenceColumn()),
            '#alias#' => self::escape($alias),
            '#reference_column#' => $this->getReferenceColumn($context$field),
        ];

        $query->leftJoin(
            self::escape($mappingAlias),
            self::escape($field->getToManyReferenceDefinition()->getEntityName()),
            self::escape($alias),
            str_replace(
                array_keys($parameters),
                array_values($parameters),
                '#mapping#.#source_column# = #alias#.#reference_column# '
                . $this->buildMappingVersionWhere($field->getToManyReferenceDefinition()$field)
            )
Home | Imprint | This part of the site doesn't use cookies.