formatResult example

$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 */
    public function getCountriesAction()
    {
        $result = $this->getCountryRepository()
            ->getCountriesQuery(null, $this->Request()->getParam('sort', []))
            
Home | Imprint | This part of the site doesn't use cookies.