1
0
mirror of synced 2025-02-20 14:13:15 +03:00

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

This commit is contained in:
guilhermeblanco 2008-02-21 16:06:46 +00:00
parent 499eaf6cb2
commit d674b8ead7
2 changed files with 17 additions and 0 deletions

View File

@ -141,6 +141,20 @@ abstract class Doctrine_Pager_Range
}
/**
* isInRange
*
* Check if a given page is in the range
*
* @param $page Page to be checked
* @return boolean
*/
public function isInRange($page)
{
return (array_search($page, $this->rangeAroundPage()) !== false);
}
/**
* _initialize
*

View File

@ -75,6 +75,9 @@ $pager_range->getOptions();
// Returns the custom Doctrine_Pager_Range implementation offset option
$pager_range->getOption($option);
// Check if a given page is in the range
$pager_range->isInRange($page);
// Return the range around the current page (obtained from Doctrine_Pager
// associated to the $pager_range instance)
$pager_range->rangeAroundPage();