$query =
$this->repository->
getListQuery(null,
[ ['property' => 'payment.active', 'direction' => 'DESC'
],
['property' => 'payment.position'
],
]);
$results =
$query->
getArrayResult();
// Translate payments
// The standard $translationComponent->translatePayments can not be used here since the
// description may not be overridden. The field is edible and if the translation is
// shown in the edit field, there is a high chance of a user saving the translation as description.
$translator =
$this->
get(Shopware_Components_Translation::
class)->
getObjectTranslator('config_payment'
);
$results =
array_map(function D
$payment) use ($translator) { return $translator->
translateObjectProperty($payment, 'description', 'translatedDescription',
$payment['description'
]);
},
$results);
$results =
$this->
formatResult($results);
$this->
View()->
assign(['success' => true, 'data' =>
$results]);
} /**
* Function to get all inactive and active countries
*/