Added Doctrine_Pager_Range::isInRange, which checks if a given page is in the range
This commit is contained in:
parent
499eaf6cb2
commit
d674b8ead7
@ -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
|
||||
*
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user