| | 593 | * Creates a key/value array from all of the objects available. Uses find_all |
| | 594 | * to find the objects. |
| | 595 | * |
| | 596 | * @param string key column |
| | 597 | * @param string value column |
| | 598 | * @return array |
| | 599 | */ |
| | 600 | public function select_list($key_col, $val_col) |
| | 601 | { |
| | 602 | // Select the key an val from all objects |
| | 603 | $array = $this->select($key_col, $val_col)->find_all()->as_array(); |
| | 604 | |
| | 605 | $options = array(); |
| | 606 | foreach ($array as $row) |
| | 607 | { |
| | 608 | // Create a key/value pair array |
| | 609 | $options[$row->$key_col] = $row->$val_col; |
| | 610 | } |
| | 611 | return $options; |
| | 612 | } |
| | 613 | |
| | 614 | /** |