示例#1
0
文件: Post.php 项目: kminkov/Blog
 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());
     }
 }