Changeset 3871

Show
Ignore:
Timestamp:
02/20/08 23:15:13 (2 years ago)
Author:
guilhermeblanco
Message:

Fixed method getNextPage that was always returning the last page in all branches

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Pager.php

    r3836 r3871  
    271271    { 
    272272        if ($this->getExecuted()) { 
    273             return $this->_lastPage; 
     273            return min($this->getPage() + 1, $this->getLastPage()); 
    274274        } 
    275275 
    276276        throw new Doctrine_Pager_Exception( 
    277277            'Cannot retrieve the last page number of a not yet executed Pager query' 
    278         );return min($this->getPage() + 1, $this->getLastPage()); 
     278        ); 
    279279    } 
    280280 
  • branches/0.9/lib/Doctrine/Pager.php

    r3836 r3871  
    271271    { 
    272272        if ($this->getExecuted()) { 
    273             return $this->_lastPage; 
     273            return min($this->getPage() + 1, $this->getLastPage()); 
    274274        } 
    275275 
    276276        throw new Doctrine_Pager_Exception( 
    277277            'Cannot retrieve the last page number of a not yet executed Pager query' 
    278         );return min($this->getPage() + 1, $this->getLastPage()); 
     278        ); 
    279279    } 
    280280 
  • trunk/lib/Doctrine/Pager.php

    r3836 r3871  
    271271    { 
    272272        if ($this->getExecuted()) { 
    273             return $this->_lastPage; 
     273            return min($this->getPage() + 1, $this->getLastPage()); 
    274274        } 
    275275 
    276276        throw new Doctrine_Pager_Exception( 
    277277            'Cannot retrieve the last page number of a not yet executed Pager query' 
    278         );return min($this->getPage() + 1, $this->getLastPage()); 
     278        ); 
    279279    } 
    280280