addPaymentTranslation example

$query = $this->connection->createQueryBuilder();

        $query->addSelect($this->fieldHelper->getPaymentFields());

        $query->from('s_core_paymentmeans', 'payment')
            ->leftJoin('payment', 's_core_paymentmeans_attributes', 'paymentAttribute', 'paymentAttribute.paymentmeanID = payment.id')
            ->where('payment.id IN (:ids)')
            ->addOrderBy('position', 'ASC')
            ->addOrderBy('name', 'ASC')
            ->setParameter(':ids', $paymentIds, Connection::PARAM_INT_ARRAY);

        $this->fieldHelper->addPaymentTranslation($query$context);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        $payments = [];
        foreach ($data as $row) {
            $id = (int) $row['__payment_id'];
            $payments[$id] = $this->paymentHydrator->hydrate($row);
        }

        return $payments;
    }
}
Home | Imprint | This part of the site doesn't use cookies.