Document/Index/Factory/MediaCollectionFactory.php
public function create($data, $locale)
    {
        $mediaCollection = new Collection();

        if (empty($data)) {
            return $mediaCollection;
        }

        if (array_key_exists('ids', $data)) {
            $medias = $this->mediaManager->getByIds($data['ids'], $locale);

            foreach ($medias as $media) {
                $mediaViewObject = new MediaViewObject();
                $mediaViewObject->setData($media);

                $mediaCollection[] = $mediaViewObject;
            }
        }

        return $mediaCollection;
    }
public function create($data, $locale)
    {
        $mediaCollection = new Collection();

        if (empty($data)) {
            return $mediaCollection;
        }

        if (array_key_exists('ids', $data)) {
            $medias = $this->mediaManager->getByIds($data['ids'], $locale);

            foreach ($medias as $media) {
                $mediaViewObject = new MediaViewObject();
                $mediaViewObject->setData($media);

                $mediaCollection[] = $mediaViewObject;
            }
        }

        return $mediaCollection;
    }
public function create ( $ data , $ locale ) { $ mediaCollection = new Collection ( ) ; if ( empty ( $ data ) ) { return $ mediaCollection ; } if ( array_key_exists ( 'ids' , $ data ) ) { $ medias = $ this -> mediaManager -> getByIds ( $ data [ 'ids' ] , $ locale ) ; foreach ( $ medias as $ media ) { $ mediaViewObject = new MediaViewObject ( ) ; $ mediaViewObject -> setData ( $ media ) ; $ mediaCollection [ ] = $ mediaViewObject ; } } return $ mediaCollection ; }
Create media collection object.

@param array $data
@param $locale

@return MediaViewObject[]|Collection
Create media collection object .