Changeset 3878

Show
Ignore:
Timestamp:
02/21/08 16:06:46 (17 months ago)
Author:
guilhermeblanco
Message:

Added Doctrine_Pager_Range::isInRange, which checks if a given page is in the range

Files:
4 modified

Legend:

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

    r3870 r3878  
    143143 
    144144    /** 
     145     * isInRange 
     146     * 
     147     * Check if a given page is in the range 
     148     * 
     149     * @param $page       Page to be checked 
     150     * @return boolean 
     151     */ 
     152    public function isInRange($page) 
     153    { 
     154        return (array_search($page, $this->rangeAroundPage()) !== false); 
     155    } 
     156 
     157 
     158 
     159    /** 
    145160     * _initialize 
    146161     * 
  • branches/0.10/manual/docs/en/utilities/pagination/controlling-range-styles.txt

    r3873 r3878  
    7676$pager_range->getOption($option); 
    7777 
     78// Check if a given page is in the range 
     79$pager_range->isInRange($page); 
     80 
    7881// Return the range around the current page (obtained from Doctrine_Pager 
    7982// associated to the $pager_range instance) 
  • trunk/lib/Doctrine/Pager/Range.php

    r3872 r3878  
    143143 
    144144    /** 
     145     * isInRange 
     146     * 
     147     * Check if a given page is in the range 
     148     * 
     149     * @param $page       Page to be checked 
     150     * @return boolean 
     151     */ 
     152    public function isInRange($page) 
     153    { 
     154        return (array_search($page, $this->rangeAroundPage()) !== false); 
     155    } 
     156 
     157 
     158    /** 
    145159     * _initialize 
    146160     * 
  • trunk/manual/docs/en/utilities/pagination/controlling-range-styles.txt

    r3873 r3878  
    7676$pager_range->getOption($option); 
    7777 
     78// Check if a given page is in the range 
     79$pager_range->isInRange($page); 
     80 
    7881// Return the range around the current page (obtained from Doctrine_Pager 
    7982// associated to the $pager_range instance)