+ $this->orders[] = $order;
+ }
+
+ /** Adds a new condition to the PlFilter
+ */
+ public function addCond(PlFilterCondition $cond)
+ {
+ $this->conds->addChild($cond);
+ }
+
+ /** 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
+ */
+ abstract protected function buildFilter(PlFilterCondition $cond, $orders);
+
+ /** This function returns the results of the given filter
+ * wihtin $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())
+ {
+ if (!is_array($orders)) {
+ $orders = array($orders);