boshurik/doctrine-mongodb-odm-money

Doctrine ODM Money Type integration

Installs: 547

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/boshurik/doctrine-mongodb-odm-money

0.2.0 2020-04-15 15:35 UTC

This package is auto-updated.

Last update: 2025-09-16 04:34:33 UTC


README

Use michaelgooden/mdg-money-doctrine for ORM inegration

Installation

Add vendor/boshurik/doctrine-mongodb-odm-money/config/Money.mongodb.xml to mapping

Doctrine\ODM\MongoDB\Types\Type

Type::registerType('currency', \BoShurik\Money\Doctrine\ODM\MongoDB\Types\CurrencyType::class);

Symfony integration

  • Add CurrencyType (e.g. in Kernel.php)
use BoShurik\Money\Doctrine\ODM\MongoDB\Types\CurrencyType;

class Kernel extends BaseKernel
{
    public function __construct(string $environment, bool $debug)
    {
        parent::__construct($environment, $debug);
    
        Type::addType('currency', CurrencyType::class);
    }
    
    // ...
}
  • Add mapping to config/packages/doctrine_mongodb.yaml
doctrine_mongodb:
    document_managers:
        default:
            mappings:
                Money:
                    is_bundle: false
                    type: xml
                    dir: '%kernel.project_dir%/vendor/boshurik/doctrine-mongodb-odm-money/config'
                    prefix: Money