/** * Similar to retrieve_by_string_fields, but returns multiple objects instead of just one. * * @param array $fields_array * @return array $obj_arr */ public function retrieve_all_by_string_fields($fields_array) { $query = "SELECT *\n FROM {$this->table_name}\n " . $this->get_where($fields_array); $result = $this->db->query($query, true, " Error: "); $obj_arr = array(); while ($row = $this->db->fetchByAssoc($result, -1, FALSE)) { $focus = new ImportMap(); foreach ($this->column_fields as $field) { if (isset($row[$field])) { $focus->{$field} = $row[$field]; } } $focus->fill_in_additional_detail_fields(); $obj_arr[] = $focus; } return $obj_arr; }
function retrieve_all_by_string_fields($fields_array) { $where_clause = $this->get_where($fields_array); $query = "SELECT * FROM {$this->table_name} {$where_clause}"; $GLOBALS['log']->debug("Retrieve {$this->object_name}: " . $query); $result = $this->db->query($query, true, " Error: "); $obj_arr = array(); while ($row = $this->db->fetchByAssoc($result, -1, FALSE)) { $focus = new ImportMap(); foreach ($this->column_fields as $field) { if (isset($row[$field])) { $focus->{$field} = $row[$field]; } } $focus->fill_in_additional_detail_fields(); array_push($obj_arr, $focus); } return $obj_arr; }