Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add un/serialize for currency #779

Closed
wants to merge 3 commits into from
Closed

feat: add un/serialize for currency #779

wants to merge 3 commits into from

Conversation

Chris53897
Copy link
Contributor

We use https://github.com/doctrine-extensions/DoctrineExtensions for Versioning.
I came across the problem, that versioning does not work for Curreny.
Symfony via https://github.com/TheBigBrainsCompany/TbbcMoneyBundle

We use this Attribut.

#[ORM\Column(options: ['default' => 'EUR'])]
#[Gedmo\Versioned]
public $currency = null;
public function setCurrency(Currency $currency): self
    {
        $this->currency = $currency;
        return $this;
    }

    public function getCurrency(): Currency
    {
        return new Currency($this->currency);
    }

This PR solves the problem for us.
But i am not sure if we use it, how it should be used.
Sideeffekts of this PR?

@frederikbosch
Copy link
Member

We will not implement. We have parsers and formatters. Regarding ORM mapping: this should be fixed inside the ORM layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants