Guest User

Untitled

a guest
Jun 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public function save(){
  2. $dbTable = $this->getMapper()->getDbTable();
  3. if ($row = $dbTable->find($this->id)) {
  4. foreach ($this->_data as $key => $value) {
  5. $row->$key = $value;
  6. }
  7. $row->save();
  8. } else {
  9. $dbTable->insert($this->_data);
  10. }
  11. }
Add Comment
Please, Sign In to add comment