Changeset 3417
- Timestamp:
- 09/07/2008 09:17:16 AM (2 months ago)
- Files:
-
- 1 modified
-
trunk/system/classes/orm.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/classes/orm.php
r3416 r3417 198 198 // We use switch here to manually call the database methods. This is 199 199 // done for speed: call_user_func_array can take over 300% longer to 200 // make calls. Mos edatabase methods are 4 arguments or less, so this200 // make calls. Most database methods are 4 arguments or less, so this 201 201 // avoids almost any calls to call_user_func_array. 202 202 … … 814 814 { 815 815 // Remove LIMIT from the SQL 816 $sql = preg_replace('/\ bLIMIT\s+[^a-z]+/i', '', $sql);816 $sql = preg_replace('/\sLIMIT\s+[^a-z]+/i', ' ', $sql); 817 817 } 818 818 … … 820 820 { 821 821 // Remove OFFSET from the SQL 822 $sql = preg_replace('/\ bOFFSET\s+\d+/i', '', $sql);822 $sql = preg_replace('/\sOFFSET\s+\d+/i', '', $sql); 823 823 } 824 824 … … 830 830 ); 831 831 832 if ($result->count()) 833 { 834 // Return the total number of rows from the query 835 return (int) $result->current()->total_rows; 836 } 832 // Return the total number of rows from the query 833 return (int) $result->current()->total_rows; 837 834 } 838 835 … … 991 988 { 992 989 case 'int': 993 $value = ($value === '' AND ! empty($ data['null'])) ? NULL : (int) $value;990 $value = ($value === '' AND ! empty($column['null'])) ? NULL : (int) $value; 994 991 break; 995 992 case 'float':
