code: 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);
      }
docs: @param Media[] $medias
  
  @return string