snoke/interface-associations
最新稳定版本:0.0.2
Composer 安装命令:
composer require snoke/interface-associations
包简介
README 文档
README
Bundle for Symfony7 with Doctrine ORM
The Interface Associations Bundle provides a way to replace ORM relations with interfaces and map them to concrete classes at runtime. This enables the development of abstract components.
installation
run composer req snoke/interface-associations
Functionality
The bundle allows configuring remappings. You can specify which classes or interfaces should be replaced by other classes or interfaces, either globally or specifically for certain classes and properties.
configuration
edit config/packages/snoke_interface_associations.yaml as follows:
snoke_interface_associations: remap: - source: 'App\Interface\EntityInterface' target: 'App\Entity\User' class: 'App\Entity\AuthToken' field: 'user'
-
source: The source class or interface to be remapped.
-
target: The target class to remap to.
-
class (optional): The class where the remapping should be applied. If not specified, the remapping is global.
-
property (optional): The property within the class where the remapping should be applied. If not specified, the remapping applies to all properties of the class.
this way you can produce code having interfaces as relationships
#[ORM\ManyToOne(inversedBy: 'accessTokens')] private EntityInterface $user;
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-12