Skip to content

Loading…

DDC-204: ActiveEntity persistent object recursion on self referencing class #2718

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user russ:

When using a self-referencing relationship, for example:

  /****
   * @ManyToOne(targetEntity="Collection")
   * @JoinColumn(name="parent_id", referencedColumnName="id")
   * 
   * @var Collection
   */
  protected $parent;

ActiveEntity::toArray() recurses through all parents and children.

This was all working fine until my database actually started getting some data... then XDebug stopped me with a "Maximum function nesting level of '100' reached, aborting!" error.

..
..
95 0.2574 14222056 Proxies\CollectionProxy->toArray( ) ..\ActiveEntity.php:164 
96 0.2574 14222056 DoctrineExtensions\ActiveEntity->toArray( ) ..\CollectionProxy.php:183 
97 0.2576 14231520 Proxies\CollectionProxy->toArray( ) ..\ActiveEntity.php:173 
98 0.2576 14231520 DoctrineExtensions\ActiveEntity->toArray( ) ..\CollectionProxy.php:183 
99 0.2576 14231736 Doctrine\ORM\EntityManager->getClassMetadata( ) ..\ActiveEntity.php:150 

The PersistentCollection object does not have a state so cannot be locked in the same was as an ActiveEntity object can - maybe it needs a lockable state for this to work?

@doctrinebot

Comment created by @jwage:

Is this still a problem or has it been fixed?

@doctrinebot

Issue was closed with resolution "Fixed"

@jwage jwage was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.