[Solar-svn] Revision 2707

pmjones at solarphp.com pmjones at solarphp.com
Thu Aug 16 08:55:10 CDT 2007


Branch: Solar_Sql_Model: [ADD] Method _addFilter() to make adding filters more consistent


Modified: branches/orm/Solar/Sql/Model.php
===================================================================
--- branches/orm/Solar/Sql/Model.php	2007-08-16 01:28:17 UTC (rev 2706)
+++ branches/orm/Solar/Sql/Model.php	2007-08-16 13:55:10 UTC (rev 2707)
@@ -1497,6 +1497,12 @@
         $record->setStatus('deleted');
     }
     
+    // -----------------------------------------------------------------
+    //
+    // Support methods
+    //
+    // -----------------------------------------------------------------
+    
     /**
      * 
      * Serializes values in $this->_data based on $this->_serialize_cols.
@@ -1523,11 +1529,25 @@
         }
     }
     
-    // -----------------------------------------------------------------
-    //
-    // Relationships
-    //
-    // -----------------------------------------------------------------
+    /**
+     * 
+     * Adds a column filter.
+     * 
+     * @param string $col The column name to filter.
+     * 
+     * @param string $method The filter method name, e.g. 'validateUnique'.
+     * 
+     * @args Remaining arguments are passed to the filter method.
+     * 
+     * @return void
+     * 
+     */
+    protected function _addFilter($col, $method)
+    {
+        $args = func_get_args();
+        array_shift($args); // $col
+        $this->_filters[$col][] = $args;
+    }
     
     /**
      * 




More information about the Solar-svn mailing list