Form/Type/UploadCollectionType.php
public function getJsonFormatedMedias($medias)
    {
        $array = array();

        foreach ($medias as $media) {
            $array[] = array(
                'id' => $media->getId(),
                'name' => $media->getMediaTypeReference(),
                'size' => false,
                'type' => '',
                'url' => '/media/'.$media->getMediaTypeReference(),
            );
        }

        return json_encode($array);
    }
public function getJsonFormatedMedias($medias)
    {
        $array = array();

        foreach ($medias as $media) {
            $array[] = array(
                'id' => $media->getId(),
                'name' => $media->getMediaTypeReference(),
                'size' => false,
                'type' => '',
                'url' => '/media/'.$media->getMediaTypeReference(),
            );
        }

        return json_encode($array);
    }
public function getJsonFormatedMedias ( $ medias ) { $ array = array ( ) ; foreach ( $ medias as $ media ) { $ array [ ] = array ( 'id' => $ media -> getId ( ) , 'name' => $ media -> getMediaTypeReference ( ) , 'size' => false , 'type' => '' , 'url' => '/media/' . $ media -> getMediaTypeReference ( ) , ) ; } return json_encode ( $ array ) ; }
@param Media[] $medias

@return string
@param Media [] $medias