| 898 | | public function refresh() |
|---|
| 899 | | { |
|---|
| 900 | | if ($this->_status != 'new') { |
|---|
| 901 | | $primary = $this->_model->primary_col; |
|---|
| 902 | | $result = $this->_model->fetch($this->$primary); |
|---|
| 903 | | $cols = $this->_model->table_cols; |
|---|
| 904 | | foreach ($cols as $col => $info) { |
|---|
| 905 | | $this->$col = $result->$col; |
|---|
| 906 | | } |
|---|
| | 898 | public function refresh($status = null) |
|---|
| | 899 | { |
|---|
| | 900 | $primary = $this->_model->primary_col; |
|---|
| | 901 | $result = $this->_model->fetch($this->$primary); |
|---|
| | 902 | foreach ($this->_model->table_cols as $col => $info) { |
|---|
| | 903 | $this->$col = $result->$col; |
|---|
| | 904 | } |
|---|
| | 905 | |
|---|
| | 906 | if ($status) { |
|---|
| | 907 | $this->setStatus($status) |
|---|
| | 908 | } else { |
|---|