Why does Doctrine\ORM\Configuration's “DoctrineProxies” Object contain the Universe?

前端 未结 2 725
春和景丽
春和景丽 2021-01-28 06:36

In my ORM code I have an Entity with a field fined like so:

//part of entity class Item:
/** @Column(name=\"product_id\", type=\"integer\") */
private $productId         


        
2条回答
  •  臣服心动
    2021-01-28 07:08

    You can't dump a proxy object without XDebug or similar tools (which limit the dumped object size).

    The problem is really, really simple:

    Proxy -> references EntityManager -> references UnitOfWork -> contains Proxy

    This obviously leads to a recursive data-structure dump, which in turn leads to a mess any time you try to dump it without sensible limits.

提交回复
热议问题