Changeset 2584

Show
Ignore:
Timestamp:
04/27/2008 10:55:28 PM (7 months ago)
Author:
Shadowhand
Message:

Added ORM_Iterator::select_list($key, $val) and cleaned up comments.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/ORM.php

    r2580 r2584  
    11041104 
    11051105        /** 
    1106          * Returns an array of all the 
     1106         * Returns an array of the results as ORM objects. 
     1107         * 
     1108         * @return  array 
    11071109         */ 
    11081110        public function as_array() 
     
    11151117                { 
    11161118                        $array[] = new $class($obj); 
     1119                } 
     1120                return $array; 
     1121        } 
     1122 
     1123        /** 
     1124         * Create a key/value array from the results. 
     1125         * 
     1126         * @param   string  key column 
     1127         * @param   string  value column 
     1128         * @return  array 
     1129         */ 
     1130        public function select_list($key, $val) 
     1131        { 
     1132                $array = array(); 
     1133                foreach ($this->result->result_array(TRUE) as $row) 
     1134                { 
     1135                        $array[$row->$key] = $row->$val; 
    11171136                } 
    11181137                return $array;