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);
    }
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);
    }
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 ) ; }
Save file and return its model.

@param $path
@return \Enhavo\Bundle\MediaBundle\Model\FileInterface
@throws \Exception
Save file and return its model .