public function getNavigationAction() { $node =
(int) $this->
Request()->
getParam('node'
);
$filter =
$this->
Request()->
getParam('filter'
);
$repository =
$this->
getRepository('form'
);
$user =
Shopware()->
Container()->
get('auth'
)->
getIdentity();
/** @var Locale $locale */
$locale =
$user->locale;
$fallback =
$this->
getFallbackLocaleId($locale->
getId());
$builder =
$repository->
createQueryBuilder('form'
) ->
leftJoin('form.elements', 'element'
) ->
leftJoin('element.translations', 'elementTranslation', Join::WITH, 'elementTranslation.localeId IN(:localeId, :fallbackId)'
) ->
leftJoin('form.translations', 'translation', Join::WITH, 'translation.localeId = :localeId'
) ->
leftJoin('form.translations', 'translationFallback', Join::WITH, 'translationFallback.localeId = :fallbackId'
) ->
leftJoin('form.children', 'children'
) ->
leftJoin('form.plugin', 'plugin'
) ->
select([ 'form.id',
'COALESCE(translation.label, translationFallback.label, form.label, form.name) as label',