williarin/wordpress-interop-bundle

Symfony bundle to integrate williarin/wordpress-interop in the framework

Installs: 7 817

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 3

Open Issues: 0

Type:symfony-bundle

1.3.0 2024-03-28 17:37 UTC

This package is auto-updated.

Last update: 2024-10-28 18:50:55 UTC


README

Introduction

This bundle integrates williarin/wordpress-interop with Symfony.

Installation

composer require williarin/wordpress-interop-bundle

Configuration

# config/packages/doctrine.yaml
doctrine:
    dbal:
        connections:
            my_dbal_connection:
                driver: pdo_mysql
                url: '%env(resolve:WORDPRESS_DATABASE_URL)%'
                charset: UTF8
# config/packages/williarin_wordpress_interop.yaml
williarin_wordpress_interop:
    # default_entity_manager:  # defaults to the first defined entity manager
    entity_managers:
        my_entity_manager:
            connection: my_dbal_connection
            # tables_prefix: custom_ # defaults to 'wp_'
            
        # another_manager:
        #     connection: my_other_dbal_connection
        #     # tables_prefix: custom_

Autowiring

  • Williarin\WordpressInterop\ManagerRegistryInterface to access all your managers and repositories.
  • Williarin\WordpressInterop\EntityManagerInterface to get the default entity manager
  • Williarin\WordpressInterop\Persistence\DuplicationServiceInterface to get the default duplication service
  • wordpress_interop.entity_manager as an alternative to Williarin\WordpressInterop\EntityManagerInterface

License

MIT

Copyright (c) 2022, William Arin