Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMappingSourceColumn example
$alias
=
$context
->
getAlias
(
)
. '.' .
$field
->
getPropertyName
(
)
;
if
(
$context
->
getQuery
(
)
->
hasState
(
$alias
)
)
{
return
$alias
;
}
$context
->
getQuery
(
)
->
addState
(
$alias
)
;
$context
->
getQuery
(
)
->
addState
(
EntityDefinitionQueryHelper::HAS_TO_MANY_JOIN
)
;
$mappingAlias
=
$alias
. '.mapping';
$source
=
$this
->
getMappingSourceColumn
(
$context
->
getAlias
(
)
,
$field
,
$context
->
getContext
(
)
)
;
$parameters
=
[
'#root#' => EntityDefinitionQueryHelper::
escape
(
$context
->
getAlias
(
)
)
,
'#source#' =>
$source
,
'#alias#' => EntityDefinitionQueryHelper::
escape
(
$mappingAlias
)
,
'#reference_column#' => EntityDefinitionQueryHelper::
escape
(
$field
->
getMappingLocalColumn
(
)
)
,
]
;
$context
->
getQuery
(
)
->
leftJoin
(
EntityDefinitionQueryHelper::
escape
(
$context
->
getAlias
(
)
)
,
EntityDefinitionQueryHelper::
escape
(
$field
->
getMappingDefinition
(
)
->
getEntityName
(
)
)
,