Changeset 227 for trunk/trax/vendor/trax/active_record.php
- Timestamp:
- 07/09/06 14:53:36 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/active_record.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/active_record.php
r224 r227 1127 1127 // .', ' . (is_null($joins)?'null':$joins).')'); 1128 1128 1129 $offset = null; 1130 $per_page = null; 1131 1132 # this is if they passed in an associative array to emulate 1133 # named parameters. 1134 if(is_array($conditions)) { 1135 if(@array_key_exists("per_page", $conditions) && !is_numeric($conditions['per_page'])) { 1136 extract($conditions); 1137 $per_page = 0; 1138 } else { 1139 extract($conditions); 1140 } 1141 # If conditions wasn't in the array set it to null 1142 if(is_array($conditions)) { 1143 $conditions = null; 1144 } 1145 } 1146 1129 1147 # Test source of SQL for query 1130 1148 if(stristr($conditions, "SELECT")) { … … 1133 1151 } else { 1134 1152 # SQL will be built from specifications in argument 1135 $sql = "SELECT * FROM ".$this->table_name." "; 1136 1137 # this is if they passed in an associative array to emulate 1138 # named parameters. 1139 if(is_array($conditions)) { 1140 if(@array_key_exists("per_page", $conditions) && !is_numeric($conditions['per_page'])) { 1141 extract($conditions); 1142 $per_page = 0; 1143 } else { 1144 extract($conditions); 1145 } 1146 # If conditions wasn't in the array set it to null 1147 if(is_array($conditions)) { 1148 $conditions = null; 1149 } 1150 } 1153 $sql = "SELECT * FROM ".$this->table_name." "; 1151 1154 1152 1155 # If join specified, include it … … 1265 1268 */ 1266 1269 function find($id, $order = null, $limit = null, $joins = null) { 1270 $find_all = false; 1267 1271 if(is_array($id)) { 1268 1272 if($id[0]) {
