#1411: preDqlDelete event doesn't work
-----------------------------------+----------------------------------------
 Reporter:  lucassus               |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  minor                  |   Milestone:  1.0.0
Component:  Attributes             |     Version:  1.0  
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 preDqlDelete function is not being executed when I'm trying delete records
 with DQL

 My record class:
 {{{
 class Store_CategoryProduct extends Doctrine_Record
 {

     // here is table definition

     protected function _updateProductsCount($increment = true)
     {
         $query = Doctrine_Query::create()
             ->update('Store_Category')
             ->set('products_cnt', 'products_cnt'.($increment ? '+1' :
 '-1'))
             ->where('id = ?', $this->category_id);
         $results = $query->execute();
         $query->free();
     }

     public function preDqlDelete(Doctrine_Event $event)
     {
         $this->_updateProductsCount(false);
     }
 }
 }}}

 My DQL:
 {{{
 $query = Doctrine_Query::create()
                 ->delete()
                 ->from('Store_CategoryProduct')
                 ->addWhere('product_id = ?', $id)
                 ->addWhere('category_id = ?', $category_id);

             $query->execute();
             $query->free();
 }}}

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1411>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to