Development

Changeset 24498

You must first sign up to be able to contribute.

Changeset 24498

Show
Ignore:
Timestamp:
11/28/09 15:00:37 (4 years ago)
Author:
FabianLange
Message:

[1.2, 1.3, 1.4] fixed getObjectsForParameters() failing on second invocation on sfDoctrineRoute.class.php (fixes #7716)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php

    r14976 r24498  
    7979  protected function getObjectsForParameters($parameters) 
    8080  { 
    81     $this->options['model'] = Doctrine::getTable($this->options['model']); 
     81    $this->options['model'] = Doctrine::getTable($this->options['object_model']); 
    8282 
    8383    $variables = array(); 
     
    143143    } 
    144144 
    145     $className = $this->options['model']; 
    146  
    147145    $parameters = array(); 
    148  
    149146    foreach ($this->getRealVariables() as $variable) 
    150147    { 
  • branches/1.3/lib/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php

    r23810 r24498  
    6262  protected function getObjectsForParameters($parameters) 
    6363  { 
    64     $this->options['model'] = Doctrine_Core::getTable($this->options['model']); 
     64    $tableModel = Doctrine_Core::getTable($this->options['model']); 
    6565 
    6666    $variables = array(); 
     
    6868    foreach($this->getRealVariables() as $variable) 
    6969    { 
    70       if($this->options['model']->hasColumn($this->options['model']->getColumnName($variable))) 
     70      if($tableModel->hasColumn($tableModel->getColumnName($variable))) 
    7171      { 
    7272        $variables[] = $variable; 
     
    7979      if (null === $this->query) 
    8080      { 
    81         $q = $this->options['model']->createQuery('a'); 
     81        $q = $tableModel->createQuery('a'); 
    8282        foreach ($values as $variable => $value) 
    8383        { 
    84           $fieldName = $this->options['model']->getFieldName($variable); 
     84          $fieldName = $tableModel->getFieldName($variable); 
    8585          $q->andWhere('a.'. $fieldName . ' = ?', $parameters[$variable]); 
    8686        } 
     
    9393      { 
    9494        $method = $this->options['method_for_query']; 
    95         $results = $this->options['model']->$method($q); 
     95        $results = $tableModel->$method($q); 
    9696      } 
    9797      else 
     
    103103    { 
    104104      $method = $this->options['method']; 
    105       $results = $this->options['model']->$method($this->filterParameters($parameters)); 
     105      $results = $tableModel->$method($this->filterParameters($parameters)); 
    106106    } 
    107107 
     
    126126    } 
    127127 
    128     $className = $this->options['model']; 
    129  
    130128    $parameters = array(); 
    131  
    132129    foreach ($this->getRealVariables() as $variable) 
    133130    { 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php

    r23810 r24498  
    6262  protected function getObjectsForParameters($parameters) 
    6363  { 
    64     $this->options['model'] = Doctrine_Core::getTable($this->options['model']); 
     64    $tableModel = Doctrine_Core::getTable($this->options['model']); 
    6565 
    6666    $variables = array(); 
     
    6868    foreach($this->getRealVariables() as $variable) 
    6969    { 
    70       if($this->options['model']->hasColumn($this->options['model']->getColumnName($variable))) 
     70      if($tableModel->hasColumn($tableModel->getColumnName($variable))) 
    7171      { 
    7272        $variables[] = $variable; 
     
    7979      if (null === $this->query) 
    8080      { 
    81         $q = $this->options['model']->createQuery('a'); 
     81        $q = $tableModel->createQuery('a'); 
    8282        foreach ($values as $variable => $value) 
    8383        { 
    84           $fieldName = $this->options['model']->getFieldName($variable); 
     84          $fieldName = $tableModel->getFieldName($variable); 
    8585          $q->andWhere('a.'. $fieldName . ' = ?', $parameters[$variable]); 
    8686        } 
     
    9393      { 
    9494        $method = $this->options['method_for_query']; 
    95         $results = $this->options['model']->$method($q); 
     95        $results = $tableModel->$method($q); 
    9696      } 
    9797      else 
     
    103103    { 
    104104      $method = $this->options['method']; 
    105       $results = $this->options['model']->$method($this->filterParameters($parameters)); 
     105      $results = $tableModel->$method($this->filterParameters($parameters)); 
    106106    } 
    107107 
     
    126126    } 
    127127 
    128     $className = $this->options['model']; 
    129  
    130128    $parameters = array(); 
    131  
    132129    foreach ($this->getRealVariables() as $variable) 
    133130    {