<?php
namespace App\Twig;
use App\Services\Core\Bank;
use App\Tools\Core\StatusBankTool;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\TwigFilter;
class BankExtension extends AbstractExtension
{
public function __construct(Bank $bank)
{
$this->bank = $bank;
}
public function getFunctions(): array
{
return [
new TwigFunction('getStatusBank', [$this, 'getStatusBank']),
new TwigFunction('getOrderPayment', [$this, 'getOrderPayment']),
new TwigFunction('getUserOrderPayment', [$this, 'getUserOrderPayment']),
];
}
public function getUserOrderPayment($paymentID)
{
return $this->bank->getUserOrderPayment($paymentID);
}
public function getOrderPayment($paymentID)
{
return $this->bank->getOrderPayment($paymentID);
}
public function getStatusBank($status)
{
return StatusBankTool::getStatus($status);
}
}