joschi127/doctrine-entity-override-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joschi127/doctrine-entity-override-bundle

最新稳定版本:v0.7.2

Composer 安装命令:

composer require joschi127/doctrine-entity-override-bundle

包简介

Symfony bundle which allows to override entities by using inheritance

README 文档

README

Build Status

Symfony bundle which allows to override entities by using inheritance

Configuration

Add to app/config/config.yml:

# override entities
joschi127_doctrine_entity_override:
    overridden_entities:
        # Keep in mind: if you are using multi level inheritance, you have to use the top most super class on the
        # left side
        OriginalBundle\Entity\Example: CustomizedBundle\Entity\Example

Hints

  • If you are using multi level inheritance, you have to use the top most super class on the left side in the configuration under overridden_entities.
  • If you are using multi level inheritance, the properties of the class in between have to be protected, otherwise you will get a ReflectionException saying Property ...::$propertyName does not exist.
  • It is recommended that the original entity is defined as MappedSuperclass. You can do so if it is your own code. If you want to extend other, third party entities, this should work in most cases. But parts of the mapping will be regenerated internally by the LoadORMMetadataSubscriber of this bundle and at least some doctrine mapping features might not be supported and you might run into issues.
  • Using @ORM\AttributeOverrides is not supported, instead just override the property in your customized entity class and add the ORM mapping for the property in your customized entity as usual. This bundle will then unload the original mapping configuration and only use your customized mapping.
  • Have a look at the Tests/Functional/src folder for some example code.

统计信息

  • 总下载量: 121.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 3
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-10