Last active
May 8, 2019 18:21
-
-
Save athlan/cf9b6d388f9beb808e953ccf8533c56e to your computer and use it in GitHub Desktop.
moneyphp/money Doctrine mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctrine: | |
orm: | |
mappings: | |
Money: | |
type: xml | |
dir: '%kernel.project_dir%/PATH_TO_MAPPING' | |
prefix: 'Money' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | |
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | |
<embeddable name="Money\Money"> | |
<field name="amount" column="amount" type="bigint" /> | |
<embedded name="currency" class="Money\Currency" use-column-prefix="false" /> | |
</embeddable> | |
</doctrine-mapping> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | |
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | |
<embeddable name="Money\Currency"> | |
<field name="code" column="currency" type="string" length="3" /> | |
</embeddable> | |
</doctrine-mapping> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment