/** @var \Doctrine\ORM\QueryBuilder $builder */
$builder =
$this->
get('models'
) ->
getRepository('Shopware\Models\Snippet\Snippet'
) ->
createQueryBuilder('snippet'
);
$builder->
select('snippet.namespace, count(snippet.id) as snippetCount'
) ->
groupBy('snippet.namespace'
) ->
orderBy('snippet.namespace'
);
$result =
$builder->
getQuery()->
execute();
$result =
$this->
prepareNamespaceTree($result);
$this->
View()->
assign([ 'success' => true,
'data' =>
$result,
'total' => \
count($result),
]);
} /**
* Remove namespace action
*/