| @@ 440-452 (lines=13) @@ | ||
| 437 | * @param CI_DB_result $db_result Database result object |
|
| 438 | * @return void |
|
| 439 | */ |
|
| 440 | protected function _set_from_db_result($object) |
|
| 441 | { |
|
| 442 | // First generate the headings from the table column names |
|
| 443 | if ($this->auto_heading === TRUE && empty($this->heading)) |
|
| 444 | { |
|
| 445 | $this->heading = $this->_prep_args($object->list_fields()); |
|
| 446 | } |
|
| 447 | ||
| 448 | foreach ($object->result_array() as $row) |
|
| 449 | { |
|
| 450 | $this->rows[] = $this->_prep_args($row); |
|
| 451 | } |
|
| 452 | } |
|
| 453 | ||
| 454 | // -------------------------------------------------------------------- |
|
| 455 | ||
| @@ 462-473 (lines=12) @@ | ||
| 459 | * @param array $data |
|
| 460 | * @return void |
|
| 461 | */ |
|
| 462 | protected function _set_from_array($data) |
|
| 463 | { |
|
| 464 | if ($this->auto_heading === TRUE && empty($this->heading)) |
|
| 465 | { |
|
| 466 | $this->heading = $this->_prep_args(array_shift($data)); |
|
| 467 | } |
|
| 468 | ||
| 469 | foreach ($data as &$row) |
|
| 470 | { |
|
| 471 | $this->rows[] = $this->_prep_args($row); |
|
| 472 | } |
|
| 473 | } |
|
| 474 | ||
| 475 | // -------------------------------------------------------------------- |
|
| 476 | ||