Пример #1
0
 public function save(Application_Model_Comment $comment)
 {
     $data = array('domain' => $comment->getDomain(), 'path' => $comment->getPath(), 'cookie' => $comment->getCookie(), 'nick' => $comment->getNick(), 'email' => $comment->getEmail(), 'ip' => $comment->getIp(), 'content' => $comment->getContent(), 'reply_to' => $comment->getReplyTo(), 'created' => date('Y-m-d H:i:s'), 'updated' => date('Y-m-d H:i:s'));
     if (null === ($id = $comment->getId())) {
         unset($data['id']);
         $this->getDbTable()->insert($data);
     } else {
         unset($data['created']);
         //Added by Pre: Don't want to change Created date when updating.
         $this->getDbTable()->update($data, array('id = ?' => $id));
     }
 }