public function save(Model_Post $post) { if ($post->id) { $where[] = 'id = ' . $post->id; $this->_db->update('posts', $post->toArray(), $where); } else { $this->_db->insert('posts', $post->toArray()); } }