Hello,
is it possible to extend DataObjectSet by two functions that returns the link for the first respectively the last page? I tried to decorate it by an extension object. Unfortunately the extension object cannot access the $pageSize or $paginationGetVar fields (because they are protected????).
It should be very simpe though. Just add:
/**
* Returns the URL of the first page.
* @return string
*/
public function FirstLink() {
if($this->pageStart > 1) {
return HTTP::setGetVar($this->paginationGetVar, 0);
}
}
/**
* Returns the URL of the last page.
* @return string
*/
public function LastLink() {
if($this->pageStart + $this->pageLength < $this->totalSize) {
return HTTP::setGetVar($this->paginationGetVar, ($this->TotalPages() - 1) * $this->pageLength);
}
}