public function loadMedia()
    {
        $files = $this->getMediaFiles();

        foreach ($files as $file) {
            $mediaFile = $this->getCollection()->newMedia();
            $mediaFile->setFile($file);
            $this->appendMediaInCollection($mediaFile);
        }
    }
public function loadMedia()
    {
        $files = $this->getMediaFiles();

        foreach ($files as $file) {
            $mediaFile = $this->getCollection()->newMedia();
            $mediaFile->setFile($file);
            $this->appendMediaInCollection($mediaFile);
        }
    }
public function loadMedia ( ) { $ files = $ this -> getMediaFiles ( ) ; foreach ( $ files as $ file ) { $ mediaFile = $ this -> getCollection ( ) -> newMedia ( ) ; $ mediaFile -> setFile ( $ file ) ; $ this -> appendMediaInCollection ( $ mediaFile ) ; } }
Load media for a collection
Load media for a collection