Skip to content

Custom created_at date on deposit/withdraw #619

Answered by rez1dent3
gera919 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello. I would override the TransactionDtoTransformerInterface interface.

use Bavix\Wallet\Internal\Dto\TransactionDtoInterface;
use Bavix\Wallet\Internal\Transform\TransactionDtoTransformer;
use Bavix\Wallet\Internal\Transform\TransactionDtoTransformerInterface;

final class TransactionDtoTransformerCustom implements TransactionDtoTransformerInterface
{
    public function __construct(
        private TransactionDtoTransformer $transactionDtoTransformer
    ) {
    }

    public function extract(TransactionDtoInterface $dto): array
    {
        return array_merge($this->transactionDtoTransformer->extract($dto), [
            'created_at' => new DateTimeImmutable($dto->getMeta()['created_at

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rez1dent3
Comment options

@gera919
Comment options

Answer selected by gera919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants