Files
kupshop/bundles/KupShop/GraphQLBundle/ApiAdmin/Util/PaymentUtil.php
2025-08-02 16:30:27 +02:00

27 lines
700 B
PHP

<?php
namespace KupShop\GraphQLBundle\ApiAdmin\Util;
use KupShop\GraphQLBundle\ApiAdmin\Types\Collection\PaymentCollection;
use KupShop\GraphQLBundle\ApiAdmin\Types\Order\DeliveryType\Payment;
use KupShop\GraphQLBundle\ApiShared\ApiUtil;
class PaymentUtil
{
public function getPayments($figure = false): PaymentCollection
{
$payments = \DeliveryType::getPayments($figure);
$payments = array_map(function ($payment) {
$payment['class']->paymentId = (int) $payment['id'];
return $payment['class'];
}, $payments);
return new PaymentCollection(ApiUtil::wrapItems(
$payments,
Payment::class
));
}
}