Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-194

@PostLoad + proxy creates infinite recursion

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      The following code snippet causes an infinite loop:

      <?php
      /**
       * @Entity
       * @Table(name="user")
       * @HasLifecycleCallbacks
       */
      class User
      {
      	/**
      	 * @Id @Column(type="integer")
      	 * @GeneratedValue(strategy="AUTO")
      	 */
      	private $id;
      
      	public function foo()
      	{
      	}
      
      	/**
      	 * @PostLoad
      	 */
      	public function bar()
      	{
      	}
      }
      
      $user = hyperbeat()->getEntityManager()->getReference('User', 1);
      $user->foo();
      // Result is:
      PHP Fatal error:  Maximum function nesting level of '100' reached, aborting! in ...
      stack trace...
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Amir Abiri
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: