Doctrine 2 + ZF:如果我将实体移动到子文件夹中,是否会导致一些连锁效应?(Doctrine 2 + ZF: If I move entities into subfolders, wil

编程入门 行业动态 更新时间:2024-10-24 20:14:40
Doctrine 2 + ZF:如果我将实体移动到子文件夹中,是否会导致一些连锁效应?(Doctrine 2 + ZF: If I move entities into subfolders, will it lead to some knock-on effects?)

我在ZF上设置了Doctrine 2,并将我的实体位置放在自定义库目录中。 如果我将实体移动到子文件夹中,这是否会导致连锁效应/错误?

I'm setup with Doctrine 2 on ZF, and have my entities location in my custom library directory. If I move the entities into subfolders, will this cause a knock-on effect/error?

最满意答案

主要问题应该是自动加载。 但是,如果您修改了新名称空间和位置的自动加载器配置,那么您应该没问题。 类似的考虑也适用于存储库。

请注意,属于您的Doctrine配置(可能是在Bootstrap中创建的)的元数据驱动程序实现需要指向包含元数据的文件夹。 如果您将实体中的注释用作元数据,那么这里需要使用新的实体路径。

另一种可能性是自动生成代理。 如果代理的位置发生变化,那么执行自动加载的任何进程都需要知道该位置。

只需注意一些事情。

Primary issue should be autoloading. But if you modify the autoloader config for your new namespaces and locations, then you should be fine. A similar consideration applies also to repositories.

Note that the metadata-driver-implementation that is part of your Doctrine config (probably created at Bootstrap) needs to point to a folder containing your metadata. If you are using annotations in your entities as your metadata, then the new entity path will need to be used here.

Another possibility is auto-generating of proxies. If the location of your proxies changes, then whatever process performs the autoloading needs to know that.

Just some things to look out for.

更多推荐

本文发布于:2023-04-27 23:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329087.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我将   是否会   实体   效应   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!