2017 © Pedro Peláez
 

symfony-bundle money-bundle

Symfony bundle for https://github.com/moneyphp/money

image

padam87/money-bundle

Symfony bundle for https://github.com/moneyphp/money

  • Saturday, July 28, 2018
  • by Padam87
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

MoneyBundle

Symfony bundle for https://github.com/moneyphp/money, (*1)

As an opinionated bundle, this money bundle uses the following principles as it's main guide: - Storage is just as important as calculation. - Financial data should be held in SQL, so Doctrine ORM only implementation. - Money objects are Embeddables. - Amount should be stored in a human readable way in the database. - ISO money scale (eg smallest amount is 1 cent for EUR) is not viable for complex applications., (*2)

To achieve these, the following restrictions apply: - precision and scale are mandatory (but have default values) - amounts are mapped as DECIMAL (changable, but not recommended to change) - ext-bcmath is mandatory. (DECIMAL database values are converted to string by PDO. This bundle uses bcmath to multiple these values by ˙pow(10, $scale)˙, and pass integer values to the Money object. https://github.com/Padam87/MoneyBundle/blob/master/Doctrine/Type/MoneyAmountType.php#L45), (*3)

Installation

composer require padam87/money-bundle, (*4)

Configuration (optional)

padam87_money:
    precision:            18
    scale:                2
    currencies:

        # Default:
        - EUR

Usage

Doctrine

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

Formatting

The bundle adds 2 services., (*5)

padam87_money.number_formatter - A simple \NumberFormatter object, with the current request's locale, and currency style., (*6)

Money\Formatter\IntlMoneyFormatter - Intl money formatter, (*7)

The Versions

28/07 2018

dev-master

9999999-dev

Symfony bundle for https://github.com/moneyphp/money

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adam Prager

24/07 2018

v0.1.2

0.1.2.0

Symfony bundle for https://github.com/moneyphp/money

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adam Prager

24/07 2018

v0.1.1

0.1.1.0

Symfony bundle for https://github.com/moneyphp/money

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adam Prager

24/07 2018

v0.1.0

0.1.0.0

Symfony bundle for https://github.com/moneyphp/money

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adam Prager