简体   繁体   中英

Doctrine Mongodb - Is it possible to declare a Document both as NORMAL and EMBEDDED

I'm creating an app in Symfony with MongoDB as a backend, and I'm using Doctrine MongoDB connector which works fine. However, I have a situation where I have a Document (Normal Mongo document) and I want to use the same document as Embedded in another Document. I know I can copy the class and change the declaration but I'd hate to change everything on two places. So is it possible to declare a Document as both Normal and Embedded?

Thanks

我想@DiscriminatorMap注释就是您想要的:更多信息: 教义映射

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM