Download the PHP package tourze/doctrine-resolve-target-entity-bundle without Composer
On this page you can find all versions of the php package tourze/doctrine-resolve-target-entity-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/doctrine-resolve-target-entity-bundle
More information about tourze/doctrine-resolve-target-entity-bundle
Files in tourze/doctrine-resolve-target-entity-bundle
Package doctrine-resolve-target-entity-bundle
Short Description Symfony bundle for entity decoupling using Doctrine's ResolveTargetEntity
License MIT
Informations about the package doctrine-resolve-target-entity-bundle
Doctrine Resolve Target Entity Bundle
中文
Table of Contents
- Overview
- Features
- Installation
- Quick Start
- Register the Bundle
- Define an Interface
- Create Entity Implementation
- Use Interface in Related Entities
- Configuration
- Services
- Advanced Usage
- Error Handling
- Security
- Dependencies
- License
Overview
A Symfony bundle that provides entity decoupling functionality through Doctrine's ResolveTargetEntity feature. This bundle allows you to define interfaces in your entities and map them to concrete implementations at runtime, enabling better architectural separation and flexibility.
Features
- Entity Decoupling: Use interfaces instead of concrete classes in entity relationships
- Runtime Resolution: Map interfaces to concrete implementations at container compilation time
- Flexible Architecture: Easily swap implementations without changing entity definitions
- Doctrine Integration: Seamlessly integrates with Doctrine ORM's ResolveTargetEntity feature
Installation
Quick Start
Register the Bundle
Add the bundle to your config/bundles.php:
Define an Interface
Create Entity Implementation
Configuration
Use Interface in Related Entities
Services
ResolveTargetEntityService
The bundle provides a service for managing entity mappings:
Advanced Usage
Testing Support
The bundle includes testing utilities:
TestEntityGenerator: Generates test entities dynamicallyTestKernelHelper: Assists with test kernel setup
Custom Interface Mappings
You can register multiple interface mappings:
Error Handling
The bundle provides specific exceptions:
EntityClassNotFoundException: Thrown when an interface mapping is not foundInvalidInterfaceException: Thrown when an interface is invalid or doesn't exist
Security
This bundle follows Symfony security best practices:
- All services are properly configured in the service container
- No user input is directly processed without validation
- Interface resolution is performed at container compilation time
Dependencies
This bundle requires:
- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM 3.0 or higher
- Doctrine Bundle 2.13 or higher
License
This bundle is licensed under the MIT License. See the LICENSE file for details.
All versions of doctrine-resolve-target-entity-bundle with dependencies
doctrine/orm Version ^3.0
nette/php-generator Version ^4.1
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/yaml Version ^7.3
tourze/bundle-dependency Version 1.*
tourze/symfony-dependency-service-loader Version 1.0.*