// Get total result of the query
$total =
$this->
get('models'
)->
getQueryCount($query);
// Select all shop as array
$data =
$query->
getArrayResult();
/** @var StateTranslatorServiceInterface $stateTranslator */
$stateTranslator =
$this->
get('shopware.components.state_translator'
);
$data =
array_map(function D
$paymentStateItem) use ($stateTranslator) { $paymentStateItem =
$stateTranslator->
translateState(StateTranslatorService::STATE_PAYMENT,
$paymentStateItem);
return $paymentStateItem;
},
$data);
// Return the data and total count
$this->
View()->
assign(['success' => true, 'data' =>
$data, 'total' =>
$total]);
} /**
* Returns a list of order states. Supports store paging, sorting and filtering over the standard ExtJs store parameters.
* Each order state has the following fields:
* <code>
* [int] id
* [string] name
* </code>
*/