src/Phlexible/Component/MediaType/Model/IconResolver.php
public function resolve(MediaType $mediaType, $requestedSize = null)
    {
        $icons = $mediaType->getIcons();
        if (!count($icons)) {
            return null;
        }
        ksort($icons);

        if (isset($icons[$requestedSize])) {
            $icon = $icons[$requestedSize];
        } else {
            $icon = null;
            foreach ($icons as $size => $dummyIcon) {
                if ($size > $requestedSize) {
                    $icon = $dummyIcon;
                    break;
                }
            }
            if (!$icon) {
                $icon = end($icons);
                //return null;
            }
        }

        return $this->locator->locate($icon, null, true);
    }
public function resolve(MediaType $mediaType, $requestedSize = null)
    {
        $icons = $mediaType->getIcons();
        if (!count($icons)) {
            return null;
        }
        ksort($icons);

        if (isset($icons[$requestedSize])) {
            $icon = $icons[$requestedSize];
        } else {
            $icon = null;
            foreach ($icons as $size => $dummyIcon) {
                if ($size > $requestedSize) {
                    $icon = $dummyIcon;
                    break;
                }
            }
            if (!$icon) {
                $icon = end($icons);
                //return null;
            }
        }

        return $this->locator->locate($icon, null, true);
    }
public function resolve ( MediaType $ mediaType , $ requestedSize = null ) { $ icons = $ mediaType -> getIcons ( ) ; if ( ! count ( $ icons ) ) { return null ; } ksort ( $ icons ) ; if ( isset ( $ icons [ $ requestedSize ] ) ) { $ icon = $ icons [ $ requestedSize ] ; } else { $ icon = null ; foreach ( $ icons as $ size => $ dummyIcon ) { if ( $ size > $ requestedSize ) { $ icon = $ dummyIcon ; break ; } } if ( ! $ icon ) { $ icon = end ( $ icons ) ; //return null; } } return $ this -> locator -> locate ( $ icon , null , true ) ; }
Resolve icon.

@param MediaType $mediaType
@param int       $requestedSize

@return string
Resolve icon .