Doctrine 1
  1. Doctrine 1
  2. DC-244

Missing savepoint methods on Doctrine_EventListener_Chain

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-BETA2
    • Fix Version/s: 1.2.0-RC1
    • Component/s: None
    • Labels:
      None
    • Environment:
      symfony 1.4

      Description

      A couple of methods are missing to use savepoint argument in transaction methods from Doctrine_Transaction object.

      If you want to process the bug, start a transaction, start a savepoint, and you will see a fatal error.

      Below, you will find a piece of code with missing methods to add to Doctrine_EventListener_Chain class:

      // @edit: Missing methods – loops
      // @start

      /**
      * postSavepointCommit
      * an event invoked after a Doctrine_Connection transaction with savepoint
      * is committed
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function postSavepointCommit(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->postSavepointCommit($event); }

      }

      /**
      * preSavepointCommit
      * an event invoked before a Doctrine_Connection transaction with savepoint
      * is committed
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function preSavepointCommit(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->preSavepointCommit($event); }

      }

      /**
      * postSavepointRollback
      * an event invoked after a Doctrine_Connection transaction with savepoint
      * is being rolled back
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function postSavepointRollback(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->postSavepointRollback($event); }

      }

      /**
      * preSavepointRollback
      * an event invoked before a Doctrine_Connection transaction with savepoint
      * is being rolled back
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function preSavepointRollback(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->preSavepointRollback($event); }

      }

      /**
      * postSavepointCreate
      * an event invoked after a Doctrine_Connection transaction with savepoint
      * has been started
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function postSavepointCreate(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->postSavepointCreate($event); }

      }

      /**
      * preSavepointCreate
      * an event invoked before a Doctrine_Connection transaction with savepoint
      * is being started
      *
      * @param Doctrine_Event $event
      * @return void
      */
      public function preSavepointCreate(Doctrine_Event $event)
      {
      foreach ($this->_listeners as $listener)

      { $listener->preSavepointCreate($event); }

      }
      // @end

      Please update.

      Loops

      1. Chain.php
        13 kB
        Pierrot Evrard

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Thanks for the ticket and patch. It is fixed in Doctrine 1.2 in svn now.

        Show
        Jonathan H. Wage added a comment - Thanks for the ticket and patch. It is fixed in Doctrine 1.2 in svn now.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Pierrot Evrard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: