src/Sulu/Bundle/ContactBundle/Controller/AbstractMediaController.php
private function addThumbnails($entities, $locale)
    {
        $ids = array_filter(array_column($entities, 'thumbnails'));
        $thumbnails = $this->getMediaManager()->getFormatUrls($ids, $locale);
        foreach ($entities as $key => $entity) {
            if (array_key_exists('thumbnails', $entity)
                && $entity['thumbnails']
                && array_key_exists($entity['thumbnails'], $thumbnails)
            ) {
                $entities[$key]['thumbnails'] = $thumbnails[$entity['thumbnails']];
            }
        }

        return $entities;
    }
private function addThumbnails($entities, $locale)
    {
        $ids = array_filter(array_column($entities, 'thumbnails'));
        $thumbnails = $this->getMediaManager()->getFormatUrls($ids, $locale);
        foreach ($entities as $key => $entity) {
            if (array_key_exists('thumbnails', $entity)
                && $entity['thumbnails']
                && array_key_exists($entity['thumbnails'], $thumbnails)
            ) {
                $entities[$key]['thumbnails'] = $thumbnails[$entity['thumbnails']];
            }
        }

        return $entities;
    }
private function addThumbnails ( $ entities , $ locale ) { $ ids = array_filter ( array_column ( $ entities , 'thumbnails' ) ) ; $ thumbnails = $ this -> getMediaManager ( ) -> getFormatUrls ( $ ids , $ locale ) ; foreach ( $ entities as $ key => $ entity ) { if ( array_key_exists ( 'thumbnails' , $ entity ) && $ entity [ 'thumbnails' ] && array_key_exists ( $ entity [ 'thumbnails' ] , $ thumbnails ) ) { $ entities [ $ key ] [ 'thumbnails' ] = $ thumbnails [ $ entity [ 'thumbnails' ] ] ; } } return $ entities ; }
Takes an array of entities and resets the thumbnails-property containing the media id with
the actual urls to the thumbnails.

@param array $entities
@param string $locale

@return array
Takes an array of entities and resets the thumbnails - property containing the media id with the actual urls to the thumbnails .