title: Does save() method works of update in Yii
body: <p>I have <strong>Message</strong> model class. I want to check weather particular entry exist in DB table. If it doesn't exist then save new entry in DB table and if it exists then update current entry.</p>
  
  <p>Now the problem is when entry exists (update) in the DB table, Save() method gives exception.
  'CHttpException' with message 'Your request is invalid.' </p>
  
  <p>Can i use save() method instead of update() method for updating records?</p>
  
  <pre><code>     $message = Message::model()-&gt;find($criteriaMessage);       
       if (!isset($message)){
          $message = new Message();
          $message-&gt;id = $tagMessage-&gt;id;
          $message-&gt;language = $language;
          $message-&gt;translation = $translation;    
       }
       else
          $message-&gt;translation = $translation;
  
       if(!$message-&gt;save()){
          return false;
       }
  </code></pre>