Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1635

Allow injection of instance of Encoder into the BuilderEncoder

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.21.0
    • Affects Version/s: None
    • Component/s: Builder
    • None
    • PHP Drivers
    • Not Needed

      The MongoDB\Builder\BuilderEncoder doesn't allow dependency injection of sub-encoders. https://github.com/mongodb/mongo-php-library/blob/fda4a4c70d62cbe4e379e17b4670310d25e967af/src/Builder/BuilderEncoder.php#L98 

      In order to accept more advanced use-cases (like using a service in the encoder to map field names), allow injecting instances of Encoder into the constructor.

      Issue similar to https://github.com/doctrine/dbal/pull/6705/ 

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: