+ $this->conds->addChild($cond);
+ }
+
+ /** Restricts a PlFilter to values of a given PlFilterOrder
+ */
+ public function restrictTo($value)
+ {
+ $this->restrict_to = $value;
+ }
+
+ /** This function builds the right kind of PlFilter from given data
+ * @param $cond The PlFilterCondition for the filter
+ * @param $orders An array of PlFilterOrder for the filter
+ * @return a PlFilter
+ */
+ abstract protected function buildFilter(PlFilterCondition $cond, $orders);
+
+ /** This function returns the results of the given filter
+ * within $limit; can be use to replace the default $pf->get call.
+ * @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;
+ }
+
+ /** Helper function, calls buildFilter with the adequate condition/orders.
+ * @param $orders Additional orders to use before the default ones.
+ * @return A newly created PlFilter.
+ */
+ private function buildFilterHelper($orders = array(), $extra_cond=null)
+ {
+ if (!is_array($orders)) {
+ $orders = array($orders);