src/Sulu/Bundle/ContactBundle/Controller/AbstractMediaController.php
private function addUrls($entities, $locale)
    {
        $ids = array_filter(array_column($entities, 'id'));
        $apiEntities = $this->getMediaManager()->getByIds($ids, $locale);
        $i = 0;
        foreach ($entities as $key => $entity) {
            $entities[$key]['url'] = $apiEntities[$i]->getUrl();
            ++$i;
        }

        return $entities;
    }
private function addUrls($entities, $locale)
    {
        $ids = array_filter(array_column($entities, 'id'));
        $apiEntities = $this->getMediaManager()->getByIds($ids, $locale);
        $i = 0;
        foreach ($entities as $key => $entity) {
            $entities[$key]['url'] = $apiEntities[$i]->getUrl();
            ++$i;
        }

        return $entities;
    }
private function addUrls ( $ entities , $ locale ) { $ ids = array_filter ( array_column ( $ entities , 'id' ) ) ; $ apiEntities = $ this -> getMediaManager ( ) -> getByIds ( $ ids , $ locale ) ; $ i = 0 ; foreach ( $ entities as $ key => $ entity ) { $ entities [ $ key ] [ 'url' ] = $ apiEntities [ $ i ] -> getUrl ( ) ; ++ $ i ; } return $ entities ; }
Takes an array of entities and resets the url-property with the actual urls to the original file.

@param array $entities
@param string $locale

@return array
Takes an array of entities and resets the url - property with the actual urls to the original file .