public function reverseTransform($element)
 {
     if (!method_exists($this->provider, 'reverseTransform')) {
         return $element;
     }
     return $this->provider->reverseTransform($element);
 }
 /**
  * @param $value
  * @return string
  */
 public function mediasFilter($value, $entities = false)
 {
     $orderedMedias = array();
     $accessor = PropertyAccess::createPropertyAccessor();
     if ($value) {
         $ids = preg_match('/;/', $value) ? explode(';', $value) : $value;
         $results = $this->provider->find($ids);
         $className = $this->provider->getClassName();
         if ($entities) {
             return $results;
         }
         if ($ids) {
             foreach ($results as $media) {
                 if (is_array($media)) {
                     $id = $accessor->getValue($media, '[id]');
                     $url = $accessor->getValue($media, '[url]');
                     if (empty($id) || empty($url)) {
                         continue;
                     }
                     $orderedMedias[$id] = $url;
                     continue;
                 }
                 if (!$media instanceof $className) {
                     continue;
                 }
                 $orderedMedias[$media->getId()] = $this->provider->getUrl($this->requestStack, $media);
             }
         }
     }
     return $orderedMedias;
 }