Pman/Roo.php
[Pman.Base] / Pman / Roo.php
index 645507c..65e0d11 100644 (file)
@@ -13,8 +13,8 @@ require_once 'Pman.php';
  * 
  * - applySort($au, $sortcol, $direction)
  * - applyFilters($_REQUEST, $authUser) -- apply any query filters on data. and hide stuff not to be seen.
- * - postListExtra - add extra column data on the results (like new messages etc.)
- * -postListFilter($data, $authUser, $request) return $data - add extra data to an object
+ * - postListExtra($_REQUEST) : array(extra_data) - add extra column data on the results (like new messages etc.)
+ * - postListFilter($data, $authUser, $request) return $data - add extra data to an object
  * 
  * - toRooSingleArray($authUser, $request) // single fetch, add data..
  * - toRooArray($request) /// toArray if you need to return different data.. for a list fetch.
@@ -46,6 +46,7 @@ class Pman_Roo extends Pman
      * -- defaults to listing data. with args.
      * 
      * !colname=....                 => colname != ....
+     * !colname[0]=... !colname[1]=... => colname NOT IN (.....) ** only supports main table at present..
      * colname[0]=... colname[1]=... => colname IN (.....) ** only supports main table at present..
      * 
      * other opts:
@@ -172,7 +173,7 @@ class Pman_Roo extends Pman
  
         $x->limit(
             empty($_REQUEST['start']) ? 0 : (int)$_REQUEST['start'],
-            min(empty($_REQUEST['limit']) ? 25 : (int)$_REQUEST['limit'], 1000)
+            min(empty($_REQUEST['limit']) ? 25 : (int)$_REQUEST['limit'], 5000)
         );
         
         $queryObj = clone($x);
@@ -865,6 +866,13 @@ class Pman_Roo extends Pman
             // value is an array..
             if (is_array($val) ) {
                 
+                $pref = '';
+                
+                if ($key[0] == '!') {
+                    $pref = '!';
+                    $key = substr($key,1);
+                }
+                
                 if (!in_array( $key,  array_keys($this->cols))) {
                     continue;
                 }
@@ -888,10 +896,10 @@ class Pman_Roo extends Pman
                 if (count($ar)) {
                     
                     
-                    $x->whereAddIn(
+                    $x->whereAddIn($pref . (
                         isset($this->colsJname[$key]) ? 
                             $this->colsJname[$key] :
-                            ($x->tableName(). '.'.$key),
+                            ($x->tableName(). '.'.$key)),
                         $ar, $quote ? 'string' : 'int');
                 }