Created
July 20, 2018 08:15
-
-
Save ostrolucky/3f8804c10e9b08935d11889a69411ca0 to your computer and use it in GitHub Desktop.
Moneyphp embeddable
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://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | |
<embeddable name="Money\Currency"> | |
<field name="code" length="3" /> | |
</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
/** | |
* @var Money | |
* @ORM\Embedded(class="Money\Money") | |
*/ | |
private $price; |
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://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | |
<embeddable name="Money\Money"> | |
<field name="amount" type="bigint" /> | |
<embedded name="currency" class="Money\Currency" /> | |
</embeddable> | |
</doctrine-mapping> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment