DatatablesBundle icon indicating copy to clipboard operation
DatatablesBundle copied to clipboard

Using multiple entity namespaces

Open mpeshehonov opened this issue 5 years ago • 2 comments

image image Not working with multiple namespaces, in factory service only default namespace image

mpeshehonov avatar May 22 '20 08:05 mpeshehonov

@stwe @Seb33300 please help

mpeshehonov avatar May 24 '20 15:05 mpeshehonov

@mpeshehonov Looks like the feature is not implemented yet. Here's how I went about getting the datatablefactory to work on another entity manager:

  • Make a "DatatableFactoryCustomer" class extends DatatableFactory.
  • Declare this class in the Services.yaml file and specify variable $em is the "customer" entity manager.

Now you can use autowiring to create this "DatatableFactoryCustomer"

example of services.yaml declaration: App\Datatable\Customer\DatatableFactoryCustomer: $translator: '@Symfony\Contracts\Translation\TranslatorInterface' $em: '@doctrine.orm.customer_entity_manager'

roublarstar avatar Jan 18 '21 16:01 roublarstar