code: public function persist(MessageInterface $message)
      {
          if ($message->getMessageId() > 0) {
              $this->update($message, null, null, new MessageHydrator);
          } else {
              $this->insert($message, null, new MessageHydrator);
          }
  
          return $message;
      }
docs: persist - persists a message to the database.
  
  @param MessageInterface $message
  @return MessageInterface