original_string: protected function createImage($path)
      {
          $path = sprintf('%s/../Resources/images/%s', __DIR__, $path);
          $file = $this->container->get('enhavo_media.factory.file')->createFromPath($path);
          return $this->container->get('enhavo_media.media.media_manager')->saveFile($file);
      }
code: protected function createImage($path)
      {
          $path = sprintf('%s/../Resources/images/%s', __DIR__, $path);
          $file = $this->container->get('enhavo_media.factory.file')->createFromPath($path);
          return $this->container->get('enhavo_media.media.media_manager')->saveFile($file);
      }
code_tokens: protected function createImage ( $ path ) { $ path = sprintf ( '%s/../Resources/images/%s' , __DIR__ , $ path ) ; $ file = $ this -> container -> get ( 'enhavo_media.factory.file' ) -> createFromPath ( $ path ) ; return $ this -> container -> get ( 'enhavo_media.media.media_manager' ) -> saveFile ( $ file ) ; }
docstring: Save file and return its model.
  
  @param $path
  @return \Enhavo\Bundle\MediaBundle\Model\FileInterface
  @throws \Exception
docstring_tokens: Save file and return its model .