grifix/entity-manager-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Grifix Entity Manager Symfony Bundle

dev-main 2022-12-06 07:18 UTC

This package is auto-updated.

Last update: 2023-07-26 07:04:10 UTC


README

Integration grifix/entity-manager with Symfony

Installation

composer require grifix/entity-manager-bundle

Usage

  doctrine:
   dbal:
     dbname: '%env(resolve:POSTGRES_DB)%'
     host: db
     port: 5432
     user: '%env(resolve:POSTGRES_USER)%'
     password: '%env(resolve:POSTGRES_PASSWORD)%'
     driver: pdo_pgsql
  
  grifix_entity_manager:
   entities:
     - name: person
       table: persons
       object_class: Grifix\EntityManagerBundle\Tests\Dummies\Person
       version_converter: Grifix\EntityManagerBundle\Tests\Dummies\PersonVersionConverter
       dependencies:
         - outside
       schemas:
         #v1
         - - property: id
             type: string
           - property: name
             type: string
  
         #v2
         - - property: id
             type: string
           - property: firstName
             type: string
           - property: lastName
             type: string
  
  services:
   Grifix\EntityManagerBundle\Tests\Dummies\PersonVersionConverter:
     public: true
  
   Grifix\EntityManagerBundle\Tests\Dummies\PersonOutside:
     public: true
  • Inject entity manager as a dependency or get it from the Symfony Container instead of creating it by EntityManager::create()