*/
abstract protected function buildFilter(PlFilterCondition &$cond, $orders);
+ /** This function returns the results of the given filter
+ * wihtin $limit ; available when the PlFilter getter isn't the usual get
+ * @param &$pf The filter
+ * @param $limit The PlLimit
+ * @return The results of the filter
+ */
+ protected function &getFilterResults(PlFilter &$pf, PlLimit $limit)
+ {
+ $res = $pf->get($limit);
+ return $res;
+ }
+
/** This function returns the values of the set
* @param $limit A PlLimit for selecting users
* @param $orders An optional array of PFO to use before the "default" ones
if (is_null($limit)) {
$limit = new PlLimit(self::DEFAULT_MAX_RES, 0);
}
- $it = $pf->get($limit);
+ $it = $this->getFilterResults($pf, $limit);
$this->count = $pf->getTotalCount();
return $it;
}
public function limit()
{
- return null;
+ return new PlLimit($this->entriesPerPage, $this->offset);
}
/** Name of the template to use for displaying items of the view
$page->assign('order', Env::v('order', $this->defaultkey));
$page->assign('orders', $this->sortkeys);
$page->assign_by_ref('plview', $this);
+ if (is_array($res)) {
+ $page->assign('set_keys', array_keys($res));
+ }
$page->assign_by_ref('set', $res);
$count = $this->set->count();
$this->pages = intval(ceil($count / $this->entriesPerPage));