/**
  * @param DocumentInterface $document
  * @param string            $locale
  *
  * @return mixed
  */
 private function getOldMessage($document, $locale)
 {
     $messages = $document->getMessages();
     foreach ($messages as $message) {
         $messageLocale = $message->getLocale();
         if ($locale == $messageLocale) {
             $oldMessage = $message->getMessage();
             return $oldMessage;
         }
     }
 }
 /**
  * Returns document id.
  *
  * @param DocumentInterface $doc
  *
  * @return string
  */
 protected function fetchDocumentId(DocumentInterface $doc)
 {
     return $doc->getId();
 }