简体   繁体   中英

Loading entity, set relation depth?

Is it somehow possible to set a loading level for related entities? An example of related entities:

Voucher
- has a Product
    - has a ProductGroup

A call like this

$voucher->getProduct()->getProductGroup(),

causes multiple SQL queries by calling getProduct() and getProductGroup(). I know it is possible to load everything with a big join in querybuilder, but I am looking for a kind of configuration how deep the entities should be loaded by join or proxyobjects. I dont know for what I should search in google. :(

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