/**
  * Saves a comment into the database.
  *
  * @param \MicroCMS\Domain\Comment $comment The comment to save
  */
 public function save(Commentary $comment)
 {
     $commentData = array('rate_commentary' => '0', 'text_commentary' => $comment->getText(), 'num_event' => $comment->getEvent()->getNum(), 'num_user' => $comment->getUser()->getNum());
     if ($comment->getNum()) {
         // The comment has already been saved : update it
         $this->getDb()->update('commentary', $commentData, array('num_commentary' => $comment->getNum()));
     } else {
         // The comment has never been saved : insert it
         $this->getDb()->insert('commentary', $commentData);
         // Get the id of the newly created comment and set it on the entity.
         $id = $this->getDb()->lastInsertId();
         $comment->setNum($id);
     }
 }