Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
filterJoinEntities example
$joinEntities
=
$this
->
getDqlHelper
(
)
->
getJoinColumns
(
$tokens
)
;
$orderByInfo
= null;
if
(
isset
(
$orderBy
[
'property'
]
)
)
{
$orderByInfo
=
$this
->
getDqlHelper
(
)
->
getColumnInfoByAlias
(
$orderBy
[
'property'
]
)
;
if
(
$orderByInfo
)
{
$entity
=
$this
->
getDqlHelper
(
)
->
getEntityForPrefix
(
strtolower
(
$orderByInfo
[
'entity'
]
)
)
;
$joinEntities
[
$entity
]
=
$entity
;
}
}
$joinEntities
=
$this
->
filterJoinEntities
(
$joinEntities
)
;
$builder
=
$this
->
getDqlHelper
(
)
->
getEntityManager
(
)
->
createQueryBuilder
(
)
->
select
(
'partial detail.{id}'
)
->
from
(
Detail::
class
, 'detail'
)
// only products with attributes are considered to be valid ->
innerJoin
(
'detail.attribute', 'attr'
)
->
leftJoin
(
'detail.article', 'article'
)
;
foreach
(
$joinEntities
as
$entity
)
{
$join
=
$this
->
getDqlHelper
(
)
->
getAssociationForEntity
(
$entity
)
;
if
(
!\
is_string
(
$join
)
)
{