Changeset 4573

Show
Ignore:
Timestamp:
06/27/08 23:39:41 (12 months ago)
Author:
jwage
Message:

Fixed Doctrine_Record::preDql*() hooks to accept an event just the same as all the other listeners do. This was simply an oversight/mistake in consistancy of the event listener api.

Location:
branches/0.11/lib/Doctrine
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Query/Abstract.php

    r4572 r4573  
    10031003        return $result; 
    10041004    } 
    1005  
    10061005 
    10071006    /** 
     
    10641063                $record = $table->getRecordInstance(); 
    10651064 
    1066                 // check (and call) preDql*() callback on the model class 
    1067                 if (method_exists($record, $callback['callback'])) { 
    1068                     $record->$callback['callback']($this, $component, $alias); 
    1069                 } 
    1070  
    1071                 // trigger preDql*() callback event 
     1065                // Trigger preDql*() callback event 
    10721066                $params = array('component`' => $component, 'alias' => $alias); 
    10731067                $event = new Doctrine_Event($record, $callback['const'], $this, $params); 
     1068 
     1069                $record->$callback['callback']($event); 
    10741070                $table->getRecordListener()->$callback['callback']($event); 
    10751071            } 
  • branches/0.11/lib/Doctrine/Record.php

    r4503 r4573  
    384384     */ 
    385385    public function postInsert($event) 
     386    { } 
     387 
     388    /** 
     389     * Empty template method to provide Record classes with the ability to alter DQL select 
     390     * queries at runtime 
     391     */ 
     392    public function preDqlSelect($event) 
     393    { } 
     394 
     395    /** 
     396     * Empty template method to provide Record classes with the ability to alter DQL update 
     397     * queries at runtime 
     398     */ 
     399    public function preDqlUpdate($event) 
     400    { } 
     401 
     402    /** 
     403     * Empty template method to provide Record classes with the ability to alter DQL delete 
     404     * queries at runtime 
     405     */ 
     406    public function preDqlDelete($event) 
    386407    { } 
    387408 
  • branches/0.11/lib/Doctrine/Table.php

    r4508 r4573  
    471471 
    472472    /** 
    473      * Gets the record instance 
     473     * Gets the record instance for this table. The Doctrine_Table instance always holds at least one 
     474     * instance of a model so that it can be reused for several things, but primarily it is first 
     475     * used to instantiate all the internal in memory meta data 
    474476     * 
    475477     * @return object  Empty instance of the record 
     
    477479    public function getRecordInstance() 
    478480    { 
     481        if ( ! $this->record) { 
     482            $this->record = new $this->_options['name']; 
     483        } 
    479484        return $this->record; 
    480485    }