michaelgooden/mdg-money-doctrine

Doctrine Types and Embeddables for the PHP implementation of Fowler's Money pattern.

0.3.0 2022-11-08 07:40 UTC

This package is auto-updated.

Last update: 2024-04-08 11:23:30 UTC


README

Include the custom Currency type into your Doctrine configuration.

Point a XML mapping driver to the vendor/michaelgooden/mdg-money-doctrine/config/orm/Money.Money.dcm.xml file to being using \Money\Money as an embeddable:

    /**
     * @ORM\Embedded(class="Money\Money")
     */
    private $total;

    /**
     * @ORM\Embedded(class="Money\Money")
     */
    private $tax;