Show
Ignore:
Timestamp:
07/09/06 14:53:36 (6 years ago)
Author:
john
Message:

added PHP Shell an interactive shell to interact with your apps models

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/active_record.php

    r224 r227  
    11271127        //          .', ' . (is_null($joins)?'null':$joins).')'); 
    11281128 
     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 
    11291147        # Test source of SQL for query 
    11301148        if(stristr($conditions, "SELECT")) { 
     
    11331151        } else { 
    11341152            # 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." ";          
    11511154             
    11521155            # If join specified, include it 
     
    12651268     */ 
    12661269    function find($id, $order = null, $limit = null, $joins = null) { 
     1270        $find_all = false; 
    12671271        if(is_array($id)) { 
    12681272            if($id[0]) {