public function update(Options $options, $data)
 {
     $valid = true;
     if ($this->checkData($data)) {
         $newOptions = $data['options'];
         $options->setTtsLanguage($newOptions['lang']);
         $options->setShowTextTranscription($newOptions['showTextTranscription']);
         $options->setMode($newOptions['mode']);
         $this->em->persist($options);
         $this->em->flush();
     } else {
         $valid = false;
     }
     return $valid;
 }
 public function copyOptions(MediaResource $new, MediaResource $original)
 {
     $originalOptions = $original->getOptions();
     $newOptions = new Options();
     $newOptions->setMode($originalOptions->getMode());
     $newOptions->setTtsLanguage($originalOptions->getTtsLanguage());
     $newOptions->setShowTextTranscription($originalOptions->getShowTextTranscription());
     $new->setOptions($newOptions);
     $this->em->persist($new);
 }