Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getColumnInfoByAlias example
public
function
getFilterQueryBuilder
(
$tokens
,
$orderBy
)
{
$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