Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
accessor example
$query
->
andWhere
(
implode
(
' AND ',
$parsed
->
getWheres
(
)
)
)
;
}
private
function
createNestedQuery
(
AssociationField
$field
, EntityDefinition
$definition
, Context
$context
)
: QueryBuilder
{
$query
=
new
QueryBuilder
(
$this
->connection
)
;
if
(
$field
instanceof OneToManyAssociationField
)
{
$reference
=
$field
->
getReferenceDefinition
(
)
;
$alias
=
$definition
->
getEntityName
(
)
. '.' .
$field
->
getPropertyName
(
)
;
$query
->
addSelect
(
self::
accessor
(
$alias
,
$field
->
getReferenceField
(
)
)
. ' as id'
)
;
if
(
$definition
->
isVersionAware
(
)
)
{
$query
->
addSelect
(
self::
accessor
(
$alias
,
$definition
->
getEntityName
(
)
. '_version_id'
)
)
;
}
$query
->
from
(
self::
escape
(
$reference
->
getEntityName
(
)
)
, self::
escape
(
$alias
)
)
;
$query
->
addState
(
$alias
)
;
return
$query
;
}
if
(
$field
instanceof ManyToOneAssociationField ||
$field
instanceof OneToOneAssociationField
)
{